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