X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fschemabinding%2Fversion2%2FAnnotation.java;h=3da855262eb671508e579bf338d7dfe17ca32b47;hb=cf491d18e6affbfacfc67eda7c6bceedd457982f;hp=a6d60ed37bf2379e411819eb9c19bae064514663;hpb=13ae48dd55af238e2c25e957c5feb5a858d7e90e;p=jalview.git diff --git a/src/jalview/schemabinding/version2/Annotation.java b/src/jalview/schemabinding/version2/Annotation.java old mode 100755 new mode 100644 index a6d60ed..3da8552 --- a/src/jalview/schemabinding/version2/Annotation.java +++ b/src/jalview/schemabinding/version2/Annotation.java @@ -163,6 +163,25 @@ public class Annotation implements java.io.Serializable { private boolean _has_autoCalculated; /** + * is to be shown below the alignment - introduced in Jalview + * 2.8 for visualizing T-COFFEE alignment scores + */ + private boolean _belowAlignment = true; + + /** + * keeps track of state for field: _belowAlignment + */ + private boolean _has_belowAlignment; + + /** + * Optional string identifier used to group sets of annotation + * produced by a particular calculation. Values are opaque + * strings but have semantic meaning to Jalview's renderer, + * data importer and calculation system. + */ + private java.lang.String _calcId; + + /** * Field _annotationElementList. */ private java.util.Vector _annotationElementList; @@ -182,6 +201,11 @@ public class Annotation implements java.io.Serializable { */ private jalview.schemabinding.version2.ThresholdLine _thresholdLine; + /** + * Field _propertyList. + */ + private java.util.Vector _propertyList; + //----------------/ //- Constructors -/ @@ -190,6 +214,7 @@ public class Annotation implements java.io.Serializable { public Annotation() { super(); this._annotationElementList = new java.util.Vector(); + this._propertyList = new java.util.Vector(); } @@ -226,6 +251,34 @@ public class Annotation implements java.io.Serializable { } /** + * + * + * @param vProperty + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + */ + public void addProperty( + final jalview.schemabinding.version2.Property vProperty) + throws java.lang.IndexOutOfBoundsException { + this._propertyList.addElement(vProperty); + } + + /** + * + * + * @param index + * @param vProperty + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + */ + public void addProperty( + final int index, + final jalview.schemabinding.version2.Property vProperty) + throws java.lang.IndexOutOfBoundsException { + this._propertyList.add(index, vProperty); + } + + /** */ public void deleteAutoCalculated( ) { @@ -234,6 +287,13 @@ public class Annotation implements java.io.Serializable { /** */ + public void deleteBelowAlignment( + ) { + this._has_belowAlignment= false; + } + + /** + */ public void deleteCentreColLabels( ) { this._has_centreColLabels= false; @@ -321,6 +381,17 @@ public class Annotation implements java.io.Serializable { } /** + * Method enumerateProperty. + * + * @return an Enumeration over all + * jalview.schemabinding.version2.Property elements + */ + public java.util.Enumeration enumerateProperty( + ) { + return this._propertyList.elements(); + } + + /** * Method getAnnotationElement. * * @param index @@ -380,6 +451,34 @@ public class Annotation implements java.io.Serializable { } /** + * Returns the value of field 'belowAlignment'. The field + * 'belowAlignment' has the following description: is to be + * shown below the alignment - introduced in Jalview 2.8 for + * visualizing T-COFFEE alignment scores + * + * @return the value of field 'BelowAlignment'. + */ + public boolean getBelowAlignment( + ) { + return this._belowAlignment; + } + + /** + * Returns the value of field 'calcId'. The field 'calcId' has + * the following description: Optional string identifier used + * to group sets of annotation produced by a particular + * calculation. Values are opaque strings but have semantic + * meaning to Jalview's renderer, data importer and calculation + * system. + * + * @return the value of field 'CalcId'. + */ + public java.lang.String getCalcId( + ) { + return this._calcId; + } + + /** * Returns the value of field 'centreColLabels'. * * @return the value of field 'CentreColLabels'. @@ -482,6 +581,51 @@ public class Annotation implements java.io.Serializable { } /** + * Method getProperty. + * + * @param index + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + * @return the value of the + * jalview.schemabinding.version2.Property at the given index + */ + public jalview.schemabinding.version2.Property getProperty( + final int index) + throws java.lang.IndexOutOfBoundsException { + // check bounds for index + if (index < 0 || index >= this._propertyList.size()) { + throw new IndexOutOfBoundsException("getProperty: Index value '" + index + "' not in range [0.." + (this._propertyList.size() - 1) + "]"); + } + + return (jalview.schemabinding.version2.Property) _propertyList.get(index); + } + + /** + * Method getProperty.Returns the contents of the collection in + * an Array.

Note: Just in case the collection contents + * are changing in another thread, we pass a 0-length Array of + * the correct type into the API call. This way we know + * that the Array returned is of exactly the correct length. + * + * @return this collection as an Array + */ + public jalview.schemabinding.version2.Property[] getProperty( + ) { + jalview.schemabinding.version2.Property[] array = new jalview.schemabinding.version2.Property[0]; + return (jalview.schemabinding.version2.Property[]) this._propertyList.toArray(array); + } + + /** + * Method getPropertyCount. + * + * @return the size of this collection + */ + public int getPropertyCount( + ) { + return this._propertyList.size(); + } + + /** * Returns the value of field 'scaleColLabels'. * * @return the value of field 'ScaleColLabels'. @@ -562,6 +706,16 @@ public class Annotation implements java.io.Serializable { } /** + * Method hasBelowAlignment. + * + * @return true if at least one BelowAlignment has been added + */ + public boolean hasBelowAlignment( + ) { + return this._has_belowAlignment; + } + + /** * Method hasCentreColLabels. * * @return true if at least one CentreColLabels has been added @@ -684,6 +838,19 @@ public class Annotation implements java.io.Serializable { } /** + * Returns the value of field 'belowAlignment'. The field + * 'belowAlignment' has the following description: is to be + * shown below the alignment - introduced in Jalview 2.8 for + * visualizing T-COFFEE alignment scores + * + * @return the value of field 'BelowAlignment'. + */ + public boolean isBelowAlignment( + ) { + return this._belowAlignment; + } + + /** * Returns the value of field 'centreColLabels'. * * @return the value of field 'CentreColLabels'. @@ -798,6 +965,13 @@ public class Annotation implements java.io.Serializable { } /** + */ + public void removeAllProperty( + ) { + this._propertyList.clear(); + } + + /** * Method removeAnnotationElement. * * @param vAnnotationElement @@ -822,6 +996,30 @@ public class Annotation implements java.io.Serializable { } /** + * Method removeProperty. + * + * @param vProperty + * @return true if the object was removed from the collection. + */ + public boolean removeProperty( + final jalview.schemabinding.version2.Property vProperty) { + boolean removed = _propertyList.remove(vProperty); + return removed; + } + + /** + * Method removePropertyAt. + * + * @param index + * @return the element removed from the collection + */ + public jalview.schemabinding.version2.Property removePropertyAt( + final int index) { + java.lang.Object obj = this._propertyList.remove(index); + return (jalview.schemabinding.version2.Property) obj; + } + + /** * * * @param index @@ -870,6 +1068,35 @@ public class Annotation implements java.io.Serializable { } /** + * Sets the value of field 'belowAlignment'. The field + * 'belowAlignment' has the following description: is to be + * shown below the alignment - introduced in Jalview 2.8 for + * visualizing T-COFFEE alignment scores + * + * @param belowAlignment the value of field 'belowAlignment'. + */ + public void setBelowAlignment( + final boolean belowAlignment) { + this._belowAlignment = belowAlignment; + this._has_belowAlignment = true; + } + + /** + * Sets the value of field 'calcId'. The field 'calcId' has the + * following description: Optional string identifier used to + * group sets of annotation produced by a particular + * calculation. Values are opaque strings but have semantic + * meaning to Jalview's renderer, data importer and calculation + * system. + * + * @param calcId the value of field 'calcId'. + */ + public void setCalcId( + final java.lang.String calcId) { + this._calcId = calcId; + } + + /** * Sets the value of field 'centreColLabels'. * * @param centreColLabels the value of field 'centreColLabels'. @@ -978,6 +1205,41 @@ public class Annotation implements java.io.Serializable { } /** + * + * + * @param index + * @param vProperty + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + */ + public void setProperty( + final int index, + final jalview.schemabinding.version2.Property vProperty) + throws java.lang.IndexOutOfBoundsException { + // check bounds for index + if (index < 0 || index >= this._propertyList.size()) { + throw new IndexOutOfBoundsException("setProperty: Index value '" + index + "' not in range [0.." + (this._propertyList.size() - 1) + "]"); + } + + this._propertyList.set(index, vProperty); + } + + /** + * + * + * @param vPropertyArray + */ + public void setProperty( + final jalview.schemabinding.version2.Property[] vPropertyArray) { + //-- copy array + _propertyList.clear(); + + for (int i = 0; i < vPropertyArray.length; i++) { + this._propertyList.add(vPropertyArray[i]); + } + } + + /** * Sets the value of field 'scaleColLabels'. * * @param scaleColLabels the value of field 'scaleColLabels'.