Save annotation colours, hideConsevation etc, graphGroups
[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 _sequenceRef\r
60      */\r
61     private java.lang.String _sequenceRef;\r
62 \r
63     /**\r
64      * Field _graphColour\r
65      */\r
66     private int _graphColour;\r
67 \r
68     /**\r
69      * keeps track of state for field: _graphColour\r
70      */\r
71     private boolean _has_graphColour;\r
72 \r
73     /**\r
74      * Field _graphGroup\r
75      */\r
76     private int _graphGroup;\r
77 \r
78     /**\r
79      * keeps track of state for field: _graphGroup\r
80      */\r
81     private boolean _has_graphGroup;\r
82 \r
83     /**\r
84      * Field _annotationElementList\r
85      */\r
86     private java.util.Vector _annotationElementList;\r
87 \r
88     /**\r
89      * Field _label\r
90      */\r
91     private java.lang.String _label;\r
92 \r
93     /**\r
94      * Field _description\r
95      */\r
96     private java.lang.String _description;\r
97 \r
98     /**\r
99      * Field _thresholdLine\r
100      */\r
101     private jalview.schemabinding.version2.ThresholdLine _thresholdLine;\r
102 \r
103 \r
104       //----------------/\r
105      //- Constructors -/\r
106     //----------------/\r
107 \r
108     public Annotation() {\r
109         super();\r
110         _annotationElementList = new Vector();\r
111     } //-- jalview.schemabinding.version2.Annotation()\r
112 \r
113 \r
114       //-----------/\r
115      //- Methods -/\r
116     //-----------/\r
117 \r
118     /**\r
119      * Method addAnnotationElement\r
120      * \r
121      * \r
122      * \r
123      * @param vAnnotationElement\r
124      */\r
125     public void addAnnotationElement(jalview.schemabinding.version2.AnnotationElement vAnnotationElement)\r
126         throws java.lang.IndexOutOfBoundsException\r
127     {\r
128         _annotationElementList.addElement(vAnnotationElement);\r
129     } //-- void addAnnotationElement(jalview.schemabinding.version2.AnnotationElement) \r
130 \r
131     /**\r
132      * Method addAnnotationElement\r
133      * \r
134      * \r
135      * \r
136      * @param index\r
137      * @param vAnnotationElement\r
138      */\r
139     public void addAnnotationElement(int index, jalview.schemabinding.version2.AnnotationElement vAnnotationElement)\r
140         throws java.lang.IndexOutOfBoundsException\r
141     {\r
142         _annotationElementList.insertElementAt(vAnnotationElement, index);\r
143     } //-- void addAnnotationElement(int, jalview.schemabinding.version2.AnnotationElement) \r
144 \r
145     /**\r
146      * Method deleteGraph\r
147      * \r
148      */\r
149     public void deleteGraph()\r
150     {\r
151         this._has_graph= false;\r
152     } //-- void deleteGraph() \r
153 \r
154     /**\r
155      * Method deleteGraphColour\r
156      * \r
157      */\r
158     public void deleteGraphColour()\r
159     {\r
160         this._has_graphColour= false;\r
161     } //-- void deleteGraphColour() \r
162 \r
163     /**\r
164      * Method deleteGraphGroup\r
165      * \r
166      */\r
167     public void deleteGraphGroup()\r
168     {\r
169         this._has_graphGroup= false;\r
170     } //-- void deleteGraphGroup() \r
171 \r
172     /**\r
173      * Method deleteGraphType\r
174      * \r
175      */\r
176     public void deleteGraphType()\r
177     {\r
178         this._has_graphType= false;\r
179     } //-- void deleteGraphType() \r
180 \r
181     /**\r
182      * Method enumerateAnnotationElement\r
183      * \r
184      * \r
185      * \r
186      * @return Enumeration\r
187      */\r
188     public java.util.Enumeration enumerateAnnotationElement()\r
189     {\r
190         return _annotationElementList.elements();\r
191     } //-- java.util.Enumeration enumerateAnnotationElement() \r
192 \r
193     /**\r
194      * Method getAnnotationElement\r
195      * \r
196      * \r
197      * \r
198      * @param index\r
199      * @return AnnotationElement\r
200      */\r
201     public jalview.schemabinding.version2.AnnotationElement getAnnotationElement(int index)\r
202         throws java.lang.IndexOutOfBoundsException\r
203     {\r
204         //-- check bounds for index\r
205         if ((index < 0) || (index > _annotationElementList.size())) {\r
206             throw new IndexOutOfBoundsException();\r
207         }\r
208         \r
209         return (jalview.schemabinding.version2.AnnotationElement) _annotationElementList.elementAt(index);\r
210     } //-- jalview.schemabinding.version2.AnnotationElement getAnnotationElement(int) \r
211 \r
212     /**\r
213      * Method getAnnotationElement\r
214      * \r
215      * \r
216      * \r
217      * @return AnnotationElement\r
218      */\r
219     public jalview.schemabinding.version2.AnnotationElement[] getAnnotationElement()\r
220     {\r
221         int size = _annotationElementList.size();\r
222         jalview.schemabinding.version2.AnnotationElement[] mArray = new jalview.schemabinding.version2.AnnotationElement[size];\r
223         for (int index = 0; index < size; index++) {\r
224             mArray[index] = (jalview.schemabinding.version2.AnnotationElement) _annotationElementList.elementAt(index);\r
225         }\r
226         return mArray;\r
227     } //-- jalview.schemabinding.version2.AnnotationElement[] getAnnotationElement() \r
228 \r
229     /**\r
230      * Method getAnnotationElementCount\r
231      * \r
232      * \r
233      * \r
234      * @return int\r
235      */\r
236     public int getAnnotationElementCount()\r
237     {\r
238         return _annotationElementList.size();\r
239     } //-- int getAnnotationElementCount() \r
240 \r
241     /**\r
242      * Returns the value of field 'description'.\r
243      * \r
244      * @return String\r
245      * @return the value of field 'description'.\r
246      */\r
247     public java.lang.String getDescription()\r
248     {\r
249         return this._description;\r
250     } //-- java.lang.String getDescription() \r
251 \r
252     /**\r
253      * Returns the value of field 'graph'.\r
254      * \r
255      * @return boolean\r
256      * @return the value of field 'graph'.\r
257      */\r
258     public boolean getGraph()\r
259     {\r
260         return this._graph;\r
261     } //-- boolean getGraph() \r
262 \r
263     /**\r
264      * Returns the value of field 'graphColour'.\r
265      * \r
266      * @return int\r
267      * @return the value of field 'graphColour'.\r
268      */\r
269     public int getGraphColour()\r
270     {\r
271         return this._graphColour;\r
272     } //-- int getGraphColour() \r
273 \r
274     /**\r
275      * Returns the value of field 'graphGroup'.\r
276      * \r
277      * @return int\r
278      * @return the value of field 'graphGroup'.\r
279      */\r
280     public int getGraphGroup()\r
281     {\r
282         return this._graphGroup;\r
283     } //-- int getGraphGroup() \r
284 \r
285     /**\r
286      * Returns the value of field 'graphType'.\r
287      * \r
288      * @return int\r
289      * @return the value of field 'graphType'.\r
290      */\r
291     public int getGraphType()\r
292     {\r
293         return this._graphType;\r
294     } //-- int getGraphType() \r
295 \r
296     /**\r
297      * Returns the value of field 'label'.\r
298      * \r
299      * @return String\r
300      * @return the value of field 'label'.\r
301      */\r
302     public java.lang.String getLabel()\r
303     {\r
304         return this._label;\r
305     } //-- java.lang.String getLabel() \r
306 \r
307     /**\r
308      * Returns the value of field 'sequenceRef'.\r
309      * \r
310      * @return String\r
311      * @return the value of field 'sequenceRef'.\r
312      */\r
313     public java.lang.String getSequenceRef()\r
314     {\r
315         return this._sequenceRef;\r
316     } //-- java.lang.String getSequenceRef() \r
317 \r
318     /**\r
319      * Returns the value of field 'thresholdLine'.\r
320      * \r
321      * @return ThresholdLine\r
322      * @return the value of field 'thresholdLine'.\r
323      */\r
324     public jalview.schemabinding.version2.ThresholdLine getThresholdLine()\r
325     {\r
326         return this._thresholdLine;\r
327     } //-- jalview.schemabinding.version2.ThresholdLine getThresholdLine() \r
328 \r
329     /**\r
330      * Method hasGraph\r
331      * \r
332      * \r
333      * \r
334      * @return boolean\r
335      */\r
336     public boolean hasGraph()\r
337     {\r
338         return this._has_graph;\r
339     } //-- boolean hasGraph() \r
340 \r
341     /**\r
342      * Method hasGraphColour\r
343      * \r
344      * \r
345      * \r
346      * @return boolean\r
347      */\r
348     public boolean hasGraphColour()\r
349     {\r
350         return this._has_graphColour;\r
351     } //-- boolean hasGraphColour() \r
352 \r
353     /**\r
354      * Method hasGraphGroup\r
355      * \r
356      * \r
357      * \r
358      * @return boolean\r
359      */\r
360     public boolean hasGraphGroup()\r
361     {\r
362         return this._has_graphGroup;\r
363     } //-- boolean hasGraphGroup() \r
364 \r
365     /**\r
366      * Method hasGraphType\r
367      * \r
368      * \r
369      * \r
370      * @return boolean\r
371      */\r
372     public boolean hasGraphType()\r
373     {\r
374         return this._has_graphType;\r
375     } //-- boolean hasGraphType() \r
376 \r
377     /**\r
378      * Method isValid\r
379      * \r
380      * \r
381      * \r
382      * @return boolean\r
383      */\r
384     public boolean isValid()\r
385     {\r
386         try {\r
387             validate();\r
388         }\r
389         catch (org.exolab.castor.xml.ValidationException vex) {\r
390             return false;\r
391         }\r
392         return true;\r
393     } //-- boolean isValid() \r
394 \r
395     /**\r
396      * Method marshal\r
397      * \r
398      * \r
399      * \r
400      * @param out\r
401      */\r
402     public void marshal(java.io.Writer out)\r
403         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException\r
404     {\r
405         \r
406         Marshaller.marshal(this, out);\r
407     } //-- void marshal(java.io.Writer) \r
408 \r
409     /**\r
410      * Method marshal\r
411      * \r
412      * \r
413      * \r
414      * @param handler\r
415      */\r
416     public void marshal(org.xml.sax.ContentHandler handler)\r
417         throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException\r
418     {\r
419         \r
420         Marshaller.marshal(this, handler);\r
421     } //-- void marshal(org.xml.sax.ContentHandler) \r
422 \r
423     /**\r
424      * Method removeAllAnnotationElement\r
425      * \r
426      */\r
427     public void removeAllAnnotationElement()\r
428     {\r
429         _annotationElementList.removeAllElements();\r
430     } //-- void removeAllAnnotationElement() \r
431 \r
432     /**\r
433      * Method removeAnnotationElement\r
434      * \r
435      * \r
436      * \r
437      * @param index\r
438      * @return AnnotationElement\r
439      */\r
440     public jalview.schemabinding.version2.AnnotationElement removeAnnotationElement(int index)\r
441     {\r
442         java.lang.Object obj = _annotationElementList.elementAt(index);\r
443         _annotationElementList.removeElementAt(index);\r
444         return (jalview.schemabinding.version2.AnnotationElement) obj;\r
445     } //-- jalview.schemabinding.version2.AnnotationElement removeAnnotationElement(int) \r
446 \r
447     /**\r
448      * Method setAnnotationElement\r
449      * \r
450      * \r
451      * \r
452      * @param index\r
453      * @param vAnnotationElement\r
454      */\r
455     public void setAnnotationElement(int index, jalview.schemabinding.version2.AnnotationElement vAnnotationElement)\r
456         throws java.lang.IndexOutOfBoundsException\r
457     {\r
458         //-- check bounds for index\r
459         if ((index < 0) || (index > _annotationElementList.size())) {\r
460             throw new IndexOutOfBoundsException();\r
461         }\r
462         _annotationElementList.setElementAt(vAnnotationElement, index);\r
463     } //-- void setAnnotationElement(int, jalview.schemabinding.version2.AnnotationElement) \r
464 \r
465     /**\r
466      * Method setAnnotationElement\r
467      * \r
468      * \r
469      * \r
470      * @param annotationElementArray\r
471      */\r
472     public void setAnnotationElement(jalview.schemabinding.version2.AnnotationElement[] annotationElementArray)\r
473     {\r
474         //-- copy array\r
475         _annotationElementList.removeAllElements();\r
476         for (int i = 0; i < annotationElementArray.length; i++) {\r
477             _annotationElementList.addElement(annotationElementArray[i]);\r
478         }\r
479     } //-- void setAnnotationElement(jalview.schemabinding.version2.AnnotationElement) \r
480 \r
481     /**\r
482      * Sets the value of field 'description'.\r
483      * \r
484      * @param description the value of field 'description'.\r
485      */\r
486     public void setDescription(java.lang.String description)\r
487     {\r
488         this._description = description;\r
489     } //-- void setDescription(java.lang.String) \r
490 \r
491     /**\r
492      * Sets the value of field 'graph'.\r
493      * \r
494      * @param graph the value of field 'graph'.\r
495      */\r
496     public void setGraph(boolean graph)\r
497     {\r
498         this._graph = graph;\r
499         this._has_graph = true;\r
500     } //-- void setGraph(boolean) \r
501 \r
502     /**\r
503      * Sets the value of field 'graphColour'.\r
504      * \r
505      * @param graphColour the value of field 'graphColour'.\r
506      */\r
507     public void setGraphColour(int graphColour)\r
508     {\r
509         this._graphColour = graphColour;\r
510         this._has_graphColour = true;\r
511     } //-- void setGraphColour(int) \r
512 \r
513     /**\r
514      * Sets the value of field 'graphGroup'.\r
515      * \r
516      * @param graphGroup the value of field 'graphGroup'.\r
517      */\r
518     public void setGraphGroup(int graphGroup)\r
519     {\r
520         this._graphGroup = graphGroup;\r
521         this._has_graphGroup = true;\r
522     } //-- void setGraphGroup(int) \r
523 \r
524     /**\r
525      * Sets the value of field 'graphType'.\r
526      * \r
527      * @param graphType the value of field 'graphType'.\r
528      */\r
529     public void setGraphType(int graphType)\r
530     {\r
531         this._graphType = graphType;\r
532         this._has_graphType = true;\r
533     } //-- void setGraphType(int) \r
534 \r
535     /**\r
536      * Sets the value of field 'label'.\r
537      * \r
538      * @param label the value of field 'label'.\r
539      */\r
540     public void setLabel(java.lang.String label)\r
541     {\r
542         this._label = label;\r
543     } //-- void setLabel(java.lang.String) \r
544 \r
545     /**\r
546      * Sets the value of field 'sequenceRef'.\r
547      * \r
548      * @param sequenceRef the value of field 'sequenceRef'.\r
549      */\r
550     public void setSequenceRef(java.lang.String sequenceRef)\r
551     {\r
552         this._sequenceRef = sequenceRef;\r
553     } //-- void setSequenceRef(java.lang.String) \r
554 \r
555     /**\r
556      * Sets the value of field 'thresholdLine'.\r
557      * \r
558      * @param thresholdLine the value of field 'thresholdLine'.\r
559      */\r
560     public void setThresholdLine(jalview.schemabinding.version2.ThresholdLine thresholdLine)\r
561     {\r
562         this._thresholdLine = thresholdLine;\r
563     } //-- void setThresholdLine(jalview.schemabinding.version2.ThresholdLine) \r
564 \r
565     /**\r
566      * Method unmarshal\r
567      * \r
568      * \r
569      * \r
570      * @param reader\r
571      * @return Object\r
572      */\r
573     public static java.lang.Object unmarshal(java.io.Reader reader)\r
574         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException\r
575     {\r
576         return (jalview.schemabinding.version2.Annotation) Unmarshaller.unmarshal(jalview.schemabinding.version2.Annotation.class, reader);\r
577     } //-- java.lang.Object unmarshal(java.io.Reader) \r
578 \r
579     /**\r
580      * Method validate\r
581      * \r
582      */\r
583     public void validate()\r
584         throws org.exolab.castor.xml.ValidationException\r
585     {\r
586         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();\r
587         validator.validate(this);\r
588     } //-- void validate() \r
589 \r
590 }\r