File tree Expand file tree Collapse file tree 1 file changed +31
-5
lines changed
Expand file tree Collapse file tree 1 file changed +31
-5
lines changed Original file line number Diff line number Diff line change 22
33import ui .PaintPanel ;
44
5+ /**
6+ * Paint Action abstracts a particular menu action
7+ *
8+ * Override this class to create a new Action.
9+ *
10+ * Perfrom action will only be called when can perform action returns true.
11+ *
12+ * Most of the cases, you have to call panel.repaint() as the last statement of
13+ * perform action
14+ *
15+ * @author chenzb
16+ *
17+ */
518public abstract class PaintAction {
6-
19+
720 protected PaintPanel panel ;
821
9- public PaintAction (PaintPanel panel ){
22+ public PaintAction (PaintPanel panel ) {
1023 this .panel = panel ;
1124 }
12-
25+
26+ /**
27+ * Whether this action can perform. Subclasses generally base the return
28+ * value on the current selection on screen
29+ * <code>panel.getSelectTool().getSelectedComponents</code>
30+ *
31+ * @return true if the action can be performed
32+ */
1333 public abstract boolean canPerformAction ();
34+
1435 /**
15- * Performs this action
16- * Subclassess must invoke panel.repaint if the action changes the panel
36+ * Performs this action Subclassess must invoke panel.repaint if the action
37+ * changes the panel
1738 */
1839 public abstract void performAction ();
1940
41+ /**
42+ * The location of this item in the menu bar.
43+ * For example, "File/Save As..", "File/Open Recent/Clear Menu"
44+ * @return
45+ */
2046 public abstract String locationString ();
2147
2248}
You can’t perform that action at this time.
0 commit comments