01: package org.enhydra.shark.xpdl.elements;
02:
03: import java.util.ArrayList;
04:
05: import org.enhydra.shark.xpdl.XMLComplexChoice;
06: import org.enhydra.shark.xpdl.XMLElement;
07: import org.enhydra.shark.xpdl.XMLEmptyChoiceElement;
08:
09: /**
10: * Represents the choice for start and end modes for activity.
11: *
12: * @author Sasa Bojanic
13: */
14: public class StartFinishModes extends XMLComplexChoice {
15:
16: public StartFinishModes(StartMode parent) {
17: super (parent, "Mode", false);
18: fillChoices();
19: }
20:
21: public StartFinishModes(FinishMode parent) {
22: super (parent, "Mode", false);
23: fillChoices();
24: }
25:
26: public void fillChoices() {
27: choices = new ArrayList();
28: choices.add(new XMLEmptyChoiceElement(this ));
29: choices.add(new Automatic(this ));
30: choices.add(new Manual(this ));
31: choosen = (XMLElement) choices.get(0);
32: }
33:
34: public XMLEmptyChoiceElement getEmptyChoiceElement() {
35: return (XMLEmptyChoiceElement) choices.get(0);
36: }
37:
38: public void setEmptyChoiceElement() {
39: setChoosen((XMLEmptyChoiceElement) choices.get(0));
40: }
41:
42: public Automatic getAutomatic() {
43: return (Automatic) choices.get(1);
44: }
45:
46: public void setAutomatic() {
47: setChoosen((Automatic) choices.get(1));
48: }
49:
50: public Manual getManual() {
51: return (Manual) choices.get(2);
52: }
53:
54: public void setManual() {
55: setChoosen((Manual) choices.get(2));
56: }
57:
58: }
|