Save graph threshold and annotation colours
[jalview.git] / src / jalview / schemabinding / version2 / Annotation.java
1 /*\r
2  * This class was automatically generated with \r
3  * <a href="http://www.castor.org">Castor 0.9.6</a>, using an XML\r
4  * Schema.\r
5  * $Id$\r
6  */\r
7 \r
8 package jalview.schemabinding.version2;\r
9 \r
10   //---------------------------------/\r
11  //- Imported classes and packages -/\r
12 //---------------------------------/\r
13 \r
14 import java.io.IOException;\r
15 import java.io.Reader;\r
16 import java.io.Serializable;\r
17 import java.io.Writer;\r
18 import java.util.Enumeration;\r
19 import java.util.Vector;\r
20 import org.exolab.castor.xml.MarshalException;\r
21 import org.exolab.castor.xml.Marshaller;\r
22 import org.exolab.castor.xml.Unmarshaller;\r
23 import org.exolab.castor.xml.ValidationException;\r
24 import org.xml.sax.ContentHandler;\r
25 \r
26 /**\r
27  * Class Annotation.\r
28  * \r
29  * @version $Revision$ $Date$\r
30  */\r
31 public class Annotation implements java.io.Serializable {\r
32 \r
33 \r
34       //--------------------------/\r
35      //- Class/Member Variables -/\r
36     //--------------------------/\r
37 \r
38     /**\r
39      * Field _graph\r
40      */\r
41     private boolean _graph;\r
42 \r
43     /**\r
44      * keeps track of state for field: _graph\r
45      */\r
46     private boolean _has_graph;\r
47 \r
48     /**\r
49      * Field _graphType\r
50      */\r
51     private int _graphType;\r
52 \r
53     /**\r
54      * keeps track of state for field: _graphType\r
55      */\r
56     private boolean _has_graphType;\r
57 \r
58     /**\r
59      * Field _annotationElementList\r
60      */\r
61     private java.util.Vector _annotationElementList;\r
62 \r
63     /**\r
64      * Field _label\r
65      */\r
66     private java.lang.String _label;\r
67 \r
68     /**\r
69      * Field _description\r
70      */\r
71     private java.lang.String _description;\r
72 \r
73     /**\r
74      * Field _thresholdLine\r
75      */\r
76     private jalview.schemabinding.version2.ThresholdLine _thresholdLine;\r
77 \r
78 \r
79       //----------------/\r
80      //- Constructors -/\r
81     //----------------/\r
82 \r
83     public Annotation() {\r
84         super();\r
85         _annotationElementList = new Vector();\r
86     } //-- jalview.schemabinding.version2.Annotation()\r
87 \r
88 \r
89       //-----------/\r
90      //- Methods -/\r
91     //-----------/\r
92 \r
93     /**\r
94      * Method addAnnotationElement\r
95      * \r
96      * \r
97      * \r
98      * @param vAnnotationElement\r
99      */\r
100     public void addAnnotationElement(jalview.schemabinding.version2.AnnotationElement vAnnotationElement)\r
101         throws java.lang.IndexOutOfBoundsException\r
102     {\r
103         _annotationElementList.addElement(vAnnotationElement);\r
104     } //-- void addAnnotationElement(jalview.schemabinding.version2.AnnotationElement) \r
105 \r
106     /**\r
107      * Method addAnnotationElement\r
108      * \r
109      * \r
110      * \r
111      * @param index\r
112      * @param vAnnotationElement\r
113      */\r
114     public void addAnnotationElement(int index, jalview.schemabinding.version2.AnnotationElement vAnnotationElement)\r
115         throws java.lang.IndexOutOfBoundsException\r
116     {\r
117         _annotationElementList.insertElementAt(vAnnotationElement, index);\r
118     } //-- void addAnnotationElement(int, jalview.schemabinding.version2.AnnotationElement) \r
119 \r
120     /**\r
121      * Method deleteGraph\r
122      * \r
123      */\r
124     public void deleteGraph()\r
125     {\r
126         this._has_graph= false;\r
127     } //-- void deleteGraph() \r
128 \r
129     /**\r
130      * Method deleteGraphType\r
131      * \r
132      */\r
133     public void deleteGraphType()\r
134     {\r
135         this._has_graphType= false;\r
136     } //-- void deleteGraphType() \r
137 \r
138     /**\r
139      * Method enumerateAnnotationElement\r
140      * \r
141      * \r
142      * \r
143      * @return Enumeration\r
144      */\r
145     public java.util.Enumeration enumerateAnnotationElement()\r
146     {\r
147         return _annotationElementList.elements();\r
148     } //-- java.util.Enumeration enumerateAnnotationElement() \r
149 \r
150     /**\r
151      * Method getAnnotationElement\r
152      * \r
153      * \r
154      * \r
155      * @param index\r
156      * @return AnnotationElement\r
157      */\r
158     public jalview.schemabinding.version2.AnnotationElement getAnnotationElement(int index)\r
159         throws java.lang.IndexOutOfBoundsException\r
160     {\r
161         //-- check bounds for index\r
162         if ((index < 0) || (index > _annotationElementList.size())) {\r
163             throw new IndexOutOfBoundsException();\r
164         }\r
165         \r
166         return (jalview.schemabinding.version2.AnnotationElement) _annotationElementList.elementAt(index);\r
167     } //-- jalview.schemabinding.version2.AnnotationElement getAnnotationElement(int) \r
168 \r
169     /**\r
170      * Method getAnnotationElement\r
171      * \r
172      * \r
173      * \r
174      * @return AnnotationElement\r
175      */\r
176     public jalview.schemabinding.version2.AnnotationElement[] getAnnotationElement()\r
177     {\r
178         int size = _annotationElementList.size();\r
179         jalview.schemabinding.version2.AnnotationElement[] mArray = new jalview.schemabinding.version2.AnnotationElement[size];\r
180         for (int index = 0; index < size; index++) {\r
181             mArray[index] = (jalview.schemabinding.version2.AnnotationElement) _annotationElementList.elementAt(index);\r
182         }\r
183         return mArray;\r
184     } //-- jalview.schemabinding.version2.AnnotationElement[] getAnnotationElement() \r
185 \r
186     /**\r
187      * Method getAnnotationElementCount\r
188      * \r
189      * \r
190      * \r
191      * @return int\r
192      */\r
193     public int getAnnotationElementCount()\r
194     {\r
195         return _annotationElementList.size();\r
196     } //-- int getAnnotationElementCount() \r
197 \r
198     /**\r
199      * Returns the value of field 'description'.\r
200      * \r
201      * @return String\r
202      * @return the value of field 'description'.\r
203      */\r
204     public java.lang.String getDescription()\r
205     {\r
206         return this._description;\r
207     } //-- java.lang.String getDescription() \r
208 \r
209     /**\r
210      * Returns the value of field 'graph'.\r
211      * \r
212      * @return boolean\r
213      * @return the value of field 'graph'.\r
214      */\r
215     public boolean getGraph()\r
216     {\r
217         return this._graph;\r
218     } //-- boolean getGraph() \r
219 \r
220     /**\r
221      * Returns the value of field 'graphType'.\r
222      * \r
223      * @return int\r
224      * @return the value of field 'graphType'.\r
225      */\r
226     public int getGraphType()\r
227     {\r
228         return this._graphType;\r
229     } //-- int getGraphType() \r
230 \r
231     /**\r
232      * Returns the value of field 'label'.\r
233      * \r
234      * @return String\r
235      * @return the value of field 'label'.\r
236      */\r
237     public java.lang.String getLabel()\r
238     {\r
239         return this._label;\r
240     } //-- java.lang.String getLabel() \r
241 \r
242     /**\r
243      * Returns the value of field 'thresholdLine'.\r
244      * \r
245      * @return ThresholdLine\r
246      * @return the value of field 'thresholdLine'.\r
247      */\r
248     public jalview.schemabinding.version2.ThresholdLine getThresholdLine()\r
249     {\r
250         return this._thresholdLine;\r
251     } //-- jalview.schemabinding.version2.ThresholdLine getThresholdLine() \r
252 \r
253     /**\r
254      * Method hasGraph\r
255      * \r
256      * \r
257      * \r
258      * @return boolean\r
259      */\r
260     public boolean hasGraph()\r
261     {\r
262         return this._has_graph;\r
263     } //-- boolean hasGraph() \r
264 \r
265     /**\r
266      * Method hasGraphType\r
267      * \r
268      * \r
269      * \r
270      * @return boolean\r
271      */\r
272     public boolean hasGraphType()\r
273     {\r
274         return this._has_graphType;\r
275     } //-- boolean hasGraphType() \r
276 \r
277     /**\r
278      * Method isValid\r
279      * \r
280      * \r
281      * \r
282      * @return boolean\r
283      */\r
284     public boolean isValid()\r
285     {\r
286         try {\r
287             validate();\r
288         }\r
289         catch (org.exolab.castor.xml.ValidationException vex) {\r
290             return false;\r
291         }\r
292         return true;\r
293     } //-- boolean isValid() \r
294 \r
295     /**\r
296      * Method marshal\r
297      * \r
298      * \r
299      * \r
300      * @param out\r
301      */\r
302     public void marshal(java.io.Writer out)\r
303         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException\r
304     {\r
305         \r
306         Marshaller.marshal(this, out);\r
307     } //-- void marshal(java.io.Writer) \r
308 \r
309     /**\r
310      * Method marshal\r
311      * \r
312      * \r
313      * \r
314      * @param handler\r
315      */\r
316     public void marshal(org.xml.sax.ContentHandler handler)\r
317         throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException\r
318     {\r
319         \r
320         Marshaller.marshal(this, handler);\r
321     } //-- void marshal(org.xml.sax.ContentHandler) \r
322 \r
323     /**\r
324      * Method removeAllAnnotationElement\r
325      * \r
326      */\r
327     public void removeAllAnnotationElement()\r
328     {\r
329         _annotationElementList.removeAllElements();\r
330     } //-- void removeAllAnnotationElement() \r
331 \r
332     /**\r
333      * Method removeAnnotationElement\r
334      * \r
335      * \r
336      * \r
337      * @param index\r
338      * @return AnnotationElement\r
339      */\r
340     public jalview.schemabinding.version2.AnnotationElement removeAnnotationElement(int index)\r
341     {\r
342         java.lang.Object obj = _annotationElementList.elementAt(index);\r
343         _annotationElementList.removeElementAt(index);\r
344         return (jalview.schemabinding.version2.AnnotationElement) obj;\r
345     } //-- jalview.schemabinding.version2.AnnotationElement removeAnnotationElement(int) \r
346 \r
347     /**\r
348      * Method setAnnotationElement\r
349      * \r
350      * \r
351      * \r
352      * @param index\r
353      * @param vAnnotationElement\r
354      */\r
355     public void setAnnotationElement(int index, jalview.schemabinding.version2.AnnotationElement vAnnotationElement)\r
356         throws java.lang.IndexOutOfBoundsException\r
357     {\r
358         //-- check bounds for index\r
359         if ((index < 0) || (index > _annotationElementList.size())) {\r
360             throw new IndexOutOfBoundsException();\r
361         }\r
362         _annotationElementList.setElementAt(vAnnotationElement, index);\r
363     } //-- void setAnnotationElement(int, jalview.schemabinding.version2.AnnotationElement) \r
364 \r
365     /**\r
366      * Method setAnnotationElement\r
367      * \r
368      * \r
369      * \r
370      * @param annotationElementArray\r
371      */\r
372     public void setAnnotationElement(jalview.schemabinding.version2.AnnotationElement[] annotationElementArray)\r
373     {\r
374         //-- copy array\r
375         _annotationElementList.removeAllElements();\r
376         for (int i = 0; i < annotationElementArray.length; i++) {\r
377             _annotationElementList.addElement(annotationElementArray[i]);\r
378         }\r
379     } //-- void setAnnotationElement(jalview.schemabinding.version2.AnnotationElement) \r
380 \r
381     /**\r
382      * Sets the value of field 'description'.\r
383      * \r
384      * @param description the value of field 'description'.\r
385      */\r
386     public void setDescription(java.lang.String description)\r
387     {\r
388         this._description = description;\r
389     } //-- void setDescription(java.lang.String) \r
390 \r
391     /**\r
392      * Sets the value of field 'graph'.\r
393      * \r
394      * @param graph the value of field 'graph'.\r
395      */\r
396     public void setGraph(boolean graph)\r
397     {\r
398         this._graph = graph;\r
399         this._has_graph = true;\r
400     } //-- void setGraph(boolean) \r
401 \r
402     /**\r
403      * Sets the value of field 'graphType'.\r
404      * \r
405      * @param graphType the value of field 'graphType'.\r
406      */\r
407     public void setGraphType(int graphType)\r
408     {\r
409         this._graphType = graphType;\r
410         this._has_graphType = true;\r
411     } //-- void setGraphType(int) \r
412 \r
413     /**\r
414      * Sets the value of field 'label'.\r
415      * \r
416      * @param label the value of field 'label'.\r
417      */\r
418     public void setLabel(java.lang.String label)\r
419     {\r
420         this._label = label;\r
421     } //-- void setLabel(java.lang.String) \r
422 \r
423     /**\r
424      * Sets the value of field 'thresholdLine'.\r
425      * \r
426      * @param thresholdLine the value of field 'thresholdLine'.\r
427      */\r
428     public void setThresholdLine(jalview.schemabinding.version2.ThresholdLine thresholdLine)\r
429     {\r
430         this._thresholdLine = thresholdLine;\r
431     } //-- void setThresholdLine(jalview.schemabinding.version2.ThresholdLine) \r
432 \r
433     /**\r
434      * Method unmarshal\r
435      * \r
436      * \r
437      * \r
438      * @param reader\r
439      * @return Object\r
440      */\r
441     public static java.lang.Object unmarshal(java.io.Reader reader)\r
442         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException\r
443     {\r
444         return (jalview.schemabinding.version2.Annotation) Unmarshaller.unmarshal(jalview.schemabinding.version2.Annotation.class, reader);\r
445     } //-- java.lang.Object unmarshal(java.io.Reader) \r
446 \r
447     /**\r
448      * Method validate\r
449      * \r
450      */\r
451     public void validate()\r
452         throws org.exolab.castor.xml.ValidationException\r
453     {\r
454         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();\r
455         validator.validate(this);\r
456     } //-- void validate() \r
457 \r
458 }\r