01: package org.enhydra.jawe.components.graph.actions;
02:
03: import javax.swing.ImageIcon;
04:
05: import org.enhydra.jawe.components.graph.Graph;
06: import org.enhydra.jawe.components.graph.GraphController;
07: import org.enhydra.jawe.components.graph.GraphEAConstants;
08: import org.enhydra.jawe.components.graph.GraphSettings;
09:
10: /**
11: /**
12: * Inserts the special (virtual) participant in the graph that represents
13: * the container for entering expressions for evaluating performer of each
14: * activity being put inside it. Each activity contained inside this participant
15: * can have its own performer expression.
16: * There can be only one such (virtual) participant in the graph,
17: * and it will be represented as the part of extended attribute in the
18: * XPDL model.
19: * @author Sasa Bojanic
20: */
21: public class SetParticipantModeFreeTextExpression extends
22: SetParticipantMode {
23:
24: public SetParticipantModeFreeTextExpression(
25: GraphController jawecomponent) {
26: super (jawecomponent,
27: GraphEAConstants.PARTICIPANT_TYPE_FREE_TEXT_EXPRESSION);
28: }
29:
30: public void enableDisableAction() {
31: GraphController gc = (GraphController) jawecomponent;
32: boolean en = false;
33: Graph sg = gc.getSelectedGraph();
34: if (sg != null && !sg.getXPDLObject().isReadOnly()) {
35: if (!sg.getGraphManager()
36: .isFreeTextExpressionParticipantShown()) {
37: en = true;
38: }
39: }
40: setEnabled(en);
41: }
42:
43: protected ImageIcon getIcon() {
44: return ((GraphSettings) jawecomponent.getSettings())
45: .getFreeTextParticipantIcon();
46: }
47:
48: }
|