2 * This class was automatically generated with
3 * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
8 package jalview.schemabinding.version2;
10 //---------------------------------/
11 //- Imported classes and packages -/
12 //---------------------------------/
14 import org.exolab.castor.xml.Marshaller;
15 import org.exolab.castor.xml.Unmarshaller;
20 * @version $Revision$ $Date$
22 public class Annotation implements java.io.Serializable
25 // --------------------------/
26 // - Class/Member Variables -/
27 // --------------------------/
32 private boolean _graph;
35 * keeps track of state for field: _graph
37 private boolean _has_graph;
42 private int _graphType;
45 * keeps track of state for field: _graphType
47 private boolean _has_graphType;
52 private java.lang.String _sequenceRef;
57 private java.lang.String _groupRef;
62 private int _graphColour;
65 * keeps track of state for field: _graphColour
67 private boolean _has_graphColour;
72 private int _graphGroup;
75 * keeps track of state for field: _graphGroup
77 private boolean _has_graphGroup;
80 * height in pixels for the graph if this is a graph-type annotation.
82 private int _graphHeight;
85 * keeps track of state for field: _graphHeight
87 private boolean _has_graphHeight;
92 private java.lang.String _id;
97 private boolean _scoreOnly = false;
100 * keeps track of state for field: _scoreOnly
102 private boolean _has_scoreOnly;
107 private double _score;
110 * keeps track of state for field: _score
112 private boolean _has_score;
117 private boolean _visible;
120 * keeps track of state for field: _visible
122 private boolean _has_visible;
125 * Field _centreColLabels.
127 private boolean _centreColLabels;
130 * keeps track of state for field: _centreColLabels
132 private boolean _has_centreColLabels;
135 * Field _scaleColLabels.
137 private boolean _scaleColLabels;
140 * keeps track of state for field: _scaleColLabels
142 private boolean _has_scaleColLabels;
145 * Field _showAllColLabels.
147 private boolean _showAllColLabels;
150 * keeps track of state for field: _showAllColLabels
152 private boolean _has_showAllColLabels;
155 * is an autocalculated annotation row
157 private boolean _autoCalculated = false;
160 * keeps track of state for field: _autoCalculated
162 private boolean _has_autoCalculated;
165 * is to be shown below the alignment - introduced in Jalview 2.8 for
166 * visualizing T-COFFEE alignment scores
168 private boolean _belowAlignment = true;
171 * keeps track of state for field: _belowAlignment
173 private boolean _has_belowAlignment;
176 * Optional string identifier used to group sets of annotation produced by a
177 * particular calculation. Values are opaque strings but have semantic meaning
178 * to Jalview's renderer, data importer and calculation system.
180 private java.lang.String _calcId;
183 * Field _annotationElementList.
185 private java.util.Vector _annotationElementList;
190 private java.lang.String _label;
193 * Field _description.
195 private java.lang.String _description;
198 * Field _thresholdLine.
200 private jalview.schemabinding.version2.ThresholdLine _thresholdLine;
209 this._annotationElementList = new java.util.Vector();
219 * @param vAnnotationElement
220 * @throws java.lang.IndexOutOfBoundsException
221 * if the index given is outside the bounds of the collection
223 public void addAnnotationElement(
224 final jalview.schemabinding.version2.AnnotationElement vAnnotationElement)
225 throws java.lang.IndexOutOfBoundsException
227 this._annotationElementList.addElement(vAnnotationElement);
234 * @param vAnnotationElement
235 * @throws java.lang.IndexOutOfBoundsException
236 * if the index given is outside the bounds of the collection
238 public void addAnnotationElement(
240 final jalview.schemabinding.version2.AnnotationElement vAnnotationElement)
241 throws java.lang.IndexOutOfBoundsException
243 this._annotationElementList.add(index, vAnnotationElement);
248 public void deleteAutoCalculated()
250 this._has_autoCalculated = false;
255 public void deleteBelowAlignment()
257 this._has_belowAlignment = false;
262 public void deleteCentreColLabels()
264 this._has_centreColLabels = false;
269 public void deleteGraph()
271 this._has_graph = false;
276 public void deleteGraphColour()
278 this._has_graphColour = false;
283 public void deleteGraphGroup()
285 this._has_graphGroup = false;
290 public void deleteGraphHeight()
292 this._has_graphHeight = false;
297 public void deleteGraphType()
299 this._has_graphType = false;
304 public void deleteScaleColLabels()
306 this._has_scaleColLabels = false;
311 public void deleteScore()
313 this._has_score = false;
318 public void deleteScoreOnly()
320 this._has_scoreOnly = false;
325 public void deleteShowAllColLabels()
327 this._has_showAllColLabels = false;
332 public void deleteVisible()
334 this._has_visible = false;
338 * Method enumerateAnnotationElement.
340 * @return an Enumeration over all
341 * jalview.schemabinding.version2.AnnotationElement elements
343 public java.util.Enumeration enumerateAnnotationElement()
345 return this._annotationElementList.elements();
349 * Method getAnnotationElement.
352 * @throws java.lang.IndexOutOfBoundsException
353 * if the index given is outside the bounds of the collection
354 * @return the value of the jalview.schemabinding.version2.AnnotationElement
357 public jalview.schemabinding.version2.AnnotationElement getAnnotationElement(
358 final int index) throws java.lang.IndexOutOfBoundsException
360 // check bounds for index
361 if (index < 0 || index >= this._annotationElementList.size())
363 throw new IndexOutOfBoundsException(
364 "getAnnotationElement: Index value '" + index
365 + "' not in range [0.."
366 + (this._annotationElementList.size() - 1) + "]");
369 return (jalview.schemabinding.version2.AnnotationElement) _annotationElementList
374 * Method getAnnotationElement.Returns the contents of the collection in an
377 * Note: Just in case the collection contents are changing in another thread,
378 * we pass a 0-length Array of the correct type into the API call. This way we
379 * <i>know</i> that the Array returned is of exactly the correct length.
381 * @return this collection as an Array
383 public jalview.schemabinding.version2.AnnotationElement[] getAnnotationElement()
385 jalview.schemabinding.version2.AnnotationElement[] array = new jalview.schemabinding.version2.AnnotationElement[0];
386 return (jalview.schemabinding.version2.AnnotationElement[]) this._annotationElementList
391 * Method getAnnotationElementCount.
393 * @return the size of this collection
395 public int getAnnotationElementCount()
397 return this._annotationElementList.size();
401 * Returns the value of field 'autoCalculated'. The field 'autoCalculated' has
402 * the following description: is an autocalculated annotation row
404 * @return the value of field 'AutoCalculated'.
406 public boolean getAutoCalculated()
408 return this._autoCalculated;
412 * Returns the value of field 'belowAlignment'. The field 'belowAlignment' has
413 * the following description: is to be shown below the alignment - introduced
414 * in Jalview 2.8 for visualizing T-COFFEE alignment scores
416 * @return the value of field 'BelowAlignment'.
418 public boolean getBelowAlignment()
420 return this._belowAlignment;
424 * Returns the value of field 'calcId'. The field 'calcId' has the following
425 * description: Optional string identifier used to group sets of annotation
426 * produced by a particular calculation. Values are opaque strings but have
427 * semantic meaning to Jalview's renderer, data importer and calculation
430 * @return the value of field 'CalcId'.
432 public java.lang.String getCalcId()
438 * Returns the value of field 'centreColLabels'.
440 * @return the value of field 'CentreColLabels'.
442 public boolean getCentreColLabels()
444 return this._centreColLabels;
448 * Returns the value of field 'description'.
450 * @return the value of field 'Description'.
452 public java.lang.String getDescription()
454 return this._description;
458 * Returns the value of field 'graph'.
460 * @return the value of field 'Graph'.
462 public boolean getGraph()
468 * Returns the value of field 'graphColour'.
470 * @return the value of field 'GraphColour'.
472 public int getGraphColour()
474 return this._graphColour;
478 * Returns the value of field 'graphGroup'.
480 * @return the value of field 'GraphGroup'.
482 public int getGraphGroup()
484 return this._graphGroup;
488 * Returns the value of field 'graphHeight'. The field 'graphHeight' has the
489 * following description: height in pixels for the graph if this is a
490 * graph-type annotation.
492 * @return the value of field 'GraphHeight'.
494 public int getGraphHeight()
496 return this._graphHeight;
500 * Returns the value of field 'graphType'.
502 * @return the value of field 'GraphType'.
504 public int getGraphType()
506 return this._graphType;
510 * Returns the value of field 'groupRef'.
512 * @return the value of field 'GroupRef'.
514 public java.lang.String getGroupRef()
516 return this._groupRef;
520 * Returns the value of field 'id'.
522 * @return the value of field 'Id'.
524 public java.lang.String getId()
530 * Returns the value of field 'label'.
532 * @return the value of field 'Label'.
534 public java.lang.String getLabel()
540 * Returns the value of field 'scaleColLabels'.
542 * @return the value of field 'ScaleColLabels'.
544 public boolean getScaleColLabels()
546 return this._scaleColLabels;
550 * Returns the value of field 'score'.
552 * @return the value of field 'Score'.
554 public double getScore()
560 * Returns the value of field 'scoreOnly'.
562 * @return the value of field 'ScoreOnly'.
564 public boolean getScoreOnly()
566 return this._scoreOnly;
570 * Returns the value of field 'sequenceRef'.
572 * @return the value of field 'SequenceRef'.
574 public java.lang.String getSequenceRef()
576 return this._sequenceRef;
580 * Returns the value of field 'showAllColLabels'.
582 * @return the value of field 'ShowAllColLabels'.
584 public boolean getShowAllColLabels()
586 return this._showAllColLabels;
590 * Returns the value of field 'thresholdLine'.
592 * @return the value of field 'ThresholdLine'.
594 public jalview.schemabinding.version2.ThresholdLine getThresholdLine()
596 return this._thresholdLine;
600 * Returns the value of field 'visible'.
602 * @return the value of field 'Visible'.
604 public boolean getVisible()
606 return this._visible;
610 * Method hasAutoCalculated.
612 * @return true if at least one AutoCalculated has been added
614 public boolean hasAutoCalculated()
616 return this._has_autoCalculated;
620 * Method hasBelowAlignment.
622 * @return true if at least one BelowAlignment has been added
624 public boolean hasBelowAlignment()
626 return this._has_belowAlignment;
630 * Method hasCentreColLabels.
632 * @return true if at least one CentreColLabels has been added
634 public boolean hasCentreColLabels()
636 return this._has_centreColLabels;
642 * @return true if at least one Graph has been added
644 public boolean hasGraph()
646 return this._has_graph;
650 * Method hasGraphColour.
652 * @return true if at least one GraphColour has been added
654 public boolean hasGraphColour()
656 return this._has_graphColour;
660 * Method hasGraphGroup.
662 * @return true if at least one GraphGroup has been added
664 public boolean hasGraphGroup()
666 return this._has_graphGroup;
670 * Method hasGraphHeight.
672 * @return true if at least one GraphHeight has been added
674 public boolean hasGraphHeight()
676 return this._has_graphHeight;
680 * Method hasGraphType.
682 * @return true if at least one GraphType has been added
684 public boolean hasGraphType()
686 return this._has_graphType;
690 * Method hasScaleColLabels.
692 * @return true if at least one ScaleColLabels has been added
694 public boolean hasScaleColLabels()
696 return this._has_scaleColLabels;
702 * @return true if at least one Score has been added
704 public boolean hasScore()
706 return this._has_score;
710 * Method hasScoreOnly.
712 * @return true if at least one ScoreOnly has been added
714 public boolean hasScoreOnly()
716 return this._has_scoreOnly;
720 * Method hasShowAllColLabels.
722 * @return true if at least one ShowAllColLabels has been added
724 public boolean hasShowAllColLabels()
726 return this._has_showAllColLabels;
732 * @return true if at least one Visible has been added
734 public boolean hasVisible()
736 return this._has_visible;
740 * Returns the value of field 'autoCalculated'. The field 'autoCalculated' has
741 * the following description: is an autocalculated annotation row
743 * @return the value of field 'AutoCalculated'.
745 public boolean isAutoCalculated()
747 return this._autoCalculated;
751 * Returns the value of field 'belowAlignment'. The field 'belowAlignment' has
752 * the following description: is to be shown below the alignment - introduced
753 * in Jalview 2.8 for visualizing T-COFFEE alignment scores
755 * @return the value of field 'BelowAlignment'.
757 public boolean isBelowAlignment()
759 return this._belowAlignment;
763 * Returns the value of field 'centreColLabels'.
765 * @return the value of field 'CentreColLabels'.
767 public boolean isCentreColLabels()
769 return this._centreColLabels;
773 * Returns the value of field 'graph'.
775 * @return the value of field 'Graph'.
777 public boolean isGraph()
783 * Returns the value of field 'scaleColLabels'.
785 * @return the value of field 'ScaleColLabels'.
787 public boolean isScaleColLabels()
789 return this._scaleColLabels;
793 * Returns the value of field 'scoreOnly'.
795 * @return the value of field 'ScoreOnly'.
797 public boolean isScoreOnly()
799 return this._scoreOnly;
803 * Returns the value of field 'showAllColLabels'.
805 * @return the value of field 'ShowAllColLabels'.
807 public boolean isShowAllColLabels()
809 return this._showAllColLabels;
815 * @return true if this object is valid according to the schema
817 public boolean isValid()
822 } catch (org.exolab.castor.xml.ValidationException vex)
830 * Returns the value of field 'visible'.
832 * @return the value of field 'Visible'.
834 public boolean isVisible()
836 return this._visible;
843 * @throws org.exolab.castor.xml.MarshalException
844 * if object is null or if any SAXException is thrown during
846 * @throws org.exolab.castor.xml.ValidationException
847 * if this object is an invalid instance according to the schema
849 public void marshal(final java.io.Writer out)
850 throws org.exolab.castor.xml.MarshalException,
851 org.exolab.castor.xml.ValidationException
853 Marshaller.marshal(this, out);
860 * @throws java.io.IOException
861 * if an IOException occurs during marshaling
862 * @throws org.exolab.castor.xml.ValidationException
863 * if this object is an invalid instance according to the schema
864 * @throws org.exolab.castor.xml.MarshalException
865 * if object is null or if any SAXException is thrown during
868 public void marshal(final org.xml.sax.ContentHandler handler)
869 throws java.io.IOException,
870 org.exolab.castor.xml.MarshalException,
871 org.exolab.castor.xml.ValidationException
873 Marshaller.marshal(this, handler);
878 public void removeAllAnnotationElement()
880 this._annotationElementList.clear();
884 * Method removeAnnotationElement.
886 * @param vAnnotationElement
887 * @return true if the object was removed from the collection.
889 public boolean removeAnnotationElement(
890 final jalview.schemabinding.version2.AnnotationElement vAnnotationElement)
892 boolean removed = _annotationElementList.remove(vAnnotationElement);
897 * Method removeAnnotationElementAt.
900 * @return the element removed from the collection
902 public jalview.schemabinding.version2.AnnotationElement removeAnnotationElementAt(
905 java.lang.Object obj = this._annotationElementList.remove(index);
906 return (jalview.schemabinding.version2.AnnotationElement) obj;
913 * @param vAnnotationElement
914 * @throws java.lang.IndexOutOfBoundsException
915 * if the index given is outside the bounds of the collection
917 public void setAnnotationElement(
919 final jalview.schemabinding.version2.AnnotationElement vAnnotationElement)
920 throws java.lang.IndexOutOfBoundsException
922 // check bounds for index
923 if (index < 0 || index >= this._annotationElementList.size())
925 throw new IndexOutOfBoundsException(
926 "setAnnotationElement: Index value '" + index
927 + "' not in range [0.."
928 + (this._annotationElementList.size() - 1) + "]");
931 this._annotationElementList.set(index, vAnnotationElement);
937 * @param vAnnotationElementArray
939 public void setAnnotationElement(
940 final jalview.schemabinding.version2.AnnotationElement[] vAnnotationElementArray)
943 _annotationElementList.clear();
945 for (int i = 0; i < vAnnotationElementArray.length; i++)
947 this._annotationElementList.add(vAnnotationElementArray[i]);
952 * Sets the value of field 'autoCalculated'. The field 'autoCalculated' has
953 * the following description: is an autocalculated annotation row
955 * @param autoCalculated
956 * the value of field 'autoCalculated'.
958 public void setAutoCalculated(final boolean autoCalculated)
960 this._autoCalculated = autoCalculated;
961 this._has_autoCalculated = true;
965 * Sets the value of field 'belowAlignment'. The field 'belowAlignment' has
966 * the following description: is to be shown below the alignment - introduced
967 * in Jalview 2.8 for visualizing T-COFFEE alignment scores
969 * @param belowAlignment
970 * the value of field 'belowAlignment'.
972 public void setBelowAlignment(final boolean belowAlignment)
974 this._belowAlignment = belowAlignment;
975 this._has_belowAlignment = true;
979 * Sets the value of field 'calcId'. The field 'calcId' has the following
980 * description: Optional string identifier used to group sets of annotation
981 * produced by a particular calculation. Values are opaque strings but have
982 * semantic meaning to Jalview's renderer, data importer and calculation
986 * the value of field 'calcId'.
988 public void setCalcId(final java.lang.String calcId)
990 this._calcId = calcId;
994 * Sets the value of field 'centreColLabels'.
996 * @param centreColLabels
997 * the value of field 'centreColLabels'.
999 public void setCentreColLabels(final boolean centreColLabels)
1001 this._centreColLabels = centreColLabels;
1002 this._has_centreColLabels = true;
1006 * Sets the value of field 'description'.
1008 * @param description
1009 * the value of field 'description'.
1011 public void setDescription(final java.lang.String description)
1013 this._description = description;
1017 * Sets the value of field 'graph'.
1020 * the value of field 'graph'.
1022 public void setGraph(final boolean graph)
1024 this._graph = graph;
1025 this._has_graph = true;
1029 * Sets the value of field 'graphColour'.
1031 * @param graphColour
1032 * the value of field 'graphColour'.
1034 public void setGraphColour(final int graphColour)
1036 this._graphColour = graphColour;
1037 this._has_graphColour = true;
1041 * Sets the value of field 'graphGroup'.
1044 * the value of field 'graphGroup'.
1046 public void setGraphGroup(final int graphGroup)
1048 this._graphGroup = graphGroup;
1049 this._has_graphGroup = true;
1053 * Sets the value of field 'graphHeight'. The field 'graphHeight' has the
1054 * following description: height in pixels for the graph if this is a
1055 * graph-type annotation.
1057 * @param graphHeight
1058 * the value of field 'graphHeight'.
1060 public void setGraphHeight(final int graphHeight)
1062 this._graphHeight = graphHeight;
1063 this._has_graphHeight = true;
1067 * Sets the value of field 'graphType'.
1070 * the value of field 'graphType'.
1072 public void setGraphType(final int graphType)
1074 this._graphType = graphType;
1075 this._has_graphType = true;
1079 * Sets the value of field 'groupRef'.
1082 * the value of field 'groupRef'.
1084 public void setGroupRef(final java.lang.String groupRef)
1086 this._groupRef = groupRef;
1090 * Sets the value of field 'id'.
1093 * the value of field 'id'.
1095 public void setId(final java.lang.String id)
1101 * Sets the value of field 'label'.
1104 * the value of field 'label'.
1106 public void setLabel(final java.lang.String label)
1108 this._label = label;
1112 * Sets the value of field 'scaleColLabels'.
1114 * @param scaleColLabels
1115 * the value of field 'scaleColLabels'.
1117 public void setScaleColLabels(final boolean scaleColLabels)
1119 this._scaleColLabels = scaleColLabels;
1120 this._has_scaleColLabels = true;
1124 * Sets the value of field 'score'.
1127 * the value of field 'score'.
1129 public void setScore(final double score)
1131 this._score = score;
1132 this._has_score = true;
1136 * Sets the value of field 'scoreOnly'.
1139 * the value of field 'scoreOnly'.
1141 public void setScoreOnly(final boolean scoreOnly)
1143 this._scoreOnly = scoreOnly;
1144 this._has_scoreOnly = true;
1148 * Sets the value of field 'sequenceRef'.
1150 * @param sequenceRef
1151 * the value of field 'sequenceRef'.
1153 public void setSequenceRef(final java.lang.String sequenceRef)
1155 this._sequenceRef = sequenceRef;
1159 * Sets the value of field 'showAllColLabels'.
1161 * @param showAllColLabels
1162 * the value of field 'showAllColLabels'
1164 public void setShowAllColLabels(final boolean showAllColLabels)
1166 this._showAllColLabels = showAllColLabels;
1167 this._has_showAllColLabels = true;
1171 * Sets the value of field 'thresholdLine'.
1173 * @param thresholdLine
1174 * the value of field 'thresholdLine'.
1176 public void setThresholdLine(
1177 final jalview.schemabinding.version2.ThresholdLine thresholdLine)
1179 this._thresholdLine = thresholdLine;
1183 * Sets the value of field 'visible'.
1186 * the value of field 'visible'.
1188 public void setVisible(final boolean visible)
1190 this._visible = visible;
1191 this._has_visible = true;
1198 * @throws org.exolab.castor.xml.MarshalException
1199 * if object is null or if any SAXException is thrown during
1201 * @throws org.exolab.castor.xml.ValidationException
1202 * if this object is an invalid instance according to the schema
1203 * @return the unmarshaled jalview.schemabinding.version2.Annotation
1205 public static jalview.schemabinding.version2.Annotation unmarshal(
1206 final java.io.Reader reader)
1207 throws org.exolab.castor.xml.MarshalException,
1208 org.exolab.castor.xml.ValidationException
1210 return (jalview.schemabinding.version2.Annotation) Unmarshaller
1211 .unmarshal(jalview.schemabinding.version2.Annotation.class,
1218 * @throws org.exolab.castor.xml.ValidationException
1219 * if this object is an invalid instance according to the schema
1221 public void validate() throws org.exolab.castor.xml.ValidationException
1223 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
1224 validator.validate(this);