1 /*******************************************************************************
2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
3 * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
5 * This file is part of Jalview.
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.
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.
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 *******************************************************************************/
19 * This class was automatically generated with
20 * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
25 package jalview.schemabinding.version2;
27 //---------------------------------/
28 //- Imported classes and packages -/
29 //---------------------------------/
31 import org.exolab.castor.xml.Marshaller;
32 import org.exolab.castor.xml.Unmarshaller;
37 * @version $Revision$ $Date$
39 public class Annotation implements java.io.Serializable {
42 //--------------------------/
43 //- Class/Member Variables -/
44 //--------------------------/
49 private boolean _graph;
52 * keeps track of state for field: _graph
54 private boolean _has_graph;
59 private int _graphType;
62 * keeps track of state for field: _graphType
64 private boolean _has_graphType;
69 private java.lang.String _sequenceRef;
74 private java.lang.String _groupRef;
79 private int _graphColour;
82 * keeps track of state for field: _graphColour
84 private boolean _has_graphColour;
89 private int _graphGroup;
92 * keeps track of state for field: _graphGroup
94 private boolean _has_graphGroup;
97 * height in pixels for the graph if this is a graph-type
100 private int _graphHeight;
103 * keeps track of state for field: _graphHeight
105 private boolean _has_graphHeight;
110 private java.lang.String _id;
115 private boolean _scoreOnly = false;
118 * keeps track of state for field: _scoreOnly
120 private boolean _has_scoreOnly;
125 private double _score;
128 * keeps track of state for field: _score
130 private boolean _has_score;
135 private boolean _visible;
138 * keeps track of state for field: _visible
140 private boolean _has_visible;
143 * Field _centreColLabels.
145 private boolean _centreColLabels;
148 * keeps track of state for field: _centreColLabels
150 private boolean _has_centreColLabels;
153 * Field _scaleColLabels.
155 private boolean _scaleColLabels;
158 * keeps track of state for field: _scaleColLabels
160 private boolean _has_scaleColLabels;
163 * Field _showAllColLabels.
165 private boolean _showAllColLabels;
168 * keeps track of state for field: _showAllColLabels
170 private boolean _has_showAllColLabels;
173 * is an autocalculated annotation row
175 private boolean _autoCalculated = false;
178 * keeps track of state for field: _autoCalculated
180 private boolean _has_autoCalculated;
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;
207 public Annotation() {
209 this._annotationElementList = new java.util.Vector();
220 * @param vAnnotationElement
221 * @throws java.lang.IndexOutOfBoundsException if the index
222 * given is outside the bounds of the collection
224 public void addAnnotationElement(
225 final jalview.schemabinding.version2.AnnotationElement vAnnotationElement)
226 throws java.lang.IndexOutOfBoundsException {
227 this._annotationElementList.addElement(vAnnotationElement);
234 * @param vAnnotationElement
235 * @throws java.lang.IndexOutOfBoundsException if the index
236 * given is outside the bounds of the collection
238 public void addAnnotationElement(
240 final jalview.schemabinding.version2.AnnotationElement vAnnotationElement)
241 throws java.lang.IndexOutOfBoundsException {
242 this._annotationElementList.add(index, vAnnotationElement);
247 public void deleteAutoCalculated(
249 this._has_autoCalculated= false;
254 public void deleteCentreColLabels(
256 this._has_centreColLabels= false;
261 public void deleteGraph(
263 this._has_graph= false;
268 public void deleteGraphColour(
270 this._has_graphColour= false;
275 public void deleteGraphGroup(
277 this._has_graphGroup= false;
282 public void deleteGraphHeight(
284 this._has_graphHeight= false;
289 public void deleteGraphType(
291 this._has_graphType= false;
296 public void deleteScaleColLabels(
298 this._has_scaleColLabels= false;
303 public void deleteScore(
305 this._has_score= false;
310 public void deleteScoreOnly(
312 this._has_scoreOnly= false;
317 public void deleteShowAllColLabels(
319 this._has_showAllColLabels= false;
324 public void deleteVisible(
326 this._has_visible= false;
330 * Method enumerateAnnotationElement.
332 * @return an Enumeration over all
333 * jalview.schemabinding.version2.AnnotationElement elements
335 public java.util.Enumeration enumerateAnnotationElement(
337 return this._annotationElementList.elements();
341 * Method getAnnotationElement.
344 * @throws java.lang.IndexOutOfBoundsException if the index
345 * given is outside the bounds of the collection
346 * @return the value of the
347 * jalview.schemabinding.version2.AnnotationElement at the
350 public jalview.schemabinding.version2.AnnotationElement getAnnotationElement(
352 throws java.lang.IndexOutOfBoundsException {
353 // check bounds for index
354 if (index < 0 || index >= this._annotationElementList.size()) {
355 throw new IndexOutOfBoundsException("getAnnotationElement: Index value '" + index + "' not in range [0.." + (this._annotationElementList.size() - 1) + "]");
358 return (jalview.schemabinding.version2.AnnotationElement) _annotationElementList.get(index);
362 * Method getAnnotationElement.Returns the contents of the
363 * collection in an Array. <p>Note: Just in case the
364 * collection contents are changing in another thread, we pass
365 * a 0-length Array of the correct type into the API call.
366 * This way we <i>know</i> that the Array returned is of
367 * exactly the correct length.
369 * @return this collection as an Array
371 public jalview.schemabinding.version2.AnnotationElement[] getAnnotationElement(
373 jalview.schemabinding.version2.AnnotationElement[] array = new jalview.schemabinding.version2.AnnotationElement[0];
374 return (jalview.schemabinding.version2.AnnotationElement[]) this._annotationElementList.toArray(array);
378 * Method getAnnotationElementCount.
380 * @return the size of this collection
382 public int getAnnotationElementCount(
384 return this._annotationElementList.size();
388 * Returns the value of field 'autoCalculated'. The field
389 * 'autoCalculated' has the following description: is an
390 * autocalculated annotation row
392 * @return the value of field 'AutoCalculated'.
394 public boolean getAutoCalculated(
396 return this._autoCalculated;
400 * Returns the value of field 'centreColLabels'.
402 * @return the value of field 'CentreColLabels'.
404 public boolean getCentreColLabels(
406 return this._centreColLabels;
410 * Returns the value of field 'description'.
412 * @return the value of field 'Description'.
414 public java.lang.String getDescription(
416 return this._description;
420 * Returns the value of field 'graph'.
422 * @return the value of field 'Graph'.
424 public boolean getGraph(
430 * Returns the value of field 'graphColour'.
432 * @return the value of field 'GraphColour'.
434 public int getGraphColour(
436 return this._graphColour;
440 * Returns the value of field 'graphGroup'.
442 * @return the value of field 'GraphGroup'.
444 public int getGraphGroup(
446 return this._graphGroup;
450 * Returns the value of field 'graphHeight'. The field
451 * 'graphHeight' has the following description: height in
452 * pixels for the graph if this is a graph-type annotation.
454 * @return the value of field 'GraphHeight'.
456 public int getGraphHeight(
458 return this._graphHeight;
462 * Returns the value of field 'graphType'.
464 * @return the value of field 'GraphType'.
466 public int getGraphType(
468 return this._graphType;
472 * Returns the value of field 'groupRef'.
474 * @return the value of field 'GroupRef'.
476 public java.lang.String getGroupRef(
478 return this._groupRef;
482 * Returns the value of field 'id'.
484 * @return the value of field 'Id'.
486 public java.lang.String getId(
492 * Returns the value of field 'label'.
494 * @return the value of field 'Label'.
496 public java.lang.String getLabel(
502 * Returns the value of field 'scaleColLabels'.
504 * @return the value of field 'ScaleColLabels'.
506 public boolean getScaleColLabels(
508 return this._scaleColLabels;
512 * Returns the value of field 'score'.
514 * @return the value of field 'Score'.
516 public double getScore(
522 * Returns the value of field 'scoreOnly'.
524 * @return the value of field 'ScoreOnly'.
526 public boolean getScoreOnly(
528 return this._scoreOnly;
532 * Returns the value of field 'sequenceRef'.
534 * @return the value of field 'SequenceRef'.
536 public java.lang.String getSequenceRef(
538 return this._sequenceRef;
542 * Returns the value of field 'showAllColLabels'.
544 * @return the value of field 'ShowAllColLabels'.
546 public boolean getShowAllColLabels(
548 return this._showAllColLabels;
552 * Returns the value of field 'thresholdLine'.
554 * @return the value of field 'ThresholdLine'.
556 public jalview.schemabinding.version2.ThresholdLine getThresholdLine(
558 return this._thresholdLine;
562 * Returns the value of field 'visible'.
564 * @return the value of field 'Visible'.
566 public boolean getVisible(
568 return this._visible;
572 * Method hasAutoCalculated.
574 * @return true if at least one AutoCalculated has been added
576 public boolean hasAutoCalculated(
578 return this._has_autoCalculated;
582 * Method hasCentreColLabels.
584 * @return true if at least one CentreColLabels has been added
586 public boolean hasCentreColLabels(
588 return this._has_centreColLabels;
594 * @return true if at least one Graph has been added
596 public boolean hasGraph(
598 return this._has_graph;
602 * Method hasGraphColour.
604 * @return true if at least one GraphColour has been added
606 public boolean hasGraphColour(
608 return this._has_graphColour;
612 * Method hasGraphGroup.
614 * @return true if at least one GraphGroup has been added
616 public boolean hasGraphGroup(
618 return this._has_graphGroup;
622 * Method hasGraphHeight.
624 * @return true if at least one GraphHeight has been added
626 public boolean hasGraphHeight(
628 return this._has_graphHeight;
632 * Method hasGraphType.
634 * @return true if at least one GraphType has been added
636 public boolean hasGraphType(
638 return this._has_graphType;
642 * Method hasScaleColLabels.
644 * @return true if at least one ScaleColLabels has been added
646 public boolean hasScaleColLabels(
648 return this._has_scaleColLabels;
654 * @return true if at least one Score has been added
656 public boolean hasScore(
658 return this._has_score;
662 * Method hasScoreOnly.
664 * @return true if at least one ScoreOnly has been added
666 public boolean hasScoreOnly(
668 return this._has_scoreOnly;
672 * Method hasShowAllColLabels.
674 * @return true if at least one ShowAllColLabels has been added
676 public boolean hasShowAllColLabels(
678 return this._has_showAllColLabels;
684 * @return true if at least one Visible has been added
686 public boolean hasVisible(
688 return this._has_visible;
692 * Returns the value of field 'autoCalculated'. The field
693 * 'autoCalculated' has the following description: is an
694 * autocalculated annotation row
696 * @return the value of field 'AutoCalculated'.
698 public boolean isAutoCalculated(
700 return this._autoCalculated;
704 * Returns the value of field 'centreColLabels'.
706 * @return the value of field 'CentreColLabels'.
708 public boolean isCentreColLabels(
710 return this._centreColLabels;
714 * Returns the value of field 'graph'.
716 * @return the value of field 'Graph'.
718 public boolean isGraph(
724 * Returns the value of field 'scaleColLabels'.
726 * @return the value of field 'ScaleColLabels'.
728 public boolean isScaleColLabels(
730 return this._scaleColLabels;
734 * Returns the value of field 'scoreOnly'.
736 * @return the value of field 'ScoreOnly'.
738 public boolean isScoreOnly(
740 return this._scoreOnly;
744 * Returns the value of field 'showAllColLabels'.
746 * @return the value of field 'ShowAllColLabels'.
748 public boolean isShowAllColLabels(
750 return this._showAllColLabels;
756 * @return true if this object is valid according to the schema
758 public boolean isValid(
762 } catch (org.exolab.castor.xml.ValidationException vex) {
769 * Returns the value of field 'visible'.
771 * @return the value of field 'Visible'.
773 public boolean isVisible(
775 return this._visible;
782 * @throws org.exolab.castor.xml.MarshalException if object is
783 * null or if any SAXException is thrown during marshaling
784 * @throws org.exolab.castor.xml.ValidationException if this
785 * object is an invalid instance according to the schema
788 final java.io.Writer out)
789 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
790 Marshaller.marshal(this, out);
797 * @throws java.io.IOException if an IOException occurs during
799 * @throws org.exolab.castor.xml.ValidationException if this
800 * object is an invalid instance according to the schema
801 * @throws org.exolab.castor.xml.MarshalException if object is
802 * null or if any SAXException is thrown during marshaling
805 final org.xml.sax.ContentHandler handler)
806 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
807 Marshaller.marshal(this, handler);
812 public void removeAllAnnotationElement(
814 this._annotationElementList.clear();
818 * Method removeAnnotationElement.
820 * @param vAnnotationElement
821 * @return true if the object was removed from the collection.
823 public boolean removeAnnotationElement(
824 final jalview.schemabinding.version2.AnnotationElement vAnnotationElement) {
825 boolean removed = _annotationElementList.remove(vAnnotationElement);
830 * Method removeAnnotationElementAt.
833 * @return the element removed from the collection
835 public jalview.schemabinding.version2.AnnotationElement removeAnnotationElementAt(
837 java.lang.Object obj = this._annotationElementList.remove(index);
838 return (jalview.schemabinding.version2.AnnotationElement) obj;
845 * @param vAnnotationElement
846 * @throws java.lang.IndexOutOfBoundsException if the index
847 * given is outside the bounds of the collection
849 public void setAnnotationElement(
851 final jalview.schemabinding.version2.AnnotationElement vAnnotationElement)
852 throws java.lang.IndexOutOfBoundsException {
853 // check bounds for index
854 if (index < 0 || index >= this._annotationElementList.size()) {
855 throw new IndexOutOfBoundsException("setAnnotationElement: Index value '" + index + "' not in range [0.." + (this._annotationElementList.size() - 1) + "]");
858 this._annotationElementList.set(index, vAnnotationElement);
864 * @param vAnnotationElementArray
866 public void setAnnotationElement(
867 final jalview.schemabinding.version2.AnnotationElement[] vAnnotationElementArray) {
869 _annotationElementList.clear();
871 for (int i = 0; i < vAnnotationElementArray.length; i++) {
872 this._annotationElementList.add(vAnnotationElementArray[i]);
877 * Sets the value of field 'autoCalculated'. The field
878 * 'autoCalculated' has the following description: is an
879 * autocalculated annotation row
881 * @param autoCalculated the value of field 'autoCalculated'.
883 public void setAutoCalculated(
884 final boolean autoCalculated) {
885 this._autoCalculated = autoCalculated;
886 this._has_autoCalculated = true;
890 * Sets the value of field 'centreColLabels'.
892 * @param centreColLabels the value of field 'centreColLabels'.
894 public void setCentreColLabels(
895 final boolean centreColLabels) {
896 this._centreColLabels = centreColLabels;
897 this._has_centreColLabels = true;
901 * Sets the value of field 'description'.
903 * @param description the value of field 'description'.
905 public void setDescription(
906 final java.lang.String description) {
907 this._description = description;
911 * Sets the value of field 'graph'.
913 * @param graph the value of field 'graph'.
915 public void setGraph(
916 final boolean graph) {
918 this._has_graph = true;
922 * Sets the value of field 'graphColour'.
924 * @param graphColour the value of field 'graphColour'.
926 public void setGraphColour(
927 final int graphColour) {
928 this._graphColour = graphColour;
929 this._has_graphColour = true;
933 * Sets the value of field 'graphGroup'.
935 * @param graphGroup the value of field 'graphGroup'.
937 public void setGraphGroup(
938 final int graphGroup) {
939 this._graphGroup = graphGroup;
940 this._has_graphGroup = true;
944 * Sets the value of field 'graphHeight'. The field
945 * 'graphHeight' has the following description: height in
946 * pixels for the graph if this is a graph-type annotation.
948 * @param graphHeight the value of field 'graphHeight'.
950 public void setGraphHeight(
951 final int graphHeight) {
952 this._graphHeight = graphHeight;
953 this._has_graphHeight = true;
957 * Sets the value of field 'graphType'.
959 * @param graphType the value of field 'graphType'.
961 public void setGraphType(
962 final int graphType) {
963 this._graphType = graphType;
964 this._has_graphType = true;
968 * Sets the value of field 'groupRef'.
970 * @param groupRef the value of field 'groupRef'.
972 public void setGroupRef(
973 final java.lang.String groupRef) {
974 this._groupRef = groupRef;
978 * Sets the value of field 'id'.
980 * @param id the value of field 'id'.
983 final java.lang.String id) {
988 * Sets the value of field 'label'.
990 * @param label the value of field 'label'.
992 public void setLabel(
993 final java.lang.String label) {
998 * Sets the value of field 'scaleColLabels'.
1000 * @param scaleColLabels the value of field 'scaleColLabels'.
1002 public void setScaleColLabels(
1003 final boolean scaleColLabels) {
1004 this._scaleColLabels = scaleColLabels;
1005 this._has_scaleColLabels = true;
1009 * Sets the value of field 'score'.
1011 * @param score the value of field 'score'.
1013 public void setScore(
1014 final double score) {
1015 this._score = score;
1016 this._has_score = true;
1020 * Sets the value of field 'scoreOnly'.
1022 * @param scoreOnly the value of field 'scoreOnly'.
1024 public void setScoreOnly(
1025 final boolean scoreOnly) {
1026 this._scoreOnly = scoreOnly;
1027 this._has_scoreOnly = true;
1031 * Sets the value of field 'sequenceRef'.
1033 * @param sequenceRef the value of field 'sequenceRef'.
1035 public void setSequenceRef(
1036 final java.lang.String sequenceRef) {
1037 this._sequenceRef = sequenceRef;
1041 * Sets the value of field 'showAllColLabels'.
1043 * @param showAllColLabels the value of field 'showAllColLabels'
1045 public void setShowAllColLabels(
1046 final boolean showAllColLabels) {
1047 this._showAllColLabels = showAllColLabels;
1048 this._has_showAllColLabels = true;
1052 * Sets the value of field 'thresholdLine'.
1054 * @param thresholdLine the value of field 'thresholdLine'.
1056 public void setThresholdLine(
1057 final jalview.schemabinding.version2.ThresholdLine thresholdLine) {
1058 this._thresholdLine = thresholdLine;
1062 * Sets the value of field 'visible'.
1064 * @param visible the value of field 'visible'.
1066 public void setVisible(
1067 final boolean visible) {
1068 this._visible = visible;
1069 this._has_visible = true;
1076 * @throws org.exolab.castor.xml.MarshalException if object is
1077 * null or if any SAXException is thrown during marshaling
1078 * @throws org.exolab.castor.xml.ValidationException if this
1079 * object is an invalid instance according to the schema
1080 * @return the unmarshaled
1081 * jalview.schemabinding.version2.Annotation
1083 public static jalview.schemabinding.version2.Annotation unmarshal(
1084 final java.io.Reader reader)
1085 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
1086 return (jalview.schemabinding.version2.Annotation) Unmarshaller.unmarshal(jalview.schemabinding.version2.Annotation.class, reader);
1092 * @throws org.exolab.castor.xml.ValidationException if this
1093 * object is an invalid instance according to the schema
1095 public void validate(
1097 throws org.exolab.castor.xml.ValidationException {
1098 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
1099 validator.validate(this);