2fead37c780cfc9d108788de56d13ff5d1debb84
[jalview.git] / src / jalview / schemabinding / version2 / Annotation.java
1 /*
2  * This class was automatically generated with 
3  * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
4  * Schema.
5  * $Id$
6  */
7
8 package jalview.schemabinding.version2;
9
10 //---------------------------------/
11 //- Imported classes and packages -/
12 //---------------------------------/
13
14 import org.exolab.castor.xml.Marshaller;
15 import org.exolab.castor.xml.Unmarshaller;
16
17 /**
18  * Class Annotation.
19  * 
20  * @version $Revision$ $Date$
21  */
22 public class Annotation implements java.io.Serializable
23 {
24
25   // --------------------------/
26   // - Class/Member Variables -/
27   // --------------------------/
28
29   /**
30    * Field _graph.
31    */
32   private boolean _graph;
33
34   /**
35    * keeps track of state for field: _graph
36    */
37   private boolean _has_graph;
38
39   /**
40    * Field _graphType.
41    */
42   private int _graphType;
43
44   /**
45    * keeps track of state for field: _graphType
46    */
47   private boolean _has_graphType;
48
49   /**
50    * Field _sequenceRef.
51    */
52   private java.lang.String _sequenceRef;
53
54   /**
55    * Field _groupRef.
56    */
57   private java.lang.String _groupRef;
58
59   /**
60    * Field _graphColour.
61    */
62   private int _graphColour;
63
64   /**
65    * keeps track of state for field: _graphColour
66    */
67   private boolean _has_graphColour;
68
69   /**
70    * Field _graphGroup.
71    */
72   private int _graphGroup;
73
74   /**
75    * keeps track of state for field: _graphGroup
76    */
77   private boolean _has_graphGroup;
78
79   /**
80    * height in pixels for the graph if this is a graph-type annotation.
81    */
82   private int _graphHeight;
83
84   /**
85    * keeps track of state for field: _graphHeight
86    */
87   private boolean _has_graphHeight;
88
89   /**
90    * Field _id.
91    */
92   private java.lang.String _id;
93
94   /**
95    * Field _scoreOnly.
96    */
97   private boolean _scoreOnly = false;
98
99   /**
100    * keeps track of state for field: _scoreOnly
101    */
102   private boolean _has_scoreOnly;
103
104   /**
105    * Field _score.
106    */
107   private double _score;
108
109   /**
110    * keeps track of state for field: _score
111    */
112   private boolean _has_score;
113
114   /**
115    * Field _visible.
116    */
117   private boolean _visible;
118
119   /**
120    * keeps track of state for field: _visible
121    */
122   private boolean _has_visible;
123
124   /**
125    * Field _centreColLabels.
126    */
127   private boolean _centreColLabels;
128
129   /**
130    * keeps track of state for field: _centreColLabels
131    */
132   private boolean _has_centreColLabels;
133
134   /**
135    * Field _scaleColLabels.
136    */
137   private boolean _scaleColLabels;
138
139   /**
140    * keeps track of state for field: _scaleColLabels
141    */
142   private boolean _has_scaleColLabels;
143
144   /**
145    * Field _showAllColLabels.
146    */
147   private boolean _showAllColLabels;
148
149   /**
150    * keeps track of state for field: _showAllColLabels
151    */
152   private boolean _has_showAllColLabels;
153
154   /**
155    * is an autocalculated annotation row
156    */
157   private boolean _autoCalculated = false;
158
159   /**
160    * keeps track of state for field: _autoCalculated
161    */
162   private boolean _has_autoCalculated;
163
164   /**
165    * is to be shown below the alignment - introduced in Jalview 2.8 for
166    * visualizing T-COFFEE alignment scores
167    */
168   private boolean _belowAlignment = true;
169
170   /**
171    * keeps track of state for field: _belowAlignment
172    */
173   private boolean _has_belowAlignment;
174
175   /**
176    * Optional string identifier used to group sets of annotation produced by a
177    * particular calculation. Values are opaque strings but have semantic meaning
178    * to Jalview's renderer, data importer and calculation system.
179    */
180   private java.lang.String _calcId;
181
182   /**
183    * Field _annotationElementList.
184    */
185   private java.util.Vector _annotationElementList;
186
187   /**
188    * Field _label.
189    */
190   private java.lang.String _label;
191
192   /**
193    * Field _description.
194    */
195   private java.lang.String _description;
196
197   /**
198    * Field _thresholdLine.
199    */
200   private jalview.schemabinding.version2.ThresholdLine _thresholdLine;
201
202   /**
203    * Field _propertyList.
204    */
205   private java.util.Vector _propertyList;
206
207   // ----------------/
208   // - Constructors -/
209   // ----------------/
210
211   public Annotation()
212   {
213     super();
214     this._annotationElementList = new java.util.Vector();
215     this._propertyList = new java.util.Vector();
216   }
217
218   // -----------/
219   // - Methods -/
220   // -----------/
221
222   /**
223    * 
224    * 
225    * @param vAnnotationElement
226    * @throws java.lang.IndexOutOfBoundsException
227    *           if the index given is outside the bounds of the collection
228    */
229   public void addAnnotationElement(
230           final jalview.schemabinding.version2.AnnotationElement vAnnotationElement)
231           throws java.lang.IndexOutOfBoundsException
232   {
233     this._annotationElementList.addElement(vAnnotationElement);
234   }
235
236   /**
237    * 
238    * 
239    * @param index
240    * @param vAnnotationElement
241    * @throws java.lang.IndexOutOfBoundsException
242    *           if the index given is outside the bounds of the collection
243    */
244   public void addAnnotationElement(
245           final int index,
246           final jalview.schemabinding.version2.AnnotationElement vAnnotationElement)
247           throws java.lang.IndexOutOfBoundsException
248   {
249     this._annotationElementList.add(index, vAnnotationElement);
250   }
251
252   /**
253    * 
254    * 
255    * @param vProperty
256    * @throws java.lang.IndexOutOfBoundsException
257    *           if the index given is outside the bounds of the collection
258    */
259   public void addProperty(
260           final jalview.schemabinding.version2.Property vProperty)
261           throws java.lang.IndexOutOfBoundsException
262   {
263     this._propertyList.addElement(vProperty);
264   }
265
266   /**
267    * 
268    * 
269    * @param index
270    * @param vProperty
271    * @throws java.lang.IndexOutOfBoundsException
272    *           if the index given is outside the bounds of the collection
273    */
274   public void addProperty(final int index,
275           final jalview.schemabinding.version2.Property vProperty)
276           throws java.lang.IndexOutOfBoundsException
277   {
278     this._propertyList.add(index, vProperty);
279   }
280
281   /**
282      */
283   public void deleteAutoCalculated()
284   {
285     this._has_autoCalculated = false;
286   }
287
288   /**
289      */
290   public void deleteBelowAlignment()
291   {
292     this._has_belowAlignment = false;
293   }
294
295   /**
296      */
297   public void deleteCentreColLabels()
298   {
299     this._has_centreColLabels = false;
300   }
301
302   /**
303      */
304   public void deleteGraph()
305   {
306     this._has_graph = false;
307   }
308
309   /**
310      */
311   public void deleteGraphColour()
312   {
313     this._has_graphColour = false;
314   }
315
316   /**
317      */
318   public void deleteGraphGroup()
319   {
320     this._has_graphGroup = false;
321   }
322
323   /**
324      */
325   public void deleteGraphHeight()
326   {
327     this._has_graphHeight = false;
328   }
329
330   /**
331      */
332   public void deleteGraphType()
333   {
334     this._has_graphType = false;
335   }
336
337   /**
338      */
339   public void deleteScaleColLabels()
340   {
341     this._has_scaleColLabels = false;
342   }
343
344   /**
345      */
346   public void deleteScore()
347   {
348     this._has_score = false;
349   }
350
351   /**
352      */
353   public void deleteScoreOnly()
354   {
355     this._has_scoreOnly = false;
356   }
357
358   /**
359      */
360   public void deleteShowAllColLabels()
361   {
362     this._has_showAllColLabels = false;
363   }
364
365   /**
366      */
367   public void deleteVisible()
368   {
369     this._has_visible = false;
370   }
371
372   /**
373    * Method enumerateAnnotationElement.
374    * 
375    * @return an Enumeration over all
376    *         jalview.schemabinding.version2.AnnotationElement elements
377    */
378   public java.util.Enumeration enumerateAnnotationElement()
379   {
380     return this._annotationElementList.elements();
381   }
382
383   /**
384    * Method enumerateProperty.
385    * 
386    * @return an Enumeration over all jalview.schemabinding.version2.Property
387    *         elements
388    */
389   public java.util.Enumeration enumerateProperty()
390   {
391     return this._propertyList.elements();
392   }
393
394   /**
395    * Method getAnnotationElement.
396    * 
397    * @param index
398    * @throws java.lang.IndexOutOfBoundsException
399    *           if the index given is outside the bounds of the collection
400    * @return the value of the jalview.schemabinding.version2.AnnotationElement
401    *         at the given index
402    */
403   public jalview.schemabinding.version2.AnnotationElement getAnnotationElement(
404           final int index) throws java.lang.IndexOutOfBoundsException
405   {
406     // check bounds for index
407     if (index < 0 || index >= this._annotationElementList.size())
408     {
409       throw new IndexOutOfBoundsException(
410               "getAnnotationElement: Index value '" + index
411                       + "' not in range [0.."
412                       + (this._annotationElementList.size() - 1) + "]");
413     }
414
415     return (jalview.schemabinding.version2.AnnotationElement) _annotationElementList
416             .get(index);
417   }
418
419   /**
420    * Method getAnnotationElement.Returns the contents of the collection in an
421    * Array.
422    * <p>
423    * Note: Just in case the collection contents are changing in another thread,
424    * we pass a 0-length Array of the correct type into the API call. This way we
425    * <i>know</i> that the Array returned is of exactly the correct length.
426    * 
427    * @return this collection as an Array
428    */
429   public jalview.schemabinding.version2.AnnotationElement[] getAnnotationElement()
430   {
431     jalview.schemabinding.version2.AnnotationElement[] array = new jalview.schemabinding.version2.AnnotationElement[0];
432     return (jalview.schemabinding.version2.AnnotationElement[]) this._annotationElementList
433             .toArray(array);
434   }
435
436   /**
437    * Method getAnnotationElementCount.
438    * 
439    * @return the size of this collection
440    */
441   public int getAnnotationElementCount()
442   {
443     return this._annotationElementList.size();
444   }
445
446   /**
447    * Returns the value of field 'autoCalculated'. The field 'autoCalculated' has
448    * the following description: is an autocalculated annotation row
449    * 
450    * @return the value of field 'AutoCalculated'.
451    */
452   public boolean getAutoCalculated()
453   {
454     return this._autoCalculated;
455   }
456
457   /**
458    * Returns the value of field 'belowAlignment'. The field 'belowAlignment' has
459    * the following description: is to be shown below the alignment - introduced
460    * in Jalview 2.8 for visualizing T-COFFEE alignment scores
461    * 
462    * @return the value of field 'BelowAlignment'.
463    */
464   public boolean getBelowAlignment()
465   {
466     return this._belowAlignment;
467   }
468
469   /**
470    * Returns the value of field 'calcId'. The field 'calcId' has the following
471    * description: Optional string identifier used to group sets of annotation
472    * produced by a particular calculation. Values are opaque strings but have
473    * semantic meaning to Jalview's renderer, data importer and calculation
474    * system.
475    * 
476    * @return the value of field 'CalcId'.
477    */
478   public java.lang.String getCalcId()
479   {
480     return this._calcId;
481   }
482
483   /**
484    * Returns the value of field 'centreColLabels'.
485    * 
486    * @return the value of field 'CentreColLabels'.
487    */
488   public boolean getCentreColLabels()
489   {
490     return this._centreColLabels;
491   }
492
493   /**
494    * Returns the value of field 'description'.
495    * 
496    * @return the value of field 'Description'.
497    */
498   public java.lang.String getDescription()
499   {
500     return this._description;
501   }
502
503   /**
504    * Returns the value of field 'graph'.
505    * 
506    * @return the value of field 'Graph'.
507    */
508   public boolean getGraph()
509   {
510     return this._graph;
511   }
512
513   /**
514    * Returns the value of field 'graphColour'.
515    * 
516    * @return the value of field 'GraphColour'.
517    */
518   public int getGraphColour()
519   {
520     return this._graphColour;
521   }
522
523   /**
524    * Returns the value of field 'graphGroup'.
525    * 
526    * @return the value of field 'GraphGroup'.
527    */
528   public int getGraphGroup()
529   {
530     return this._graphGroup;
531   }
532
533   /**
534    * Returns the value of field 'graphHeight'. The field 'graphHeight' has the
535    * following description: height in pixels for the graph if this is a
536    * graph-type annotation.
537    * 
538    * @return the value of field 'GraphHeight'.
539    */
540   public int getGraphHeight()
541   {
542     return this._graphHeight;
543   }
544
545   /**
546    * Returns the value of field 'graphType'.
547    * 
548    * @return the value of field 'GraphType'.
549    */
550   public int getGraphType()
551   {
552     return this._graphType;
553   }
554
555   /**
556    * Returns the value of field 'groupRef'.
557    * 
558    * @return the value of field 'GroupRef'.
559    */
560   public java.lang.String getGroupRef()
561   {
562     return this._groupRef;
563   }
564
565   /**
566    * Returns the value of field 'id'.
567    * 
568    * @return the value of field 'Id'.
569    */
570   public java.lang.String getId()
571   {
572     return this._id;
573   }
574
575   /**
576    * Returns the value of field 'label'.
577    * 
578    * @return the value of field 'Label'.
579    */
580   public java.lang.String getLabel()
581   {
582     return this._label;
583   }
584
585   /**
586    * Method getProperty.
587    * 
588    * @param index
589    * @throws java.lang.IndexOutOfBoundsException
590    *           if the index given is outside the bounds of the collection
591    * @return the value of the jalview.schemabinding.version2.Property at the
592    *         given index
593    */
594   public jalview.schemabinding.version2.Property getProperty(final int index)
595           throws java.lang.IndexOutOfBoundsException
596   {
597     // check bounds for index
598     if (index < 0 || index >= this._propertyList.size())
599     {
600       throw new IndexOutOfBoundsException("getProperty: Index value '"
601               + index + "' not in range [0.."
602               + (this._propertyList.size() - 1) + "]");
603     }
604
605     return (jalview.schemabinding.version2.Property) _propertyList
606             .get(index);
607   }
608
609   /**
610    * Method getProperty.Returns the contents of the collection in an Array.
611    * <p>
612    * Note: Just in case the collection contents are changing in another thread,
613    * we pass a 0-length Array of the correct type into the API call. This way we
614    * <i>know</i> that the Array returned is of exactly the correct length.
615    * 
616    * @return this collection as an Array
617    */
618   public jalview.schemabinding.version2.Property[] getProperty()
619   {
620     jalview.schemabinding.version2.Property[] array = new jalview.schemabinding.version2.Property[0];
621     return (jalview.schemabinding.version2.Property[]) this._propertyList
622             .toArray(array);
623   }
624
625   /**
626    * Method getPropertyCount.
627    * 
628    * @return the size of this collection
629    */
630   public int getPropertyCount()
631   {
632     return this._propertyList.size();
633   }
634
635   /**
636    * Returns the value of field 'scaleColLabels'.
637    * 
638    * @return the value of field 'ScaleColLabels'.
639    */
640   public boolean getScaleColLabels()
641   {
642     return this._scaleColLabels;
643   }
644
645   /**
646    * Returns the value of field 'score'.
647    * 
648    * @return the value of field 'Score'.
649    */
650   public double getScore()
651   {
652     return this._score;
653   }
654
655   /**
656    * Returns the value of field 'scoreOnly'.
657    * 
658    * @return the value of field 'ScoreOnly'.
659    */
660   public boolean getScoreOnly()
661   {
662     return this._scoreOnly;
663   }
664
665   /**
666    * Returns the value of field 'sequenceRef'.
667    * 
668    * @return the value of field 'SequenceRef'.
669    */
670   public java.lang.String getSequenceRef()
671   {
672     return this._sequenceRef;
673   }
674
675   /**
676    * Returns the value of field 'showAllColLabels'.
677    * 
678    * @return the value of field 'ShowAllColLabels'.
679    */
680   public boolean getShowAllColLabels()
681   {
682     return this._showAllColLabels;
683   }
684
685   /**
686    * Returns the value of field 'thresholdLine'.
687    * 
688    * @return the value of field 'ThresholdLine'.
689    */
690   public jalview.schemabinding.version2.ThresholdLine getThresholdLine()
691   {
692     return this._thresholdLine;
693   }
694
695   /**
696    * Returns the value of field 'visible'.
697    * 
698    * @return the value of field 'Visible'.
699    */
700   public boolean getVisible()
701   {
702     return this._visible;
703   }
704
705   /**
706    * Method hasAutoCalculated.
707    * 
708    * @return true if at least one AutoCalculated has been added
709    */
710   public boolean hasAutoCalculated()
711   {
712     return this._has_autoCalculated;
713   }
714
715   /**
716    * Method hasBelowAlignment.
717    * 
718    * @return true if at least one BelowAlignment has been added
719    */
720   public boolean hasBelowAlignment()
721   {
722     return this._has_belowAlignment;
723   }
724
725   /**
726    * Method hasCentreColLabels.
727    * 
728    * @return true if at least one CentreColLabels has been added
729    */
730   public boolean hasCentreColLabels()
731   {
732     return this._has_centreColLabels;
733   }
734
735   /**
736    * Method hasGraph.
737    * 
738    * @return true if at least one Graph has been added
739    */
740   public boolean hasGraph()
741   {
742     return this._has_graph;
743   }
744
745   /**
746    * Method hasGraphColour.
747    * 
748    * @return true if at least one GraphColour has been added
749    */
750   public boolean hasGraphColour()
751   {
752     return this._has_graphColour;
753   }
754
755   /**
756    * Method hasGraphGroup.
757    * 
758    * @return true if at least one GraphGroup has been added
759    */
760   public boolean hasGraphGroup()
761   {
762     return this._has_graphGroup;
763   }
764
765   /**
766    * Method hasGraphHeight.
767    * 
768    * @return true if at least one GraphHeight has been added
769    */
770   public boolean hasGraphHeight()
771   {
772     return this._has_graphHeight;
773   }
774
775   /**
776    * Method hasGraphType.
777    * 
778    * @return true if at least one GraphType has been added
779    */
780   public boolean hasGraphType()
781   {
782     return this._has_graphType;
783   }
784
785   /**
786    * Method hasScaleColLabels.
787    * 
788    * @return true if at least one ScaleColLabels has been added
789    */
790   public boolean hasScaleColLabels()
791   {
792     return this._has_scaleColLabels;
793   }
794
795   /**
796    * Method hasScore.
797    * 
798    * @return true if at least one Score has been added
799    */
800   public boolean hasScore()
801   {
802     return this._has_score;
803   }
804
805   /**
806    * Method hasScoreOnly.
807    * 
808    * @return true if at least one ScoreOnly has been added
809    */
810   public boolean hasScoreOnly()
811   {
812     return this._has_scoreOnly;
813   }
814
815   /**
816    * Method hasShowAllColLabels.
817    * 
818    * @return true if at least one ShowAllColLabels has been added
819    */
820   public boolean hasShowAllColLabels()
821   {
822     return this._has_showAllColLabels;
823   }
824
825   /**
826    * Method hasVisible.
827    * 
828    * @return true if at least one Visible has been added
829    */
830   public boolean hasVisible()
831   {
832     return this._has_visible;
833   }
834
835   /**
836    * Returns the value of field 'autoCalculated'. The field 'autoCalculated' has
837    * the following description: is an autocalculated annotation row
838    * 
839    * @return the value of field 'AutoCalculated'.
840    */
841   public boolean isAutoCalculated()
842   {
843     return this._autoCalculated;
844   }
845
846   /**
847    * Returns the value of field 'belowAlignment'. The field 'belowAlignment' has
848    * the following description: is to be shown below the alignment - introduced
849    * in Jalview 2.8 for visualizing T-COFFEE alignment scores
850    * 
851    * @return the value of field 'BelowAlignment'.
852    */
853   public boolean isBelowAlignment()
854   {
855     return this._belowAlignment;
856   }
857
858   /**
859    * Returns the value of field 'centreColLabels'.
860    * 
861    * @return the value of field 'CentreColLabels'.
862    */
863   public boolean isCentreColLabels()
864   {
865     return this._centreColLabels;
866   }
867
868   /**
869    * Returns the value of field 'graph'.
870    * 
871    * @return the value of field 'Graph'.
872    */
873   public boolean isGraph()
874   {
875     return this._graph;
876   }
877
878   /**
879    * Returns the value of field 'scaleColLabels'.
880    * 
881    * @return the value of field 'ScaleColLabels'.
882    */
883   public boolean isScaleColLabels()
884   {
885     return this._scaleColLabels;
886   }
887
888   /**
889    * Returns the value of field 'scoreOnly'.
890    * 
891    * @return the value of field 'ScoreOnly'.
892    */
893   public boolean isScoreOnly()
894   {
895     return this._scoreOnly;
896   }
897
898   /**
899    * Returns the value of field 'showAllColLabels'.
900    * 
901    * @return the value of field 'ShowAllColLabels'.
902    */
903   public boolean isShowAllColLabels()
904   {
905     return this._showAllColLabels;
906   }
907
908   /**
909    * Method isValid.
910    * 
911    * @return true if this object is valid according to the schema
912    */
913   public boolean isValid()
914   {
915     try
916     {
917       validate();
918     } catch (org.exolab.castor.xml.ValidationException vex)
919     {
920       return false;
921     }
922     return true;
923   }
924
925   /**
926    * Returns the value of field 'visible'.
927    * 
928    * @return the value of field 'Visible'.
929    */
930   public boolean isVisible()
931   {
932     return this._visible;
933   }
934
935   /**
936    * 
937    * 
938    * @param out
939    * @throws org.exolab.castor.xml.MarshalException
940    *           if object is null or if any SAXException is thrown during
941    *           marshaling
942    * @throws org.exolab.castor.xml.ValidationException
943    *           if this object is an invalid instance according to the schema
944    */
945   public void marshal(final java.io.Writer out)
946           throws org.exolab.castor.xml.MarshalException,
947           org.exolab.castor.xml.ValidationException
948   {
949     Marshaller.marshal(this, out);
950   }
951
952   /**
953    * 
954    * 
955    * @param handler
956    * @throws java.io.IOException
957    *           if an IOException occurs during marshaling
958    * @throws org.exolab.castor.xml.ValidationException
959    *           if this object is an invalid instance according to the schema
960    * @throws org.exolab.castor.xml.MarshalException
961    *           if object is null or if any SAXException is thrown during
962    *           marshaling
963    */
964   public void marshal(final org.xml.sax.ContentHandler handler)
965           throws java.io.IOException,
966           org.exolab.castor.xml.MarshalException,
967           org.exolab.castor.xml.ValidationException
968   {
969     Marshaller.marshal(this, handler);
970   }
971
972   /**
973      */
974   public void removeAllAnnotationElement()
975   {
976     this._annotationElementList.clear();
977   }
978
979   /**
980      */
981   public void removeAllProperty()
982   {
983     this._propertyList.clear();
984   }
985
986   /**
987    * Method removeAnnotationElement.
988    * 
989    * @param vAnnotationElement
990    * @return true if the object was removed from the collection.
991    */
992   public boolean removeAnnotationElement(
993           final jalview.schemabinding.version2.AnnotationElement vAnnotationElement)
994   {
995     boolean removed = _annotationElementList.remove(vAnnotationElement);
996     return removed;
997   }
998
999   /**
1000    * Method removeAnnotationElementAt.
1001    * 
1002    * @param index
1003    * @return the element removed from the collection
1004    */
1005   public jalview.schemabinding.version2.AnnotationElement removeAnnotationElementAt(
1006           final int index)
1007   {
1008     java.lang.Object obj = this._annotationElementList.remove(index);
1009     return (jalview.schemabinding.version2.AnnotationElement) obj;
1010   }
1011
1012   /**
1013    * Method removeProperty.
1014    * 
1015    * @param vProperty
1016    * @return true if the object was removed from the collection.
1017    */
1018   public boolean removeProperty(
1019           final jalview.schemabinding.version2.Property vProperty)
1020   {
1021     boolean removed = _propertyList.remove(vProperty);
1022     return removed;
1023   }
1024
1025   /**
1026    * Method removePropertyAt.
1027    * 
1028    * @param index
1029    * @return the element removed from the collection
1030    */
1031   public jalview.schemabinding.version2.Property removePropertyAt(
1032           final int index)
1033   {
1034     java.lang.Object obj = this._propertyList.remove(index);
1035     return (jalview.schemabinding.version2.Property) obj;
1036   }
1037
1038   /**
1039    * 
1040    * 
1041    * @param index
1042    * @param vAnnotationElement
1043    * @throws java.lang.IndexOutOfBoundsException
1044    *           if the index given is outside the bounds of the collection
1045    */
1046   public void setAnnotationElement(
1047           final int index,
1048           final jalview.schemabinding.version2.AnnotationElement vAnnotationElement)
1049           throws java.lang.IndexOutOfBoundsException
1050   {
1051     // check bounds for index
1052     if (index < 0 || index >= this._annotationElementList.size())
1053     {
1054       throw new IndexOutOfBoundsException(
1055               "setAnnotationElement: Index value '" + index
1056                       + "' not in range [0.."
1057                       + (this._annotationElementList.size() - 1) + "]");
1058     }
1059
1060     this._annotationElementList.set(index, vAnnotationElement);
1061   }
1062
1063   /**
1064    * 
1065    * 
1066    * @param vAnnotationElementArray
1067    */
1068   public void setAnnotationElement(
1069           final jalview.schemabinding.version2.AnnotationElement[] vAnnotationElementArray)
1070   {
1071     // -- copy array
1072     _annotationElementList.clear();
1073
1074     for (int i = 0; i < vAnnotationElementArray.length; i++)
1075     {
1076       this._annotationElementList.add(vAnnotationElementArray[i]);
1077     }
1078   }
1079
1080   /**
1081    * Sets the value of field 'autoCalculated'. The field 'autoCalculated' has
1082    * the following description: is an autocalculated annotation row
1083    * 
1084    * @param autoCalculated
1085    *          the value of field 'autoCalculated'.
1086    */
1087   public void setAutoCalculated(final boolean autoCalculated)
1088   {
1089     this._autoCalculated = autoCalculated;
1090     this._has_autoCalculated = true;
1091   }
1092
1093   /**
1094    * Sets the value of field 'belowAlignment'. The field 'belowAlignment' has
1095    * the following description: is to be shown below the alignment - introduced
1096    * in Jalview 2.8 for visualizing T-COFFEE alignment scores
1097    * 
1098    * @param belowAlignment
1099    *          the value of field 'belowAlignment'.
1100    */
1101   public void setBelowAlignment(final boolean belowAlignment)
1102   {
1103     this._belowAlignment = belowAlignment;
1104     this._has_belowAlignment = true;
1105   }
1106
1107   /**
1108    * Sets the value of field 'calcId'. The field 'calcId' has the following
1109    * description: Optional string identifier used to group sets of annotation
1110    * produced by a particular calculation. Values are opaque strings but have
1111    * semantic meaning to Jalview's renderer, data importer and calculation
1112    * system.
1113    * 
1114    * @param calcId
1115    *          the value of field 'calcId'.
1116    */
1117   public void setCalcId(final java.lang.String calcId)
1118   {
1119     this._calcId = calcId;
1120   }
1121
1122   /**
1123    * Sets the value of field 'centreColLabels'.
1124    * 
1125    * @param centreColLabels
1126    *          the value of field 'centreColLabels'.
1127    */
1128   public void setCentreColLabels(final boolean centreColLabels)
1129   {
1130     this._centreColLabels = centreColLabels;
1131     this._has_centreColLabels = true;
1132   }
1133
1134   /**
1135    * Sets the value of field 'description'.
1136    * 
1137    * @param description
1138    *          the value of field 'description'.
1139    */
1140   public void setDescription(final java.lang.String description)
1141   {
1142     this._description = description;
1143   }
1144
1145   /**
1146    * Sets the value of field 'graph'.
1147    * 
1148    * @param graph
1149    *          the value of field 'graph'.
1150    */
1151   public void setGraph(final boolean graph)
1152   {
1153     this._graph = graph;
1154     this._has_graph = true;
1155   }
1156
1157   /**
1158    * Sets the value of field 'graphColour'.
1159    * 
1160    * @param graphColour
1161    *          the value of field 'graphColour'.
1162    */
1163   public void setGraphColour(final int graphColour)
1164   {
1165     this._graphColour = graphColour;
1166     this._has_graphColour = true;
1167   }
1168
1169   /**
1170    * Sets the value of field 'graphGroup'.
1171    * 
1172    * @param graphGroup
1173    *          the value of field 'graphGroup'.
1174    */
1175   public void setGraphGroup(final int graphGroup)
1176   {
1177     this._graphGroup = graphGroup;
1178     this._has_graphGroup = true;
1179   }
1180
1181   /**
1182    * Sets the value of field 'graphHeight'. The field 'graphHeight' has the
1183    * following description: height in pixels for the graph if this is a
1184    * graph-type annotation.
1185    * 
1186    * @param graphHeight
1187    *          the value of field 'graphHeight'.
1188    */
1189   public void setGraphHeight(final int graphHeight)
1190   {
1191     this._graphHeight = graphHeight;
1192     this._has_graphHeight = true;
1193   }
1194
1195   /**
1196    * Sets the value of field 'graphType'.
1197    * 
1198    * @param graphType
1199    *          the value of field 'graphType'.
1200    */
1201   public void setGraphType(final int graphType)
1202   {
1203     this._graphType = graphType;
1204     this._has_graphType = true;
1205   }
1206
1207   /**
1208    * Sets the value of field 'groupRef'.
1209    * 
1210    * @param groupRef
1211    *          the value of field 'groupRef'.
1212    */
1213   public void setGroupRef(final java.lang.String groupRef)
1214   {
1215     this._groupRef = groupRef;
1216   }
1217
1218   /**
1219    * Sets the value of field 'id'.
1220    * 
1221    * @param id
1222    *          the value of field 'id'.
1223    */
1224   public void setId(final java.lang.String id)
1225   {
1226     this._id = id;
1227   }
1228
1229   /**
1230    * Sets the value of field 'label'.
1231    * 
1232    * @param label
1233    *          the value of field 'label'.
1234    */
1235   public void setLabel(final java.lang.String label)
1236   {
1237     this._label = label;
1238   }
1239
1240   /**
1241    * 
1242    * 
1243    * @param index
1244    * @param vProperty
1245    * @throws java.lang.IndexOutOfBoundsException
1246    *           if the index given is outside the bounds of the collection
1247    */
1248   public void setProperty(final int index,
1249           final jalview.schemabinding.version2.Property vProperty)
1250           throws java.lang.IndexOutOfBoundsException
1251   {
1252     // check bounds for index
1253     if (index < 0 || index >= this._propertyList.size())
1254     {
1255       throw new IndexOutOfBoundsException("setProperty: Index value '"
1256               + index + "' not in range [0.."
1257               + (this._propertyList.size() - 1) + "]");
1258     }
1259
1260     this._propertyList.set(index, vProperty);
1261   }
1262
1263   /**
1264    * 
1265    * 
1266    * @param vPropertyArray
1267    */
1268   public void setProperty(
1269           final jalview.schemabinding.version2.Property[] vPropertyArray)
1270   {
1271     // -- copy array
1272     _propertyList.clear();
1273
1274     for (int i = 0; i < vPropertyArray.length; i++)
1275     {
1276       this._propertyList.add(vPropertyArray[i]);
1277     }
1278   }
1279
1280   /**
1281    * Sets the value of field 'scaleColLabels'.
1282    * 
1283    * @param scaleColLabels
1284    *          the value of field 'scaleColLabels'.
1285    */
1286   public void setScaleColLabels(final boolean scaleColLabels)
1287   {
1288     this._scaleColLabels = scaleColLabels;
1289     this._has_scaleColLabels = true;
1290   }
1291
1292   /**
1293    * Sets the value of field 'score'.
1294    * 
1295    * @param score
1296    *          the value of field 'score'.
1297    */
1298   public void setScore(final double score)
1299   {
1300     this._score = score;
1301     this._has_score = true;
1302   }
1303
1304   /**
1305    * Sets the value of field 'scoreOnly'.
1306    * 
1307    * @param scoreOnly
1308    *          the value of field 'scoreOnly'.
1309    */
1310   public void setScoreOnly(final boolean scoreOnly)
1311   {
1312     this._scoreOnly = scoreOnly;
1313     this._has_scoreOnly = true;
1314   }
1315
1316   /**
1317    * Sets the value of field 'sequenceRef'.
1318    * 
1319    * @param sequenceRef
1320    *          the value of field 'sequenceRef'.
1321    */
1322   public void setSequenceRef(final java.lang.String sequenceRef)
1323   {
1324     this._sequenceRef = sequenceRef;
1325   }
1326
1327   /**
1328    * Sets the value of field 'showAllColLabels'.
1329    * 
1330    * @param showAllColLabels
1331    *          the value of field 'showAllColLabels'
1332    */
1333   public void setShowAllColLabels(final boolean showAllColLabels)
1334   {
1335     this._showAllColLabels = showAllColLabels;
1336     this._has_showAllColLabels = true;
1337   }
1338
1339   /**
1340    * Sets the value of field 'thresholdLine'.
1341    * 
1342    * @param thresholdLine
1343    *          the value of field 'thresholdLine'.
1344    */
1345   public void setThresholdLine(
1346           final jalview.schemabinding.version2.ThresholdLine thresholdLine)
1347   {
1348     this._thresholdLine = thresholdLine;
1349   }
1350
1351   /**
1352    * Sets the value of field 'visible'.
1353    * 
1354    * @param visible
1355    *          the value of field 'visible'.
1356    */
1357   public void setVisible(final boolean visible)
1358   {
1359     this._visible = visible;
1360     this._has_visible = true;
1361   }
1362
1363   /**
1364    * Method unmarshal.
1365    * 
1366    * @param reader
1367    * @throws org.exolab.castor.xml.MarshalException
1368    *           if object is null or if any SAXException is thrown during
1369    *           marshaling
1370    * @throws org.exolab.castor.xml.ValidationException
1371    *           if this object is an invalid instance according to the schema
1372    * @return the unmarshaled jalview.schemabinding.version2.Annotation
1373    */
1374   public static jalview.schemabinding.version2.Annotation unmarshal(
1375           final java.io.Reader reader)
1376           throws org.exolab.castor.xml.MarshalException,
1377           org.exolab.castor.xml.ValidationException
1378   {
1379     return (jalview.schemabinding.version2.Annotation) Unmarshaller
1380             .unmarshal(jalview.schemabinding.version2.Annotation.class,
1381                     reader);
1382   }
1383
1384   /**
1385    * 
1386    * 
1387    * @throws org.exolab.castor.xml.ValidationException
1388    *           if this object is an invalid instance according to the schema
1389    */
1390   public void validate() throws org.exolab.castor.xml.ValidationException
1391   {
1392     org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
1393     validator.validate(this);
1394   }
1395
1396 }