File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -59,15 +59,25 @@ public void performAction() {
5959
6060 //construct line segment
6161 LineSegment lineSegment = new LineSegment ((SimplePoint )(items .get (0 )), (SimplePoint )(items .get (1 )));
62+
63+
64+ addLineSegment (lineSegment );
65+ }
66+ /**
67+ * This method updates the panel's list of paint components and selection after a line segment is added
68+ * Subclasses should call this method to update the panel when customizing the addition of a line segment
69+ *
70+ * @param lineSegment the lineSegment to be added to the painting panel
71+ */
72+ protected void addLineSegment (LineSegment lineSegment ) {
73+
6274 //add to panel
6375 panel .addPaintComponent (lineSegment );
6476
6577 //change selection
6678 panel .getSelectTool ().clearSelection ();
6779 panel .getSelectTool ().selectComponent (lineSegment );
6880 panel .repaint ();
69-
70-
7181 }
7282
7383 @ Override
You can’t perform that action at this time.
0 commit comments