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
83 private int _graphHeight;
86 * keeps track of state for field: _graphHeight
88 private boolean _has_graphHeight;
93 private java.lang.String _id;
98 private boolean _scoreOnly = false;
101 * keeps track of state for field: _scoreOnly
103 private boolean _has_scoreOnly;
108 private double _score;
111 * keeps track of state for field: _score
113 private boolean _has_score;
118 private boolean _visible;
121 * keeps track of state for field: _visible
123 private boolean _has_visible;
126 * Field _centreColLabels.
128 private boolean _centreColLabels;
131 * keeps track of state for field: _centreColLabels
133 private boolean _has_centreColLabels;
136 * Field _scaleColLabels.
138 private boolean _scaleColLabels;
141 * keeps track of state for field: _scaleColLabels
143 private boolean _has_scaleColLabels;
146 * Field _showAllColLabels.
148 private boolean _showAllColLabels;
151 * keeps track of state for field: _showAllColLabels
153 private boolean _has_showAllColLabels;
156 * is an autocalculated annotation row
158 private boolean _autoCalculated = false;
161 * keeps track of state for field: _autoCalculated
163 private boolean _has_autoCalculated;
166 * is to be shown below the alignment - introduced in Jalview
167 * 2.8 for visualizing T-COFFEE alignment scores
169 private boolean _belowAlignment = true;
172 * keeps track of state for field: _belowAlignment
174 private boolean _has_belowAlignment;
177 * Optional string identifier used to group sets of annotation
178 * produced by a particular calculation. Values are opaque
179 * strings but have semantic meaning to Jalview's renderer,
180 * data importer and calculation system.
182 private java.lang.String _calcId;
185 * Field _annotationElementList.
187 private java.util.Vector _annotationElementList;
192 private java.lang.String _label;
195 * Field _description.
197 private java.lang.String _description;
200 * Field _thresholdLine.
202 private jalview.schemabinding.version2.ThresholdLine _thresholdLine;
209 public Annotation() {
211 this._annotationElementList = new java.util.Vector();
222 * @param vAnnotationElement
223 * @throws java.lang.IndexOutOfBoundsException if the index
224 * given is outside the bounds of the collection
226 public void addAnnotationElement(
227 final jalview.schemabinding.version2.AnnotationElement vAnnotationElement)
228 throws java.lang.IndexOutOfBoundsException {
229 this._annotationElementList.addElement(vAnnotationElement);
236 * @param vAnnotationElement
237 * @throws java.lang.IndexOutOfBoundsException if the index
238 * given is outside the bounds of the collection
240 public void addAnnotationElement(
242 final jalview.schemabinding.version2.AnnotationElement vAnnotationElement)
243 throws java.lang.IndexOutOfBoundsException {
244 this._annotationElementList.add(index, vAnnotationElement);
249 public void deleteAutoCalculated(
251 this._has_autoCalculated= false;
256 public void deleteBelowAlignment(
258 this._has_belowAlignment= false;
263 public void deleteCentreColLabels(
265 this._has_centreColLabels= false;
270 public void deleteGraph(
272 this._has_graph= false;
277 public void deleteGraphColour(
279 this._has_graphColour= false;
284 public void deleteGraphGroup(
286 this._has_graphGroup= false;
291 public void deleteGraphHeight(
293 this._has_graphHeight= false;
298 public void deleteGraphType(
300 this._has_graphType= false;
305 public void deleteScaleColLabels(
307 this._has_scaleColLabels= false;
312 public void deleteScore(
314 this._has_score= false;
319 public void deleteScoreOnly(
321 this._has_scoreOnly= false;
326 public void deleteShowAllColLabels(
328 this._has_showAllColLabels= false;
333 public void deleteVisible(
335 this._has_visible= false;
339 * Method enumerateAnnotationElement.
341 * @return an Enumeration over all
342 * jalview.schemabinding.version2.AnnotationElement elements
344 public java.util.Enumeration enumerateAnnotationElement(
346 return this._annotationElementList.elements();
350 * Method getAnnotationElement.
353 * @throws java.lang.IndexOutOfBoundsException if the index
354 * given is outside the bounds of the collection
355 * @return the value of the
356 * jalview.schemabinding.version2.AnnotationElement at the
359 public jalview.schemabinding.version2.AnnotationElement getAnnotationElement(
361 throws java.lang.IndexOutOfBoundsException {
362 // check bounds for index
363 if (index < 0 || index >= this._annotationElementList.size()) {
364 throw new IndexOutOfBoundsException("getAnnotationElement: Index value '" + index + "' not in range [0.." + (this._annotationElementList.size() - 1) + "]");
367 return (jalview.schemabinding.version2.AnnotationElement) _annotationElementList.get(index);
371 * Method getAnnotationElement.Returns the contents of the
372 * collection in an Array. <p>Note: Just in case the
373 * collection contents are changing in another thread, we pass
374 * a 0-length Array of the correct type into the API call.
375 * This way we <i>know</i> that the Array returned is of
376 * exactly the correct length.
378 * @return this collection as an Array
380 public jalview.schemabinding.version2.AnnotationElement[] getAnnotationElement(
382 jalview.schemabinding.version2.AnnotationElement[] array = new jalview.schemabinding.version2.AnnotationElement[0];
383 return (jalview.schemabinding.version2.AnnotationElement[]) this._annotationElementList.toArray(array);
387 * Method getAnnotationElementCount.
389 * @return the size of this collection
391 public int getAnnotationElementCount(
393 return this._annotationElementList.size();
397 * Returns the value of field 'autoCalculated'. The field
398 * 'autoCalculated' has the following description: is an
399 * autocalculated annotation row
401 * @return the value of field 'AutoCalculated'.
403 public boolean getAutoCalculated(
405 return this._autoCalculated;
409 * Returns the value of field 'belowAlignment'. The field
410 * 'belowAlignment' has the following description: is to be
411 * shown below the alignment - introduced in Jalview 2.8 for
412 * visualizing T-COFFEE alignment scores
414 * @return the value of field 'BelowAlignment'.
416 public boolean getBelowAlignment(
418 return this._belowAlignment;
422 * Returns the value of field 'calcId'. The field 'calcId' has
423 * the following description: Optional string identifier used
424 * to group sets of annotation produced by a particular
425 * calculation. Values are opaque strings but have semantic
426 * meaning to Jalview's renderer, data importer and calculation
429 * @return the value of field 'CalcId'.
431 public java.lang.String getCalcId(
437 * Returns the value of field 'centreColLabels'.
439 * @return the value of field 'CentreColLabels'.
441 public boolean getCentreColLabels(
443 return this._centreColLabels;
447 * Returns the value of field 'description'.
449 * @return the value of field 'Description'.
451 public java.lang.String getDescription(
453 return this._description;
457 * Returns the value of field 'graph'.
459 * @return the value of field 'Graph'.
461 public boolean getGraph(
467 * Returns the value of field 'graphColour'.
469 * @return the value of field 'GraphColour'.
471 public int getGraphColour(
473 return this._graphColour;
477 * Returns the value of field 'graphGroup'.
479 * @return the value of field 'GraphGroup'.
481 public int getGraphGroup(
483 return this._graphGroup;
487 * Returns the value of field 'graphHeight'. The field
488 * 'graphHeight' has the following description: height in
489 * pixels for the graph if this is a graph-type annotation.
491 * @return the value of field 'GraphHeight'.
493 public int getGraphHeight(
495 return this._graphHeight;
499 * Returns the value of field 'graphType'.
501 * @return the value of field 'GraphType'.
503 public int getGraphType(
505 return this._graphType;
509 * Returns the value of field 'groupRef'.
511 * @return the value of field 'GroupRef'.
513 public java.lang.String getGroupRef(
515 return this._groupRef;
519 * Returns the value of field 'id'.
521 * @return the value of field 'Id'.
523 public java.lang.String getId(
529 * Returns the value of field 'label'.
531 * @return the value of field 'Label'.
533 public java.lang.String getLabel(
539 * Returns the value of field 'scaleColLabels'.
541 * @return the value of field 'ScaleColLabels'.
543 public boolean getScaleColLabels(
545 return this._scaleColLabels;
549 * Returns the value of field 'score'.
551 * @return the value of field 'Score'.
553 public double getScore(
559 * Returns the value of field 'scoreOnly'.
561 * @return the value of field 'ScoreOnly'.
563 public boolean getScoreOnly(
565 return this._scoreOnly;
569 * Returns the value of field 'sequenceRef'.
571 * @return the value of field 'SequenceRef'.
573 public java.lang.String getSequenceRef(
575 return this._sequenceRef;
579 * Returns the value of field 'showAllColLabels'.
581 * @return the value of field 'ShowAllColLabels'.
583 public boolean getShowAllColLabels(
585 return this._showAllColLabels;
589 * Returns the value of field 'thresholdLine'.
591 * @return the value of field 'ThresholdLine'.
593 public jalview.schemabinding.version2.ThresholdLine getThresholdLine(
595 return this._thresholdLine;
599 * Returns the value of field 'visible'.
601 * @return the value of field 'Visible'.
603 public boolean getVisible(
605 return this._visible;
609 * Method hasAutoCalculated.
611 * @return true if at least one AutoCalculated has been added
613 public boolean hasAutoCalculated(
615 return this._has_autoCalculated;
619 * Method hasBelowAlignment.
621 * @return true if at least one BelowAlignment has been added
623 public boolean hasBelowAlignment(
625 return this._has_belowAlignment;
629 * Method hasCentreColLabels.
631 * @return true if at least one CentreColLabels has been added
633 public boolean hasCentreColLabels(
635 return this._has_centreColLabels;
641 * @return true if at least one Graph has been added
643 public boolean hasGraph(
645 return this._has_graph;
649 * Method hasGraphColour.
651 * @return true if at least one GraphColour has been added
653 public boolean hasGraphColour(
655 return this._has_graphColour;
659 * Method hasGraphGroup.
661 * @return true if at least one GraphGroup has been added
663 public boolean hasGraphGroup(
665 return this._has_graphGroup;
669 * Method hasGraphHeight.
671 * @return true if at least one GraphHeight has been added
673 public boolean hasGraphHeight(
675 return this._has_graphHeight;
679 * Method hasGraphType.
681 * @return true if at least one GraphType has been added
683 public boolean hasGraphType(
685 return this._has_graphType;
689 * Method hasScaleColLabels.
691 * @return true if at least one ScaleColLabels has been added
693 public boolean hasScaleColLabels(
695 return this._has_scaleColLabels;
701 * @return true if at least one Score has been added
703 public boolean hasScore(
705 return this._has_score;
709 * Method hasScoreOnly.
711 * @return true if at least one ScoreOnly has been added
713 public boolean hasScoreOnly(
715 return this._has_scoreOnly;
719 * Method hasShowAllColLabels.
721 * @return true if at least one ShowAllColLabels has been added
723 public boolean hasShowAllColLabels(
725 return this._has_showAllColLabels;
731 * @return true if at least one Visible has been added
733 public boolean hasVisible(
735 return this._has_visible;
739 * Returns the value of field 'autoCalculated'. The field
740 * 'autoCalculated' has the following description: is an
741 * 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
752 * 'belowAlignment' has the following description: is to be
753 * shown below the alignment - introduced in Jalview 2.8 for
754 * visualizing T-COFFEE alignment scores
756 * @return the value of field 'BelowAlignment'.
758 public boolean isBelowAlignment(
760 return this._belowAlignment;
764 * Returns the value of field 'centreColLabels'.
766 * @return the value of field 'CentreColLabels'.
768 public boolean isCentreColLabels(
770 return this._centreColLabels;
774 * Returns the value of field 'graph'.
776 * @return the value of field 'Graph'.
778 public boolean isGraph(
784 * Returns the value of field 'scaleColLabels'.
786 * @return the value of field 'ScaleColLabels'.
788 public boolean isScaleColLabels(
790 return this._scaleColLabels;
794 * Returns the value of field 'scoreOnly'.
796 * @return the value of field 'ScoreOnly'.
798 public boolean isScoreOnly(
800 return this._scoreOnly;
804 * Returns the value of field 'showAllColLabels'.
806 * @return the value of field 'ShowAllColLabels'.
808 public boolean isShowAllColLabels(
810 return this._showAllColLabels;
816 * @return true if this object is valid according to the schema
818 public boolean isValid(
822 } catch (org.exolab.castor.xml.ValidationException vex) {
829 * Returns the value of field 'visible'.
831 * @return the value of field 'Visible'.
833 public boolean isVisible(
835 return this._visible;
842 * @throws org.exolab.castor.xml.MarshalException if object is
843 * null or if any SAXException is thrown during marshaling
844 * @throws org.exolab.castor.xml.ValidationException if this
845 * object is an invalid instance according to the schema
848 final java.io.Writer out)
849 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
850 Marshaller.marshal(this, out);
857 * @throws java.io.IOException if an IOException occurs during
859 * @throws org.exolab.castor.xml.ValidationException if this
860 * object is an invalid instance according to the schema
861 * @throws org.exolab.castor.xml.MarshalException if object is
862 * null or if any SAXException is thrown during marshaling
865 final org.xml.sax.ContentHandler handler)
866 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
867 Marshaller.marshal(this, handler);
872 public void removeAllAnnotationElement(
874 this._annotationElementList.clear();
878 * Method removeAnnotationElement.
880 * @param vAnnotationElement
881 * @return true if the object was removed from the collection.
883 public boolean removeAnnotationElement(
884 final jalview.schemabinding.version2.AnnotationElement vAnnotationElement) {
885 boolean removed = _annotationElementList.remove(vAnnotationElement);
890 * Method removeAnnotationElementAt.
893 * @return the element removed from the collection
895 public jalview.schemabinding.version2.AnnotationElement removeAnnotationElementAt(
897 java.lang.Object obj = this._annotationElementList.remove(index);
898 return (jalview.schemabinding.version2.AnnotationElement) obj;
905 * @param vAnnotationElement
906 * @throws java.lang.IndexOutOfBoundsException if the index
907 * given is outside the bounds of the collection
909 public void setAnnotationElement(
911 final jalview.schemabinding.version2.AnnotationElement vAnnotationElement)
912 throws java.lang.IndexOutOfBoundsException {
913 // check bounds for index
914 if (index < 0 || index >= this._annotationElementList.size()) {
915 throw new IndexOutOfBoundsException("setAnnotationElement: Index value '" + index + "' not in range [0.." + (this._annotationElementList.size() - 1) + "]");
918 this._annotationElementList.set(index, vAnnotationElement);
924 * @param vAnnotationElementArray
926 public void setAnnotationElement(
927 final jalview.schemabinding.version2.AnnotationElement[] vAnnotationElementArray) {
929 _annotationElementList.clear();
931 for (int i = 0; i < vAnnotationElementArray.length; i++) {
932 this._annotationElementList.add(vAnnotationElementArray[i]);
937 * Sets the value of field 'autoCalculated'. The field
938 * 'autoCalculated' has the following description: is an
939 * autocalculated annotation row
941 * @param autoCalculated the value of field 'autoCalculated'.
943 public void setAutoCalculated(
944 final boolean autoCalculated) {
945 this._autoCalculated = autoCalculated;
946 this._has_autoCalculated = true;
950 * Sets the value of field 'belowAlignment'. The field
951 * 'belowAlignment' has the following description: is to be
952 * shown below the alignment - introduced in Jalview 2.8 for
953 * visualizing T-COFFEE alignment scores
955 * @param belowAlignment the value of field 'belowAlignment'.
957 public void setBelowAlignment(
958 final boolean belowAlignment) {
959 this._belowAlignment = belowAlignment;
960 this._has_belowAlignment = true;
964 * Sets the value of field 'calcId'. The field 'calcId' has the
965 * following description: Optional string identifier used to
966 * group sets of annotation produced by a particular
967 * calculation. Values are opaque strings but have semantic
968 * meaning to Jalview's renderer, data importer and calculation
971 * @param calcId the value of field 'calcId'.
973 public void setCalcId(
974 final java.lang.String calcId) {
975 this._calcId = calcId;
979 * Sets the value of field 'centreColLabels'.
981 * @param centreColLabels the value of field 'centreColLabels'.
983 public void setCentreColLabels(
984 final boolean centreColLabels) {
985 this._centreColLabels = centreColLabels;
986 this._has_centreColLabels = true;
990 * Sets the value of field 'description'.
992 * @param description the value of field 'description'.
994 public void setDescription(
995 final java.lang.String description) {
996 this._description = description;
1000 * Sets the value of field 'graph'.
1002 * @param graph the value of field 'graph'.
1004 public void setGraph(
1005 final boolean graph) {
1006 this._graph = graph;
1007 this._has_graph = true;
1011 * Sets the value of field 'graphColour'.
1013 * @param graphColour the value of field 'graphColour'.
1015 public void setGraphColour(
1016 final int graphColour) {
1017 this._graphColour = graphColour;
1018 this._has_graphColour = true;
1022 * Sets the value of field 'graphGroup'.
1024 * @param graphGroup the value of field 'graphGroup'.
1026 public void setGraphGroup(
1027 final int graphGroup) {
1028 this._graphGroup = graphGroup;
1029 this._has_graphGroup = true;
1033 * Sets the value of field 'graphHeight'. The field
1034 * 'graphHeight' has the following description: height in
1035 * pixels for the graph if this is a graph-type annotation.
1037 * @param graphHeight the value of field 'graphHeight'.
1039 public void setGraphHeight(
1040 final int graphHeight) {
1041 this._graphHeight = graphHeight;
1042 this._has_graphHeight = true;
1046 * Sets the value of field 'graphType'.
1048 * @param graphType the value of field 'graphType'.
1050 public void setGraphType(
1051 final int graphType) {
1052 this._graphType = graphType;
1053 this._has_graphType = true;
1057 * Sets the value of field 'groupRef'.
1059 * @param groupRef the value of field 'groupRef'.
1061 public void setGroupRef(
1062 final java.lang.String groupRef) {
1063 this._groupRef = groupRef;
1067 * Sets the value of field 'id'.
1069 * @param id the value of field 'id'.
1072 final java.lang.String id) {
1077 * Sets the value of field 'label'.
1079 * @param label the value of field 'label'.
1081 public void setLabel(
1082 final java.lang.String label) {
1083 this._label = label;
1087 * Sets the value of field 'scaleColLabels'.
1089 * @param scaleColLabels the value of field 'scaleColLabels'.
1091 public void setScaleColLabels(
1092 final boolean scaleColLabels) {
1093 this._scaleColLabels = scaleColLabels;
1094 this._has_scaleColLabels = true;
1098 * Sets the value of field 'score'.
1100 * @param score the value of field 'score'.
1102 public void setScore(
1103 final double score) {
1104 this._score = score;
1105 this._has_score = true;
1109 * Sets the value of field 'scoreOnly'.
1111 * @param scoreOnly the value of field 'scoreOnly'.
1113 public void setScoreOnly(
1114 final boolean scoreOnly) {
1115 this._scoreOnly = scoreOnly;
1116 this._has_scoreOnly = true;
1120 * Sets the value of field 'sequenceRef'.
1122 * @param sequenceRef the value of field 'sequenceRef'.
1124 public void setSequenceRef(
1125 final java.lang.String sequenceRef) {
1126 this._sequenceRef = sequenceRef;
1130 * Sets the value of field 'showAllColLabels'.
1132 * @param showAllColLabels the value of field 'showAllColLabels'
1134 public void setShowAllColLabels(
1135 final boolean showAllColLabels) {
1136 this._showAllColLabels = showAllColLabels;
1137 this._has_showAllColLabels = true;
1141 * Sets the value of field 'thresholdLine'.
1143 * @param thresholdLine the value of field 'thresholdLine'.
1145 public void setThresholdLine(
1146 final jalview.schemabinding.version2.ThresholdLine thresholdLine) {
1147 this._thresholdLine = thresholdLine;
1151 * Sets the value of field 'visible'.
1153 * @param visible the value of field 'visible'.
1155 public void setVisible(
1156 final boolean visible) {
1157 this._visible = visible;
1158 this._has_visible = true;
1165 * @throws org.exolab.castor.xml.MarshalException if object is
1166 * null or if any SAXException is thrown during marshaling
1167 * @throws org.exolab.castor.xml.ValidationException if this
1168 * object is an invalid instance according to the schema
1169 * @return the unmarshaled
1170 * jalview.schemabinding.version2.Annotation
1172 public static jalview.schemabinding.version2.Annotation unmarshal(
1173 final java.io.Reader reader)
1174 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
1175 return (jalview.schemabinding.version2.Annotation) Unmarshaller.unmarshal(jalview.schemabinding.version2.Annotation.class, reader);
1181 * @throws org.exolab.castor.xml.ValidationException if this
1182 * object is an invalid instance according to the schema
1184 public void validate(
1186 throws org.exolab.castor.xml.ValidationException {
1187 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
1188 validator.validate(this);