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