1 /*******************************************************************************
2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.1)
3 * Copyright (C) 2014 The Jalview Authors
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.
17 * If not, see <http://www.gnu.org/licenses/>.
18 * The Jalview Authors are detailed in the 'AUTHORS' file.
19 ******************************************************************************/
21 * This class was automatically generated with
22 * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
27 package jalview.schemabinding.version2;
29 //---------------------------------/
30 //- Imported classes and packages -/
31 //---------------------------------/
33 import org.exolab.castor.xml.Marshaller;
34 import org.exolab.castor.xml.Unmarshaller;
39 * @version $Revision$ $Date$
41 public class Annotation implements java.io.Serializable
44 // --------------------------/
45 // - Class/Member Variables -/
46 // --------------------------/
51 private boolean _graph;
54 * keeps track of state for field: _graph
56 private boolean _has_graph;
61 private int _graphType;
64 * keeps track of state for field: _graphType
66 private boolean _has_graphType;
71 private java.lang.String _sequenceRef;
76 private java.lang.String _groupRef;
81 private int _graphColour;
84 * keeps track of state for field: _graphColour
86 private boolean _has_graphColour;
91 private int _graphGroup;
94 * keeps track of state for field: _graphGroup
96 private boolean _has_graphGroup;
99 * height in pixels for the graph if this is a graph-type annotation.
101 private int _graphHeight;
104 * keeps track of state for field: _graphHeight
106 private boolean _has_graphHeight;
111 private java.lang.String _id;
116 private boolean _scoreOnly = false;
119 * keeps track of state for field: _scoreOnly
121 private boolean _has_scoreOnly;
126 private double _score;
129 * keeps track of state for field: _score
131 private boolean _has_score;
136 private boolean _visible;
139 * keeps track of state for field: _visible
141 private boolean _has_visible;
144 * Field _centreColLabels.
146 private boolean _centreColLabels;
149 * keeps track of state for field: _centreColLabels
151 private boolean _has_centreColLabels;
154 * Field _scaleColLabels.
156 private boolean _scaleColLabels;
159 * keeps track of state for field: _scaleColLabels
161 private boolean _has_scaleColLabels;
164 * Field _showAllColLabels.
166 private boolean _showAllColLabels;
169 * keeps track of state for field: _showAllColLabels
171 private boolean _has_showAllColLabels;
174 * is an autocalculated annotation row
176 private boolean _autoCalculated = false;
179 * keeps track of state for field: _autoCalculated
181 private boolean _has_autoCalculated;
184 * is to be shown below the alignment - introduced in Jalview 2.8 for
185 * visualizing T-COFFEE alignment scores
187 private boolean _belowAlignment = true;
190 * keeps track of state for field: _belowAlignment
192 private boolean _has_belowAlignment;
195 * Optional string identifier used to group sets of annotation produced by a
196 * particular calculation. Values are opaque strings but have semantic meaning
197 * to Jalview's renderer, data importer and calculation system.
199 private java.lang.String _calcId;
202 * Field _annotationElementList.
204 private java.util.Vector _annotationElementList;
209 private java.lang.String _label;
212 * Field _description.
214 private java.lang.String _description;
217 * Field _thresholdLine.
219 private jalview.schemabinding.version2.ThresholdLine _thresholdLine;
228 this._annotationElementList = new java.util.Vector();
238 * @param vAnnotationElement
239 * @throws java.lang.IndexOutOfBoundsException
240 * if the index given is outside the bounds of the collection
242 public void addAnnotationElement(
243 final jalview.schemabinding.version2.AnnotationElement vAnnotationElement)
244 throws java.lang.IndexOutOfBoundsException
246 this._annotationElementList.addElement(vAnnotationElement);
253 * @param vAnnotationElement
254 * @throws java.lang.IndexOutOfBoundsException
255 * if the index given is outside the bounds of the collection
257 public void addAnnotationElement(
259 final jalview.schemabinding.version2.AnnotationElement vAnnotationElement)
260 throws java.lang.IndexOutOfBoundsException
262 this._annotationElementList.add(index, vAnnotationElement);
267 public void deleteAutoCalculated()
269 this._has_autoCalculated = false;
274 public void deleteBelowAlignment()
276 this._has_belowAlignment = false;
281 public void deleteCentreColLabels()
283 this._has_centreColLabels = false;
288 public void deleteGraph()
290 this._has_graph = false;
295 public void deleteGraphColour()
297 this._has_graphColour = false;
302 public void deleteGraphGroup()
304 this._has_graphGroup = false;
309 public void deleteGraphHeight()
311 this._has_graphHeight = false;
316 public void deleteGraphType()
318 this._has_graphType = false;
323 public void deleteScaleColLabels()
325 this._has_scaleColLabels = false;
330 public void deleteScore()
332 this._has_score = false;
337 public void deleteScoreOnly()
339 this._has_scoreOnly = false;
344 public void deleteShowAllColLabels()
346 this._has_showAllColLabels = false;
351 public void deleteVisible()
353 this._has_visible = false;
357 * Method enumerateAnnotationElement.
359 * @return an Enumeration over all
360 * jalview.schemabinding.version2.AnnotationElement elements
362 public java.util.Enumeration enumerateAnnotationElement()
364 return this._annotationElementList.elements();
368 * Method getAnnotationElement.
371 * @throws java.lang.IndexOutOfBoundsException
372 * if the index given is outside the bounds of the collection
373 * @return the value of the jalview.schemabinding.version2.AnnotationElement
376 public jalview.schemabinding.version2.AnnotationElement getAnnotationElement(
377 final int index) throws java.lang.IndexOutOfBoundsException
379 // check bounds for index
380 if (index < 0 || index >= this._annotationElementList.size())
382 throw new IndexOutOfBoundsException(
383 "getAnnotationElement: Index value '" + index
384 + "' not in range [0.."
385 + (this._annotationElementList.size() - 1) + "]");
388 return (jalview.schemabinding.version2.AnnotationElement) _annotationElementList
393 * Method getAnnotationElement.Returns the contents of the collection in an
396 * Note: Just in case the collection contents are changing in another thread,
397 * we pass a 0-length Array of the correct type into the API call. This way we
398 * <i>know</i> that the Array returned is of exactly the correct length.
400 * @return this collection as an Array
402 public jalview.schemabinding.version2.AnnotationElement[] getAnnotationElement()
404 jalview.schemabinding.version2.AnnotationElement[] array = new jalview.schemabinding.version2.AnnotationElement[0];
405 return (jalview.schemabinding.version2.AnnotationElement[]) this._annotationElementList
410 * Method getAnnotationElementCount.
412 * @return the size of this collection
414 public int getAnnotationElementCount()
416 return this._annotationElementList.size();
420 * Returns the value of field 'autoCalculated'. The field 'autoCalculated' has
421 * the following description: is an autocalculated annotation row
423 * @return the value of field 'AutoCalculated'.
425 public boolean getAutoCalculated()
427 return this._autoCalculated;
431 * Returns the value of field 'belowAlignment'. The field 'belowAlignment' has
432 * the following description: is to be shown below the alignment - introduced
433 * in Jalview 2.8 for visualizing T-COFFEE alignment scores
435 * @return the value of field 'BelowAlignment'.
437 public boolean getBelowAlignment()
439 return this._belowAlignment;
443 * Returns the value of field 'calcId'. The field 'calcId' has the following
444 * description: Optional string identifier used to group sets of annotation
445 * produced by a particular calculation. Values are opaque strings but have
446 * semantic meaning to Jalview's renderer, data importer and calculation
449 * @return the value of field 'CalcId'.
451 public java.lang.String getCalcId()
457 * Returns the value of field 'centreColLabels'.
459 * @return the value of field 'CentreColLabels'.
461 public boolean getCentreColLabels()
463 return this._centreColLabels;
467 * Returns the value of field 'description'.
469 * @return the value of field 'Description'.
471 public java.lang.String getDescription()
473 return this._description;
477 * Returns the value of field 'graph'.
479 * @return the value of field 'Graph'.
481 public boolean getGraph()
487 * Returns the value of field 'graphColour'.
489 * @return the value of field 'GraphColour'.
491 public int getGraphColour()
493 return this._graphColour;
497 * Returns the value of field 'graphGroup'.
499 * @return the value of field 'GraphGroup'.
501 public int getGraphGroup()
503 return this._graphGroup;
507 * Returns the value of field 'graphHeight'. The field 'graphHeight' has the
508 * following description: height in pixels for the graph if this is a
509 * graph-type annotation.
511 * @return the value of field 'GraphHeight'.
513 public int getGraphHeight()
515 return this._graphHeight;
519 * Returns the value of field 'graphType'.
521 * @return the value of field 'GraphType'.
523 public int getGraphType()
525 return this._graphType;
529 * Returns the value of field 'groupRef'.
531 * @return the value of field 'GroupRef'.
533 public java.lang.String getGroupRef()
535 return this._groupRef;
539 * Returns the value of field 'id'.
541 * @return the value of field 'Id'.
543 public java.lang.String getId()
549 * Returns the value of field 'label'.
551 * @return the value of field 'Label'.
553 public java.lang.String getLabel()
559 * Returns the value of field 'scaleColLabels'.
561 * @return the value of field 'ScaleColLabels'.
563 public boolean getScaleColLabels()
565 return this._scaleColLabels;
569 * Returns the value of field 'score'.
571 * @return the value of field 'Score'.
573 public double getScore()
579 * Returns the value of field 'scoreOnly'.
581 * @return the value of field 'ScoreOnly'.
583 public boolean getScoreOnly()
585 return this._scoreOnly;
589 * Returns the value of field 'sequenceRef'.
591 * @return the value of field 'SequenceRef'.
593 public java.lang.String getSequenceRef()
595 return this._sequenceRef;
599 * Returns the value of field 'showAllColLabels'.
601 * @return the value of field 'ShowAllColLabels'.
603 public boolean getShowAllColLabels()
605 return this._showAllColLabels;
609 * Returns the value of field 'thresholdLine'.
611 * @return the value of field 'ThresholdLine'.
613 public jalview.schemabinding.version2.ThresholdLine getThresholdLine()
615 return this._thresholdLine;
619 * Returns the value of field 'visible'.
621 * @return the value of field 'Visible'.
623 public boolean getVisible()
625 return this._visible;
629 * Method hasAutoCalculated.
631 * @return true if at least one AutoCalculated has been added
633 public boolean hasAutoCalculated()
635 return this._has_autoCalculated;
639 * Method hasBelowAlignment.
641 * @return true if at least one BelowAlignment has been added
643 public boolean hasBelowAlignment()
645 return this._has_belowAlignment;
649 * Method hasCentreColLabels.
651 * @return true if at least one CentreColLabels has been added
653 public boolean hasCentreColLabels()
655 return this._has_centreColLabels;
661 * @return true if at least one Graph has been added
663 public boolean hasGraph()
665 return this._has_graph;
669 * Method hasGraphColour.
671 * @return true if at least one GraphColour has been added
673 public boolean hasGraphColour()
675 return this._has_graphColour;
679 * Method hasGraphGroup.
681 * @return true if at least one GraphGroup has been added
683 public boolean hasGraphGroup()
685 return this._has_graphGroup;
689 * Method hasGraphHeight.
691 * @return true if at least one GraphHeight has been added
693 public boolean hasGraphHeight()
695 return this._has_graphHeight;
699 * Method hasGraphType.
701 * @return true if at least one GraphType has been added
703 public boolean hasGraphType()
705 return this._has_graphType;
709 * Method hasScaleColLabels.
711 * @return true if at least one ScaleColLabels has been added
713 public boolean hasScaleColLabels()
715 return this._has_scaleColLabels;
721 * @return true if at least one Score has been added
723 public boolean hasScore()
725 return this._has_score;
729 * Method hasScoreOnly.
731 * @return true if at least one ScoreOnly has been added
733 public boolean hasScoreOnly()
735 return this._has_scoreOnly;
739 * Method hasShowAllColLabels.
741 * @return true if at least one ShowAllColLabels has been added
743 public boolean hasShowAllColLabels()
745 return this._has_showAllColLabels;
751 * @return true if at least one Visible has been added
753 public boolean hasVisible()
755 return this._has_visible;
759 * Returns the value of field 'autoCalculated'. The field 'autoCalculated' has
760 * the following description: is an autocalculated annotation row
762 * @return the value of field 'AutoCalculated'.
764 public boolean isAutoCalculated()
766 return this._autoCalculated;
770 * Returns the value of field 'belowAlignment'. The field 'belowAlignment' has
771 * the following description: is to be shown below the alignment - introduced
772 * in Jalview 2.8 for visualizing T-COFFEE alignment scores
774 * @return the value of field 'BelowAlignment'.
776 public boolean isBelowAlignment()
778 return this._belowAlignment;
782 * Returns the value of field 'centreColLabels'.
784 * @return the value of field 'CentreColLabels'.
786 public boolean isCentreColLabels()
788 return this._centreColLabels;
792 * Returns the value of field 'graph'.
794 * @return the value of field 'Graph'.
796 public boolean isGraph()
802 * Returns the value of field 'scaleColLabels'.
804 * @return the value of field 'ScaleColLabels'.
806 public boolean isScaleColLabels()
808 return this._scaleColLabels;
812 * Returns the value of field 'scoreOnly'.
814 * @return the value of field 'ScoreOnly'.
816 public boolean isScoreOnly()
818 return this._scoreOnly;
822 * Returns the value of field 'showAllColLabels'.
824 * @return the value of field 'ShowAllColLabels'.
826 public boolean isShowAllColLabels()
828 return this._showAllColLabels;
834 * @return true if this object is valid according to the schema
836 public boolean isValid()
841 } catch (org.exolab.castor.xml.ValidationException vex)
849 * Returns the value of field 'visible'.
851 * @return the value of field 'Visible'.
853 public boolean isVisible()
855 return this._visible;
862 * @throws org.exolab.castor.xml.MarshalException
863 * if object is null or if any SAXException is thrown during
865 * @throws org.exolab.castor.xml.ValidationException
866 * if this object is an invalid instance according to the schema
868 public void marshal(final java.io.Writer out)
869 throws org.exolab.castor.xml.MarshalException,
870 org.exolab.castor.xml.ValidationException
872 Marshaller.marshal(this, out);
879 * @throws java.io.IOException
880 * if an IOException occurs during marshaling
881 * @throws org.exolab.castor.xml.ValidationException
882 * if this object is an invalid instance according to the schema
883 * @throws org.exolab.castor.xml.MarshalException
884 * if object is null or if any SAXException is thrown during
887 public void marshal(final org.xml.sax.ContentHandler handler)
888 throws java.io.IOException,
889 org.exolab.castor.xml.MarshalException,
890 org.exolab.castor.xml.ValidationException
892 Marshaller.marshal(this, handler);
897 public void removeAllAnnotationElement()
899 this._annotationElementList.clear();
903 * Method removeAnnotationElement.
905 * @param vAnnotationElement
906 * @return true if the object was removed from the collection.
908 public boolean removeAnnotationElement(
909 final jalview.schemabinding.version2.AnnotationElement vAnnotationElement)
911 boolean removed = _annotationElementList.remove(vAnnotationElement);
916 * Method removeAnnotationElementAt.
919 * @return the element removed from the collection
921 public jalview.schemabinding.version2.AnnotationElement removeAnnotationElementAt(
924 java.lang.Object obj = this._annotationElementList.remove(index);
925 return (jalview.schemabinding.version2.AnnotationElement) obj;
932 * @param vAnnotationElement
933 * @throws java.lang.IndexOutOfBoundsException
934 * if the index given is outside the bounds of the collection
936 public void setAnnotationElement(
938 final jalview.schemabinding.version2.AnnotationElement vAnnotationElement)
939 throws java.lang.IndexOutOfBoundsException
941 // check bounds for index
942 if (index < 0 || index >= this._annotationElementList.size())
944 throw new IndexOutOfBoundsException(
945 "setAnnotationElement: Index value '" + index
946 + "' not in range [0.."
947 + (this._annotationElementList.size() - 1) + "]");
950 this._annotationElementList.set(index, vAnnotationElement);
956 * @param vAnnotationElementArray
958 public void setAnnotationElement(
959 final jalview.schemabinding.version2.AnnotationElement[] vAnnotationElementArray)
962 _annotationElementList.clear();
964 for (int i = 0; i < vAnnotationElementArray.length; i++)
966 this._annotationElementList.add(vAnnotationElementArray[i]);
971 * Sets the value of field 'autoCalculated'. The field 'autoCalculated' has
972 * the following description: is an autocalculated annotation row
974 * @param autoCalculated
975 * the value of field 'autoCalculated'.
977 public void setAutoCalculated(final boolean autoCalculated)
979 this._autoCalculated = autoCalculated;
980 this._has_autoCalculated = true;
984 * Sets the value of field 'belowAlignment'. The field 'belowAlignment' has
985 * the following description: is to be shown below the alignment - introduced
986 * in Jalview 2.8 for visualizing T-COFFEE alignment scores
988 * @param belowAlignment
989 * the value of field 'belowAlignment'.
991 public void setBelowAlignment(final boolean belowAlignment)
993 this._belowAlignment = belowAlignment;
994 this._has_belowAlignment = true;
998 * Sets the value of field 'calcId'. The field 'calcId' has the following
999 * description: Optional string identifier used to group sets of annotation
1000 * produced by a particular calculation. Values are opaque strings but have
1001 * semantic meaning to Jalview's renderer, data importer and calculation
1005 * the value of field 'calcId'.
1007 public void setCalcId(final java.lang.String calcId)
1009 this._calcId = calcId;
1013 * Sets the value of field 'centreColLabels'.
1015 * @param centreColLabels
1016 * the value of field 'centreColLabels'.
1018 public void setCentreColLabels(final boolean centreColLabels)
1020 this._centreColLabels = centreColLabels;
1021 this._has_centreColLabels = true;
1025 * Sets the value of field 'description'.
1027 * @param description
1028 * the value of field 'description'.
1030 public void setDescription(final java.lang.String description)
1032 this._description = description;
1036 * Sets the value of field 'graph'.
1039 * the value of field 'graph'.
1041 public void setGraph(final boolean graph)
1043 this._graph = graph;
1044 this._has_graph = true;
1048 * Sets the value of field 'graphColour'.
1050 * @param graphColour
1051 * the value of field 'graphColour'.
1053 public void setGraphColour(final int graphColour)
1055 this._graphColour = graphColour;
1056 this._has_graphColour = true;
1060 * Sets the value of field 'graphGroup'.
1063 * the value of field 'graphGroup'.
1065 public void setGraphGroup(final int graphGroup)
1067 this._graphGroup = graphGroup;
1068 this._has_graphGroup = true;
1072 * Sets the value of field 'graphHeight'. The field 'graphHeight' has the
1073 * following description: height in pixels for the graph if this is a
1074 * graph-type annotation.
1076 * @param graphHeight
1077 * the value of field 'graphHeight'.
1079 public void setGraphHeight(final int graphHeight)
1081 this._graphHeight = graphHeight;
1082 this._has_graphHeight = true;
1086 * Sets the value of field 'graphType'.
1089 * the value of field 'graphType'.
1091 public void setGraphType(final int graphType)
1093 this._graphType = graphType;
1094 this._has_graphType = true;
1098 * Sets the value of field 'groupRef'.
1101 * the value of field 'groupRef'.
1103 public void setGroupRef(final java.lang.String groupRef)
1105 this._groupRef = groupRef;
1109 * Sets the value of field 'id'.
1112 * the value of field 'id'.
1114 public void setId(final java.lang.String id)
1120 * Sets the value of field 'label'.
1123 * the value of field 'label'.
1125 public void setLabel(final java.lang.String label)
1127 this._label = label;
1131 * Sets the value of field 'scaleColLabels'.
1133 * @param scaleColLabels
1134 * the value of field 'scaleColLabels'.
1136 public void setScaleColLabels(final boolean scaleColLabels)
1138 this._scaleColLabels = scaleColLabels;
1139 this._has_scaleColLabels = true;
1143 * Sets the value of field 'score'.
1146 * the value of field 'score'.
1148 public void setScore(final double score)
1150 this._score = score;
1151 this._has_score = true;
1155 * Sets the value of field 'scoreOnly'.
1158 * the value of field 'scoreOnly'.
1160 public void setScoreOnly(final boolean scoreOnly)
1162 this._scoreOnly = scoreOnly;
1163 this._has_scoreOnly = true;
1167 * Sets the value of field 'sequenceRef'.
1169 * @param sequenceRef
1170 * the value of field 'sequenceRef'.
1172 public void setSequenceRef(final java.lang.String sequenceRef)
1174 this._sequenceRef = sequenceRef;
1178 * Sets the value of field 'showAllColLabels'.
1180 * @param showAllColLabels
1181 * the value of field 'showAllColLabels'
1183 public void setShowAllColLabels(final boolean showAllColLabels)
1185 this._showAllColLabels = showAllColLabels;
1186 this._has_showAllColLabels = true;
1190 * Sets the value of field 'thresholdLine'.
1192 * @param thresholdLine
1193 * the value of field 'thresholdLine'.
1195 public void setThresholdLine(
1196 final jalview.schemabinding.version2.ThresholdLine thresholdLine)
1198 this._thresholdLine = thresholdLine;
1202 * Sets the value of field 'visible'.
1205 * the value of field 'visible'.
1207 public void setVisible(final boolean visible)
1209 this._visible = visible;
1210 this._has_visible = true;
1217 * @throws org.exolab.castor.xml.MarshalException
1218 * if object is null or if any SAXException is thrown during
1220 * @throws org.exolab.castor.xml.ValidationException
1221 * if this object is an invalid instance according to the schema
1222 * @return the unmarshaled jalview.schemabinding.version2.Annotation
1224 public static jalview.schemabinding.version2.Annotation unmarshal(
1225 final java.io.Reader reader)
1226 throws org.exolab.castor.xml.MarshalException,
1227 org.exolab.castor.xml.ValidationException
1229 return (jalview.schemabinding.version2.Annotation) Unmarshaller
1230 .unmarshal(jalview.schemabinding.version2.Annotation.class,
1237 * @throws org.exolab.castor.xml.ValidationException
1238 * if this object is an invalid instance according to the schema
1240 public void validate() throws org.exolab.castor.xml.ValidationException
1242 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
1243 validator.validate(this);