Step 3:

Implement the functionality so that when the user clicks on or near a line, that line's thickness changes. To implement this, define a set of four possible thickness values in ascending order (e.g., in the example below, the possible values are 2, 4, 6, and 8). The order of the thicknesses determines the order of the transitions. Each qualifying mouse click causes the thickness to advance to the next possible value. When the next value after the last value in the list is reached should be the first value (e.g., cycle through the values).

Aspect to consider: stroke is a rendering attribute that needs to be set prior to invocation of the Graphic2D's drawLine method. This adds complexity to the view's paint(Graphics) method. How might all of the line shape's attributes be instead encapsulated wholly within the Line class?

Example - initial state and after each of successive mouseClicked events

Pasted Graphic 1
Pasted Graphic 5
Pasted Graphic 3
Pasted Graphic 4
Pasted Graphic 7