01: /**
02: * Miroslav Popov, Sep 20, 2005
03: * miroslav.popov@gmail.com
04: */package org.enhydra.jawe.components.graph.actions;
05:
06: import javax.swing.ImageIcon;
07:
08: import org.enhydra.jawe.JaWEManager;
09: import org.enhydra.jawe.components.graph.GraphController;
10: import org.enhydra.jawe.components.graph.GraphEAConstants;
11: import org.enhydra.jawe.components.graph.GraphSettings;
12: import org.enhydra.shark.xpdl.XMLUtil;
13:
14: /**
15: * @author Miroslav Popov
16: *
17: */
18: public class SetEndMode extends SetToolboxMode {
19:
20: public SetEndMode(GraphController jawecomponent) {
21: super (jawecomponent, GraphEAConstants.END_TYPE,
22: GraphEAConstants.END_TYPE_DEFAULT);
23: }
24:
25: public void enableDisableAction() {
26: GraphController gc = (GraphController) jawecomponent;
27:
28: if (gc.getGraphSettings().shouldUseBubbles()
29: && gc.getSelectedGraph() != null
30: && XMLUtil.getPackage(gc.getSelectedGraph()
31: .getXPDLObject()) == JaWEManager.getInstance()
32: .getJaWEController().getMainPackage()
33: && gc.getSelectedGraph().getRoots().length != 0)
34: setEnabled(true);
35: else
36: setEnabled(false);
37: }
38:
39: protected ImageIcon getIcon() {
40: return ((GraphSettings) jawecomponent.getSettings())
41: .getBubbleEndIcon();
42: }
43:
44: }
|