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