KickJava   Java API By Example, From Geeks To Geeks.

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


1 /* ArrayType.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 javax.swing.*;
14
15 import org.enhydra.jawe.xml.*;
16 import org.enhydra.jawe.xml.panels.*;
17
18 /**
19 * Represents a WfMC DTD element that has the similar name.
20 *
21 * @see XML
22 */

23 public class ArrayType extends XMLComplexElement {
24    // must be defined
25
private DataTypes refType;
26
27    private XMLAttribute attrLowerIndex=new XMLAttribute("LowerIndex"); // required
28
private XMLAttribute attrUpperIndex=new XMLAttribute("UpperIndex"); // required
29

30    private transient DataTypes myOwner;
31    /**
32    * Creates a new instance of the class.
33    */

34    public ArrayType (DataTypes dtc,Package JavaDoc p) {
35       super();
36       myOwner=dtc;
37       refType=new DataTypes(this,p,null,0);
38       refType.setLabelName(XMLUtil.getLanguageDependentString("SubTypeKey"));
39       fillStructure();
40    }
41
42    /**
43    * Defines the super-class method. Read the explanation for
44    * this method within XMLComplexElement class.
45    */

46    protected void fillStructure () {
47       isRequired=true;
48       attrLowerIndex.setRequired(true);
49       attrUpperIndex.setRequired(true);
50
51       complexStructure.add(attrLowerIndex);
52       attributes.add(attrLowerIndex);
53       complexStructure.add(attrUpperIndex);
54       attributes.add(attrUpperIndex);
55       refType.setRequired(true);
56       complexStructure.add(refType);
57    }
58
59    public DataTypes getOwner () {
60       return myOwner;
61    }
62    /**
63    * Used to create exact copy of instance of this class.
64    * The newly created instance will have all the properties
65    * same as the copied one.
66    *
67    * @return The newly created instance of this class.
68    */

69    /*public Object clone () {
70       ArrayType at=(ArrayType)super.clone();
71
72       at.refType=(XMLComplexChoice)this.refType.clone();
73       at.attrLowerIndex=(XMLAttribute)this.attrLowerIndex.clone();
74       at.attrUpperIndex=(XMLAttribute)this.attrUpperIndex.clone();
75       at.fillStructure();
76
77       return at;
78    }*/

79
80    public void refreshLabelName () {
81       super.refreshLabelName();
82       refType.setLabelName(XMLUtil.getLanguageDependentString("SubTypeKey"));
83    }
84
85 }
86
Popular Tags