01: /**
02: * Miroslav Popov, Sep 20, 2005
03: * miroslav.popov@gmail.com
04: */package org.enhydra.jawe.components.graph.actions;
05:
06: import java.awt.event.ActionEvent;
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.shark.xpdl.XMLUtil;
12:
13: /**
14: * @author Miroslav Popov
15: *
16: */
17: public class SetSelectMode extends SetToolboxMode {
18:
19: public SetSelectMode(GraphController jawecomponent) {
20: super (jawecomponent, GraphEAConstants.SELECT_TYPE,
21: GraphEAConstants.SELECT_TYPE_DEFAULT);
22: }
23:
24: public void enableDisableAction() {
25: GraphController gc = (GraphController) jawecomponent;
26:
27: if (gc.getSelectedGraph() != null
28: && XMLUtil.getPackage(gc.getSelectedGraph()
29: .getXPDLObject()) == JaWEManager.getInstance()
30: .getJaWEController().getMainPackage())
31: setEnabled(true);
32: else
33: setEnabled(false);
34: }
35:
36: public void actionPerformed(ActionEvent e) {
37: GraphController gc = (GraphController) jawecomponent;
38:
39: gc.getGraphMarqueeHandler().setType(type, subType, null);
40: }
41: }
|