KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > jawe > xml > elements > Split


1 /* Split.java
2  *
3  * Authors:
4  * Stefanovic Nenad chupo@iis.ns.ac.yu
5  * Bojanic Sasa sasaboy@neobee.net
6  * Puskas Vladimir vpuskas@eunet.yu
7  * Pilipovic Goran zboniek@uns.ac.yu
8  *
9  */

10
11 package org.enhydra.jawe.xml.elements;
12
13 import org.enhydra.jawe.xml.*;
14 import org.enhydra.jawe.xml.panels.*;
15 import org.w3c.dom.*;
16
17 /**
18 * Represents a WfMC DTD element that has the similar name.
19 */

20 public class Split extends XMLComplexElement {
21
22    private TransitionRefs refTransitionRefs=new TransitionRefs(); // min=0
23
private XMLAttribute attrType=new XMLAttribute("Type",
24       new String JavaDoc[] {
25          "",
26          "AND",
27          "XOR"
28       },0);
29
30    /**
31    * Creates a new instance of the class.
32    */

33    public Split() {
34       super();
35
36       attrType.setLabelName(XMLUtil.getLanguageDependentString("SplitTypeKey"));
37       fillStructure();
38    }
39
40    /**
41    * Defines the super-class method. Read the explanation for
42    * this method within XMLComplexElement class.
43    */

44    protected void fillStructure () {
45       complexStructure.add(attrType);
46       attributes.add(attrType);
47       complexStructure.add(refTransitionRefs);
48    }
49
50    /**
51    * The split is empty if user didn't select AND or XOR.
52    */

53    public boolean isEmpty() {
54       return (attrType.getChoosen().toString().length()==0);
55    }
56
57
58    /**
59    * Prepares the panel with a combo box to choose the one of
60    * allowed split types.
61    *
62    * @return XMLPanel to be shown.
63    */

64    public XMLPanel getPanel () {
65       return attrType.getPanel();
66    }
67
68    /**
69    * Used to create exact copy of instance of this class.
70    * The newly created instance will have all the properties
71    * same as the copied one.
72    *
73    * @return The newly created instance of this class.
74    */

75    public Object JavaDoc clone () {
76       Split s=(Split)super.clone();
77
78       s.attrType=(XMLAttribute)this.attrType.clone();
79       s.refTransitionRefs=(TransitionRefs)this.refTransitionRefs.clone();
80
81       s.fillStructure();
82
83       return s;
84    }
85
86    public void refreshLabelName () {
87       super.refreshLabelName();
88       attrType.setLabelName(XMLUtil.getLanguageDependentString("SplitTypeKey"));
89    }
90
91 }
92
Popular Tags