You should have received a copy of the GNU General Public License along with Jalview. If not, see <http://www.gnu.org/licenses/>.
-->
-<!-- edited with XMLSpy v2005 rel. 3 U (http://www.altova.com) by lj (jl) -->
-<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="www.jalview.org/colours">
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:jalview="www.jalview.org/colours" targetNamespace="www.jalview.org/colours">
<xs:complexType name="JalviewUserColours">
<xs:sequence>
<xs:element name="Version" maxOccurs="1" minOccurs="0" type="xs:string">
</xs:element>
<xs:element name="colour" maxOccurs="unbounded" minOccurs="0">
<xs:complexType>
- <xs:attribute name="Name" type="xs:string"/>
+ <xs:sequence>
+ <xs:element name="attributeName" type="xs:string" minOccurs="0" maxOccurs="2">
+ <xs:annotation>
+ <xs:documentation>name of feature attribute to colour by, or attribute and sub-attribute</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:sequence>
+ <xs:attribute name="Name" type="xs:string">
+ <xs:annotation>
+ <xs:documentation>Single letter residue code for an alignment colour scheme, or feature type for a feature colour scheme</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
<xs:attribute name="RGB" type="xs:string" use="required"/>
<xs:attribute name="minRGB" type="xs:string" use="optional"/>
- <xs:attribute name="threshType" type="xs:string" use="optional">
- <xs:annotation>
- <xs:documentation>loosely specified enumeration: NONE,ABOVE, or BELOW</xs:documentation>
- </xs:annotation>
+ <xs:attribute name="noValueColour" use="optional" default="Min">
+ <xs:annotation>
+ <xs:documentation>Colour if no attribute or score value</xs:documentation>
+ </xs:annotation>
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="None" />
+ <xs:enumeration value="Min" />
+ <xs:enumeration value="Max" />
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ <xs:attribute name="threshType" use="optional">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="NONE" />
+ <xs:enumeration value="ABOVE" />
+ <xs:enumeration value="BELOW" />
+ </xs:restriction>
+ </xs:simpleType>
</xs:attribute>
<xs:attribute name="threshold" type="xs:float" use="optional"/>
<xs:attribute name="max" type="xs:float" use="optional"/>
<xs:attribute name="autoScale" type="xs:boolean" use="optional"/>
</xs:complexType>
</xs:element>
+ <xs:element name="filter" maxOccurs="unbounded" minOccurs="0" >
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="matcherSet" type="jalview:FeatureMatcherSet" />
+ </xs:sequence>
+ <xs:attribute name="featureType" type="xs:string" use="required"/>
+ </xs:complexType>
+ </xs:element>
</xs:sequence>
<xs:attribute name="schemeName" type="xs:string" use="optional"/>
</xs:complexType>
+
+ <xs:complexType name="FeatureMatcherSet">
+ <xs:annotation>
+ <xs:documentation>A feature match condition, which may be simple or compound</xs:documentation>
+ </xs:annotation>
+ <xs:choice>
+ <xs:element name="matchCondition" type="jalview:FeatureMatcher" />
+ <xs:element name="compoundMatcher">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="matcherSet" minOccurs="2" maxOccurs="2" type="jalview:FeatureMatcherSet" />
+ </xs:sequence>
+ <xs:attribute name="and" type="xs:boolean" use="required">
+ <xs:annotation>
+ <xs:documentation>If true, matchers are AND-ed, if false they are OR-ed</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ </xs:complexType>
+ </xs:element>
+ </xs:choice>
+ </xs:complexType>
+
+ <xs:complexType name="FeatureMatcher">
+ <xs:sequence>
+ <xs:element name="attributeName" type="xs:string" minOccurs="0" maxOccurs="2">
+ <xs:annotation>
+ <xs:documentation>name of feature attribute to filter on, or attribute and sub-attribute</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="condition" type="xs:string" />
+ <xs:element name="value" type="xs:string" />
+ </xs:sequence>
+ <xs:attribute name="by">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="byLabel" />
+ <xs:enumeration value="byScore" />
+ <xs:enumeration value="byAttribute" />
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ </xs:complexType>
+
</xs:schema>
// --------------------------/
/**
- * Field _name.
+ * Single letter residue code for an alignment colour scheme, or feature type
+ * for a feature colour scheme
*/
private java.lang.String _name;
private java.lang.String _minRGB;
/**
- * loosely specified enumeration: NONE,ABOVE, or BELOW
+ * Colour if no attribute or score value
*/
- private java.lang.String _threshType;
+ private jalview.binding.types.ColourNoValueColourType _noValueColour = jalview.binding.types.ColourNoValueColourType
+ .valueOf("Min");
+
+ /**
+ * Field _threshType.
+ */
+ private jalview.binding.types.ColourThreshTypeType _threshType;
/**
* Field _threshold.
*/
private boolean _has_autoScale;
+ /**
+ * name of feature attribute to colour by, or attribute and sub-attribute
+ */
+ private java.util.Vector _attributeNameList;
+
// ----------------/
// - Constructors -/
// ----------------/
public Colour()
{
super();
+ setNoValueColour(
+ jalview.binding.types.ColourNoValueColourType.valueOf("Min"));
+ this._attributeNameList = new java.util.Vector();
}
// -----------/
// -----------/
/**
- */
+ *
+ *
+ * @param vAttributeName
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addAttributeName(final java.lang.String vAttributeName)
+ throws java.lang.IndexOutOfBoundsException
+ {
+ // check for the maximum size
+ if (this._attributeNameList.size() >= 2)
+ {
+ throw new IndexOutOfBoundsException(
+ "addAttributeName has a maximum of 2");
+ }
+
+ this._attributeNameList.addElement(vAttributeName);
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vAttributeName
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addAttributeName(final int index,
+ final java.lang.String vAttributeName)
+ throws java.lang.IndexOutOfBoundsException
+ {
+ // check for the maximum size
+ if (this._attributeNameList.size() >= 2)
+ {
+ throw new IndexOutOfBoundsException(
+ "addAttributeName has a maximum of 2");
+ }
+
+ this._attributeNameList.add(index, vAttributeName);
+ }
+
+ /**
+ */
public void deleteAutoScale()
{
this._has_autoScale = false;
}
/**
- */
+ */
public void deleteColourByLabel()
{
this._has_colourByLabel = false;
}
/**
- */
+ */
public void deleteMax()
{
this._has_max = false;
}
/**
- */
+ */
public void deleteMin()
{
this._has_min = false;
}
/**
- */
+ */
public void deleteThreshold()
{
this._has_threshold = false;
}
/**
+ * Method enumerateAttributeName.
+ *
+ * @return an Enumeration over all java.lang.String elements
+ */
+ public java.util.Enumeration enumerateAttributeName()
+ {
+ return this._attributeNameList.elements();
+ }
+
+ /**
+ * Method getAttributeName.
+ *
+ * @param index
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ * @return the value of the java.lang.String at the given index
+ */
+ public java.lang.String getAttributeName(final int index)
+ throws java.lang.IndexOutOfBoundsException
+ {
+ // check bounds for index
+ if (index < 0 || index >= this._attributeNameList.size())
+ {
+ throw new IndexOutOfBoundsException("getAttributeName: Index value '"
+ + index + "' not in range [0.."
+ + (this._attributeNameList.size() - 1) + "]");
+ }
+
+ return (java.lang.String) _attributeNameList.get(index);
+ }
+
+ /**
+ * Method getAttributeName.Returns the contents of the collection in an Array.
+ * <p>
+ * 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
+ * <i>know</i> that the Array returned is of exactly the correct length.
+ *
+ * @return this collection as an Array
+ */
+ public java.lang.String[] getAttributeName()
+ {
+ java.lang.String[] array = new java.lang.String[0];
+ return (java.lang.String[]) this._attributeNameList.toArray(array);
+ }
+
+ /**
+ * Method getAttributeNameCount.
+ *
+ * @return the size of this collection
+ */
+ public int getAttributeNameCount()
+ {
+ return this._attributeNameList.size();
+ }
+
+ /**
* Returns the value of field 'autoScale'.
*
* @return the value of field 'AutoScale'.
}
/**
- * Returns the value of field 'name'.
+ * Returns the value of field 'name'. The field 'name' has the following
+ * description: Single letter residue code for an alignment colour scheme, or
+ * feature type for a feature colour scheme
*
* @return the value of field 'Name'.
*/
}
/**
+ * Returns the value of field 'noValueColour'. The field 'noValueColour' has
+ * the following description: Colour if no attribute or score value
+ *
+ * @return the value of field 'NoValueColour'.
+ */
+ public jalview.binding.types.ColourNoValueColourType getNoValueColour()
+ {
+ return this._noValueColour;
+ }
+
+ /**
* Returns the value of field 'RGB'.
*
* @return the value of field 'RGB'.
}
/**
- * Returns the value of field 'threshType'. The field 'threshType' has the
- * following description: loosely specified enumeration: NONE,ABOVE, or BELOW
+ * Returns the value of field 'threshType'.
*
* @return the value of field 'ThreshType'.
*/
- public java.lang.String getThreshType()
+ public jalview.binding.types.ColourThreshTypeType getThreshType()
{
return this._threshType;
}
}
/**
+ */
+ public void removeAllAttributeName()
+ {
+ this._attributeNameList.clear();
+ }
+
+ /**
+ * Method removeAttributeName.
+ *
+ * @param vAttributeName
+ * @return true if the object was removed from the collection.
+ */
+ public boolean removeAttributeName(final java.lang.String vAttributeName)
+ {
+ boolean removed = _attributeNameList.remove(vAttributeName);
+ return removed;
+ }
+
+ /**
+ * Method removeAttributeNameAt.
+ *
+ * @param index
+ * @return the element removed from the collection
+ */
+ public java.lang.String removeAttributeNameAt(final int index)
+ {
+ java.lang.Object obj = this._attributeNameList.remove(index);
+ return (java.lang.String) obj;
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vAttributeName
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void setAttributeName(final int index,
+ final java.lang.String vAttributeName)
+ throws java.lang.IndexOutOfBoundsException
+ {
+ // check bounds for index
+ if (index < 0 || index >= this._attributeNameList.size())
+ {
+ throw new IndexOutOfBoundsException("setAttributeName: Index value '"
+ + index + "' not in range [0.."
+ + (this._attributeNameList.size() - 1) + "]");
+ }
+
+ this._attributeNameList.set(index, vAttributeName);
+ }
+
+ /**
+ *
+ *
+ * @param vAttributeNameArray
+ */
+ public void setAttributeName(final java.lang.String[] vAttributeNameArray)
+ {
+ // -- copy array
+ _attributeNameList.clear();
+
+ for (int i = 0; i < vAttributeNameArray.length; i++)
+ {
+ this._attributeNameList.add(vAttributeNameArray[i]);
+ }
+ }
+
+ /**
* Sets the value of field 'autoScale'.
*
* @param autoScale
}
/**
- * Sets the value of field 'name'.
+ * Sets the value of field 'name'. The field 'name' has the following
+ * description: Single letter residue code for an alignment colour scheme, or
+ * feature type for a feature colour scheme
*
* @param name
* the value of field 'name'.
}
/**
+ * Sets the value of field 'noValueColour'. The field 'noValueColour' has the
+ * following description: Colour if no attribute or score value
+ *
+ * @param noValueColour
+ * the value of field 'noValueColour'.
+ */
+ public void setNoValueColour(
+ final jalview.binding.types.ColourNoValueColourType noValueColour)
+ {
+ this._noValueColour = noValueColour;
+ }
+
+ /**
* Sets the value of field 'RGB'.
*
* @param RGB
}
/**
- * Sets the value of field 'threshType'. The field 'threshType' has the
- * following description: loosely specified enumeration: NONE,ABOVE, or BELOW
+ * Sets the value of field 'threshType'.
*
* @param threshType
* the value of field 'threshType'.
*/
- public void setThreshType(final java.lang.String threshType)
+ public void setThreshType(
+ final jalview.binding.types.ColourThreshTypeType threshType)
{
this._threshType = threshType;
}
--- /dev/null
+/*
+ * This class was automatically generated with
+ * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
+ * Schema.
+ * $Id$
+ */
+
+package jalview.binding;
+
+//---------------------------------/
+//- Imported classes and packages -/
+//---------------------------------/
+
+import org.exolab.castor.xml.Marshaller;
+import org.exolab.castor.xml.Unmarshaller;
+
+/**
+ * Class CompoundMatcher.
+ *
+ * @version $Revision$ $Date$
+ */
+public class CompoundMatcher implements java.io.Serializable
+{
+
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
+
+ /**
+ * If true, matchers are AND-ed, if false they are OR-ed
+ */
+ private boolean _and;
+
+ /**
+ * keeps track of state for field: _and
+ */
+ private boolean _has_and;
+
+ /**
+ * Field _matcherSetList.
+ */
+ private java.util.Vector _matcherSetList;
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public CompoundMatcher()
+ {
+ super();
+ this._matcherSetList = new java.util.Vector();
+ }
+
+ // -----------/
+ // - Methods -/
+ // -----------/
+
+ /**
+ *
+ *
+ * @param vMatcherSet
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addMatcherSet(final jalview.binding.MatcherSet vMatcherSet)
+ throws java.lang.IndexOutOfBoundsException
+ {
+ // check for the maximum size
+ if (this._matcherSetList.size() >= 2)
+ {
+ throw new IndexOutOfBoundsException(
+ "addMatcherSet has a maximum of 2");
+ }
+
+ this._matcherSetList.addElement(vMatcherSet);
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vMatcherSet
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addMatcherSet(final int index,
+ final jalview.binding.MatcherSet vMatcherSet)
+ throws java.lang.IndexOutOfBoundsException
+ {
+ // check for the maximum size
+ if (this._matcherSetList.size() >= 2)
+ {
+ throw new IndexOutOfBoundsException(
+ "addMatcherSet has a maximum of 2");
+ }
+
+ this._matcherSetList.add(index, vMatcherSet);
+ }
+
+ /**
+ */
+ public void deleteAnd()
+ {
+ this._has_and = false;
+ }
+
+ /**
+ * Method enumerateMatcherSet.
+ *
+ * @return an Enumeration over all jalview.binding.MatcherSet elements
+ */
+ public java.util.Enumeration enumerateMatcherSet()
+ {
+ return this._matcherSetList.elements();
+ }
+
+ /**
+ * Returns the value of field 'and'. The field 'and' has the following
+ * description: If true, matchers are AND-ed, if false they are OR-ed
+ *
+ * @return the value of field 'And'.
+ */
+ public boolean getAnd()
+ {
+ return this._and;
+ }
+
+ /**
+ * Method getMatcherSet.
+ *
+ * @param index
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ * @return the value of the jalview.binding.MatcherSet at the given index
+ */
+ public jalview.binding.MatcherSet getMatcherSet(final int index)
+ throws java.lang.IndexOutOfBoundsException
+ {
+ // check bounds for index
+ if (index < 0 || index >= this._matcherSetList.size())
+ {
+ throw new IndexOutOfBoundsException(
+ "getMatcherSet: Index value '" + index + "' not in range [0.."
+ + (this._matcherSetList.size() - 1) + "]");
+ }
+
+ return (jalview.binding.MatcherSet) _matcherSetList.get(index);
+ }
+
+ /**
+ * Method getMatcherSet.Returns the contents of the collection in an Array.
+ * <p>
+ * 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
+ * <i>know</i> that the Array returned is of exactly the correct length.
+ *
+ * @return this collection as an Array
+ */
+ public jalview.binding.MatcherSet[] getMatcherSet()
+ {
+ jalview.binding.MatcherSet[] array = new jalview.binding.MatcherSet[0];
+ return (jalview.binding.MatcherSet[]) this._matcherSetList
+ .toArray(array);
+ }
+
+ /**
+ * Method getMatcherSetCount.
+ *
+ * @return the size of this collection
+ */
+ public int getMatcherSetCount()
+ {
+ return this._matcherSetList.size();
+ }
+
+ /**
+ * Method hasAnd.
+ *
+ * @return true if at least one And has been added
+ */
+ public boolean hasAnd()
+ {
+ return this._has_and;
+ }
+
+ /**
+ * Returns the value of field 'and'. The field 'and' has the following
+ * description: If true, matchers are AND-ed, if false they are OR-ed
+ *
+ * @return the value of field 'And'.
+ */
+ public boolean isAnd()
+ {
+ return this._and;
+ }
+
+ /**
+ * Method isValid.
+ *
+ * @return true if this object is valid according to the schema
+ */
+ public boolean isValid()
+ {
+ try
+ {
+ validate();
+ } catch (org.exolab.castor.xml.ValidationException vex)
+ {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ *
+ *
+ * @param out
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void marshal(final java.io.Writer out)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException
+ {
+ Marshaller.marshal(this, out);
+ }
+
+ /**
+ *
+ *
+ * @param handler
+ * @throws java.io.IOException
+ * if an IOException occurs during marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ */
+ public void marshal(final org.xml.sax.ContentHandler handler)
+ throws java.io.IOException,
+ org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException
+ {
+ Marshaller.marshal(this, handler);
+ }
+
+ /**
+ */
+ public void removeAllMatcherSet()
+ {
+ this._matcherSetList.clear();
+ }
+
+ /**
+ * Method removeMatcherSet.
+ *
+ * @param vMatcherSet
+ * @return true if the object was removed from the collection.
+ */
+ public boolean removeMatcherSet(
+ final jalview.binding.MatcherSet vMatcherSet)
+ {
+ boolean removed = _matcherSetList.remove(vMatcherSet);
+ return removed;
+ }
+
+ /**
+ * Method removeMatcherSetAt.
+ *
+ * @param index
+ * @return the element removed from the collection
+ */
+ public jalview.binding.MatcherSet removeMatcherSetAt(final int index)
+ {
+ java.lang.Object obj = this._matcherSetList.remove(index);
+ return (jalview.binding.MatcherSet) obj;
+ }
+
+ /**
+ * Sets the value of field 'and'. The field 'and' has the following
+ * description: If true, matchers are AND-ed, if false they are OR-ed
+ *
+ * @param and
+ * the value of field 'and'.
+ */
+ public void setAnd(final boolean and)
+ {
+ this._and = and;
+ this._has_and = true;
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vMatcherSet
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void setMatcherSet(final int index,
+ final jalview.binding.MatcherSet vMatcherSet)
+ throws java.lang.IndexOutOfBoundsException
+ {
+ // check bounds for index
+ if (index < 0 || index >= this._matcherSetList.size())
+ {
+ throw new IndexOutOfBoundsException(
+ "setMatcherSet: Index value '" + index + "' not in range [0.."
+ + (this._matcherSetList.size() - 1) + "]");
+ }
+
+ this._matcherSetList.set(index, vMatcherSet);
+ }
+
+ /**
+ *
+ *
+ * @param vMatcherSetArray
+ */
+ public void setMatcherSet(
+ final jalview.binding.MatcherSet[] vMatcherSetArray)
+ {
+ // -- copy array
+ _matcherSetList.clear();
+
+ for (int i = 0; i < vMatcherSetArray.length; i++)
+ {
+ this._matcherSetList.add(vMatcherSetArray[i]);
+ }
+ }
+
+ /**
+ * Method unmarshal.
+ *
+ * @param reader
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @return the unmarshaled jalview.binding.CompoundMatcher
+ */
+ public static jalview.binding.CompoundMatcher unmarshal(
+ final java.io.Reader reader)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException
+ {
+ return (jalview.binding.CompoundMatcher) Unmarshaller
+ .unmarshal(jalview.binding.CompoundMatcher.class, reader);
+ }
+
+ /**
+ *
+ *
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void validate() throws org.exolab.castor.xml.ValidationException
+ {
+ org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
+ validator.validate(this);
+ }
+
+}
--- /dev/null
+/*
+ * This class was automatically generated with
+ * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
+ * Schema.
+ * $Id$
+ */
+
+package jalview.binding;
+
+//---------------------------------/
+//- Imported classes and packages -/
+//---------------------------------/
+
+import org.exolab.castor.xml.Marshaller;
+import org.exolab.castor.xml.Unmarshaller;
+
+/**
+ * Class FeatureMatcher.
+ *
+ * @version $Revision$ $Date$
+ */
+public class FeatureMatcher implements java.io.Serializable
+{
+
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
+
+ /**
+ * Field _by.
+ */
+ private jalview.binding.types.FeatureMatcherByType _by;
+
+ /**
+ * name of feature attribute to filter on, or attribute and sub-attribute
+ */
+ private java.util.Vector _attributeNameList;
+
+ /**
+ * Field _condition.
+ */
+ private java.lang.String _condition;
+
+ /**
+ * Field _value.
+ */
+ private java.lang.String _value;
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public FeatureMatcher()
+ {
+ super();
+ this._attributeNameList = new java.util.Vector();
+ }
+
+ // -----------/
+ // - Methods -/
+ // -----------/
+
+ /**
+ *
+ *
+ * @param vAttributeName
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addAttributeName(final java.lang.String vAttributeName)
+ throws java.lang.IndexOutOfBoundsException
+ {
+ // check for the maximum size
+ if (this._attributeNameList.size() >= 2)
+ {
+ throw new IndexOutOfBoundsException(
+ "addAttributeName has a maximum of 2");
+ }
+
+ this._attributeNameList.addElement(vAttributeName);
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vAttributeName
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addAttributeName(final int index,
+ final java.lang.String vAttributeName)
+ throws java.lang.IndexOutOfBoundsException
+ {
+ // check for the maximum size
+ if (this._attributeNameList.size() >= 2)
+ {
+ throw new IndexOutOfBoundsException(
+ "addAttributeName has a maximum of 2");
+ }
+
+ this._attributeNameList.add(index, vAttributeName);
+ }
+
+ /**
+ * Method enumerateAttributeName.
+ *
+ * @return an Enumeration over all java.lang.String elements
+ */
+ public java.util.Enumeration enumerateAttributeName()
+ {
+ return this._attributeNameList.elements();
+ }
+
+ /**
+ * Method getAttributeName.
+ *
+ * @param index
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ * @return the value of the java.lang.String at the given index
+ */
+ public java.lang.String getAttributeName(final int index)
+ throws java.lang.IndexOutOfBoundsException
+ {
+ // check bounds for index
+ if (index < 0 || index >= this._attributeNameList.size())
+ {
+ throw new IndexOutOfBoundsException("getAttributeName: Index value '"
+ + index + "' not in range [0.."
+ + (this._attributeNameList.size() - 1) + "]");
+ }
+
+ return (java.lang.String) _attributeNameList.get(index);
+ }
+
+ /**
+ * Method getAttributeName.Returns the contents of the collection in an Array.
+ * <p>
+ * 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
+ * <i>know</i> that the Array returned is of exactly the correct length.
+ *
+ * @return this collection as an Array
+ */
+ public java.lang.String[] getAttributeName()
+ {
+ java.lang.String[] array = new java.lang.String[0];
+ return (java.lang.String[]) this._attributeNameList.toArray(array);
+ }
+
+ /**
+ * Method getAttributeNameCount.
+ *
+ * @return the size of this collection
+ */
+ public int getAttributeNameCount()
+ {
+ return this._attributeNameList.size();
+ }
+
+ /**
+ * Returns the value of field 'by'.
+ *
+ * @return the value of field 'By'.
+ */
+ public jalview.binding.types.FeatureMatcherByType getBy()
+ {
+ return this._by;
+ }
+
+ /**
+ * Returns the value of field 'condition'.
+ *
+ * @return the value of field 'Condition'.
+ */
+ public java.lang.String getCondition()
+ {
+ return this._condition;
+ }
+
+ /**
+ * Returns the value of field 'value'.
+ *
+ * @return the value of field 'Value'.
+ */
+ public java.lang.String getValue()
+ {
+ return this._value;
+ }
+
+ /**
+ * Method isValid.
+ *
+ * @return true if this object is valid according to the schema
+ */
+ public boolean isValid()
+ {
+ try
+ {
+ validate();
+ } catch (org.exolab.castor.xml.ValidationException vex)
+ {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ *
+ *
+ * @param out
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void marshal(final java.io.Writer out)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException
+ {
+ Marshaller.marshal(this, out);
+ }
+
+ /**
+ *
+ *
+ * @param handler
+ * @throws java.io.IOException
+ * if an IOException occurs during marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ */
+ public void marshal(final org.xml.sax.ContentHandler handler)
+ throws java.io.IOException,
+ org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException
+ {
+ Marshaller.marshal(this, handler);
+ }
+
+ /**
+ */
+ public void removeAllAttributeName()
+ {
+ this._attributeNameList.clear();
+ }
+
+ /**
+ * Method removeAttributeName.
+ *
+ * @param vAttributeName
+ * @return true if the object was removed from the collection.
+ */
+ public boolean removeAttributeName(final java.lang.String vAttributeName)
+ {
+ boolean removed = _attributeNameList.remove(vAttributeName);
+ return removed;
+ }
+
+ /**
+ * Method removeAttributeNameAt.
+ *
+ * @param index
+ * @return the element removed from the collection
+ */
+ public java.lang.String removeAttributeNameAt(final int index)
+ {
+ java.lang.Object obj = this._attributeNameList.remove(index);
+ return (java.lang.String) obj;
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vAttributeName
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void setAttributeName(final int index,
+ final java.lang.String vAttributeName)
+ throws java.lang.IndexOutOfBoundsException
+ {
+ // check bounds for index
+ if (index < 0 || index >= this._attributeNameList.size())
+ {
+ throw new IndexOutOfBoundsException("setAttributeName: Index value '"
+ + index + "' not in range [0.."
+ + (this._attributeNameList.size() - 1) + "]");
+ }
+
+ this._attributeNameList.set(index, vAttributeName);
+ }
+
+ /**
+ *
+ *
+ * @param vAttributeNameArray
+ */
+ public void setAttributeName(final java.lang.String[] vAttributeNameArray)
+ {
+ // -- copy array
+ _attributeNameList.clear();
+
+ for (int i = 0; i < vAttributeNameArray.length; i++)
+ {
+ this._attributeNameList.add(vAttributeNameArray[i]);
+ }
+ }
+
+ /**
+ * Sets the value of field 'by'.
+ *
+ * @param by
+ * the value of field 'by'.
+ */
+ public void setBy(final jalview.binding.types.FeatureMatcherByType by)
+ {
+ this._by = by;
+ }
+
+ /**
+ * Sets the value of field 'condition'.
+ *
+ * @param condition
+ * the value of field 'condition'.
+ */
+ public void setCondition(final java.lang.String condition)
+ {
+ this._condition = condition;
+ }
+
+ /**
+ * Sets the value of field 'value'.
+ *
+ * @param value
+ * the value of field 'value'.
+ */
+ public void setValue(final java.lang.String value)
+ {
+ this._value = value;
+ }
+
+ /**
+ * Method unmarshal.
+ *
+ * @param reader
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @return the unmarshaled jalview.binding.FeatureMatcher
+ */
+ public static jalview.binding.FeatureMatcher unmarshal(
+ final java.io.Reader reader)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException
+ {
+ return (jalview.binding.FeatureMatcher) Unmarshaller
+ .unmarshal(jalview.binding.FeatureMatcher.class, reader);
+ }
+
+ /**
+ *
+ *
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void validate() throws org.exolab.castor.xml.ValidationException
+ {
+ org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
+ validator.validate(this);
+ }
+
+}
--- /dev/null
+/*
+ * This class was automatically generated with
+ * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
+ * Schema.
+ * $Id$
+ */
+
+package jalview.binding;
+
+//---------------------------------/
+//- Imported classes and packages -/
+//---------------------------------/
+
+import org.exolab.castor.xml.Marshaller;
+import org.exolab.castor.xml.Unmarshaller;
+
+/**
+ * A feature match condition, which may be simple or compound
+ *
+ * @version $Revision$ $Date$
+ */
+public class FeatureMatcherSet implements java.io.Serializable
+{
+
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
+
+ /**
+ * Internal choice value storage
+ */
+ private java.lang.Object _choiceValue;
+
+ /**
+ * Field _matchCondition.
+ */
+ private jalview.binding.MatchCondition _matchCondition;
+
+ /**
+ * Field _compoundMatcher.
+ */
+ private jalview.binding.CompoundMatcher _compoundMatcher;
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public FeatureMatcherSet()
+ {
+ super();
+ }
+
+ // -----------/
+ // - Methods -/
+ // -----------/
+
+ /**
+ * Returns the value of field 'choiceValue'. The field 'choiceValue' has the
+ * following description: Internal choice value storage
+ *
+ * @return the value of field 'ChoiceValue'.
+ */
+ public java.lang.Object getChoiceValue()
+ {
+ return this._choiceValue;
+ }
+
+ /**
+ * Returns the value of field 'compoundMatcher'.
+ *
+ * @return the value of field 'CompoundMatcher'.
+ */
+ public jalview.binding.CompoundMatcher getCompoundMatcher()
+ {
+ return this._compoundMatcher;
+ }
+
+ /**
+ * Returns the value of field 'matchCondition'.
+ *
+ * @return the value of field 'MatchCondition'.
+ */
+ public jalview.binding.MatchCondition getMatchCondition()
+ {
+ return this._matchCondition;
+ }
+
+ /**
+ * Method isValid.
+ *
+ * @return true if this object is valid according to the schema
+ */
+ public boolean isValid()
+ {
+ try
+ {
+ validate();
+ } catch (org.exolab.castor.xml.ValidationException vex)
+ {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ *
+ *
+ * @param out
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void marshal(final java.io.Writer out)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException
+ {
+ Marshaller.marshal(this, out);
+ }
+
+ /**
+ *
+ *
+ * @param handler
+ * @throws java.io.IOException
+ * if an IOException occurs during marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ */
+ public void marshal(final org.xml.sax.ContentHandler handler)
+ throws java.io.IOException,
+ org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException
+ {
+ Marshaller.marshal(this, handler);
+ }
+
+ /**
+ * Sets the value of field 'compoundMatcher'.
+ *
+ * @param compoundMatcher
+ * the value of field 'compoundMatcher'.
+ */
+ public void setCompoundMatcher(
+ final jalview.binding.CompoundMatcher compoundMatcher)
+ {
+ this._compoundMatcher = compoundMatcher;
+ this._choiceValue = compoundMatcher;
+ }
+
+ /**
+ * Sets the value of field 'matchCondition'.
+ *
+ * @param matchCondition
+ * the value of field 'matchCondition'.
+ */
+ public void setMatchCondition(
+ final jalview.binding.MatchCondition matchCondition)
+ {
+ this._matchCondition = matchCondition;
+ this._choiceValue = matchCondition;
+ }
+
+ /**
+ * Method unmarshal.
+ *
+ * @param reader
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @return the unmarshaled jalview.binding.FeatureMatcherSet
+ */
+ public static jalview.binding.FeatureMatcherSet unmarshal(
+ final java.io.Reader reader)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException
+ {
+ return (jalview.binding.FeatureMatcherSet) Unmarshaller
+ .unmarshal(jalview.binding.FeatureMatcherSet.class, reader);
+ }
+
+ /**
+ *
+ *
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void validate() throws org.exolab.castor.xml.ValidationException
+ {
+ org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
+ validator.validate(this);
+ }
+
+}
--- /dev/null
+/*
+ * This class was automatically generated with
+ * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
+ * Schema.
+ * $Id$
+ */
+
+package jalview.binding;
+
+//---------------------------------/
+//- Imported classes and packages -/
+//---------------------------------/
+
+import org.exolab.castor.xml.Marshaller;
+import org.exolab.castor.xml.Unmarshaller;
+
+/**
+ * Class Filter.
+ *
+ * @version $Revision$ $Date$
+ */
+public class Filter implements java.io.Serializable
+{
+
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
+
+ /**
+ * Field _featureType.
+ */
+ private java.lang.String _featureType;
+
+ /**
+ * Field _matcherSet.
+ */
+ private jalview.binding.MatcherSet _matcherSet;
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public Filter()
+ {
+ super();
+ }
+
+ // -----------/
+ // - Methods -/
+ // -----------/
+
+ /**
+ * Returns the value of field 'featureType'.
+ *
+ * @return the value of field 'FeatureType'.
+ */
+ public java.lang.String getFeatureType()
+ {
+ return this._featureType;
+ }
+
+ /**
+ * Returns the value of field 'matcherSet'.
+ *
+ * @return the value of field 'MatcherSet'.
+ */
+ public jalview.binding.MatcherSet getMatcherSet()
+ {
+ return this._matcherSet;
+ }
+
+ /**
+ * Method isValid.
+ *
+ * @return true if this object is valid according to the schema
+ */
+ public boolean isValid()
+ {
+ try
+ {
+ validate();
+ } catch (org.exolab.castor.xml.ValidationException vex)
+ {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ *
+ *
+ * @param out
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void marshal(final java.io.Writer out)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException
+ {
+ Marshaller.marshal(this, out);
+ }
+
+ /**
+ *
+ *
+ * @param handler
+ * @throws java.io.IOException
+ * if an IOException occurs during marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ */
+ public void marshal(final org.xml.sax.ContentHandler handler)
+ throws java.io.IOException,
+ org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException
+ {
+ Marshaller.marshal(this, handler);
+ }
+
+ /**
+ * Sets the value of field 'featureType'.
+ *
+ * @param featureType
+ * the value of field 'featureType'.
+ */
+ public void setFeatureType(final java.lang.String featureType)
+ {
+ this._featureType = featureType;
+ }
+
+ /**
+ * Sets the value of field 'matcherSet'.
+ *
+ * @param matcherSet
+ * the value of field 'matcherSet'.
+ */
+ public void setMatcherSet(final jalview.binding.MatcherSet matcherSet)
+ {
+ this._matcherSet = matcherSet;
+ }
+
+ /**
+ * Method unmarshal.
+ *
+ * @param reader
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @return the unmarshaled jalview.binding.Filter
+ */
+ public static jalview.binding.Filter unmarshal(
+ final java.io.Reader reader)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException
+ {
+ return (jalview.binding.Filter) Unmarshaller
+ .unmarshal(jalview.binding.Filter.class, reader);
+ }
+
+ /**
+ *
+ *
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void validate() throws org.exolab.castor.xml.ValidationException
+ {
+ org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
+ validator.validate(this);
+ }
+
+}
*/
private java.util.Vector _colourList;
+ /**
+ * Field _filterList.
+ */
+ private java.util.Vector _filterList;
+
// ----------------/
// - Constructors -/
// ----------------/
{
super();
this._colourList = new java.util.Vector();
+ this._filterList = new java.util.Vector();
}
// -----------/
}
/**
+ *
+ *
+ * @param vFilter
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addFilter(final Filter vFilter)
+ throws java.lang.IndexOutOfBoundsException
+ {
+ this._filterList.addElement(vFilter);
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vFilter
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addFilter(final int index, final Filter vFilter)
+ throws java.lang.IndexOutOfBoundsException
+ {
+ this._filterList.add(index, vFilter);
+ }
+
+ /**
* Method enumerateColour.
*
* @return an Enumeration over all Colour elements
}
/**
+ * Method enumerateFilter.
+ *
+ * @return an Enumeration over all Filter elements
+ */
+ public java.util.Enumeration enumerateFilter()
+ {
+ return this._filterList.elements();
+ }
+
+ /**
* Method getColour.
*
* @param index
}
/**
+ * Method getFilter.
+ *
+ * @param index
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ * @return the value of the Filter at the given index
+ */
+ public Filter getFilter(final int index)
+ throws java.lang.IndexOutOfBoundsException
+ {
+ // check bounds for index
+ if (index < 0 || index >= this._filterList.size())
+ {
+ throw new IndexOutOfBoundsException(
+ "getFilter: Index value '" + index + "' not in range [0.."
+ + (this._filterList.size() - 1) + "]");
+ }
+
+ return (Filter) _filterList.get(index);
+ }
+
+ /**
+ * Method getFilter.Returns the contents of the collection in an Array.
+ * <p>
+ * 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
+ * <i>know</i> that the Array returned is of exactly the correct length.
+ *
+ * @return this collection as an Array
+ */
+ public Filter[] getFilter()
+ {
+ Filter[] array = new Filter[0];
+ return (Filter[]) this._filterList.toArray(array);
+ }
+
+ /**
+ * Method getFilterCount.
+ *
+ * @return the size of this collection
+ */
+ public int getFilterCount()
+ {
+ return this._filterList.size();
+ }
+
+ /**
* Returns the value of field 'schemeName'.
*
* @return the value of field 'SchemeName'.
}
/**
- */
+ */
public void removeAllColour()
{
this._colourList.clear();
}
/**
+ */
+ public void removeAllFilter()
+ {
+ this._filterList.clear();
+ }
+
+ /**
* Method removeColour.
*
* @param vColour
}
/**
+ * Method removeFilter.
+ *
+ * @param vFilter
+ * @return true if the object was removed from the collection.
+ */
+ public boolean removeFilter(final Filter vFilter)
+ {
+ boolean removed = _filterList.remove(vFilter);
+ return removed;
+ }
+
+ /**
+ * Method removeFilterAt.
+ *
+ * @param index
+ * @return the element removed from the collection
+ */
+ public Filter removeFilterAt(final int index)
+ {
+ java.lang.Object obj = this._filterList.remove(index);
+ return (Filter) obj;
+ }
+
+ /**
*
*
* @param index
}
/**
+ *
+ *
+ * @param index
+ * @param vFilter
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void setFilter(final int index, final Filter vFilter)
+ throws java.lang.IndexOutOfBoundsException
+ {
+ // check bounds for index
+ if (index < 0 || index >= this._filterList.size())
+ {
+ throw new IndexOutOfBoundsException(
+ "setFilter: Index value '" + index + "' not in range [0.."
+ + (this._filterList.size() - 1) + "]");
+ }
+
+ this._filterList.set(index, vFilter);
+ }
+
+ /**
+ *
+ *
+ * @param vFilterArray
+ */
+ public void setFilter(final Filter[] vFilterArray)
+ {
+ // -- copy array
+ _filterList.clear();
+
+ for (int i = 0; i < vFilterArray.length; i++)
+ {
+ this._filterList.add(vFilterArray[i]);
+ }
+ }
+
+ /**
* Sets the value of field 'schemeName'.
*
* @param schemeName
--- /dev/null
+/*
+ * This class was automatically generated with
+ * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
+ * Schema.
+ * $Id$
+ */
+
+package jalview.binding;
+
+//---------------------------------/
+//- Imported classes and packages -/
+//---------------------------------/
+
+import org.exolab.castor.xml.Marshaller;
+import org.exolab.castor.xml.Unmarshaller;
+
+/**
+ * Class MatchCondition.
+ *
+ * @version $Revision$ $Date$
+ */
+public class MatchCondition extends FeatureMatcher
+ implements java.io.Serializable
+{
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public MatchCondition()
+ {
+ super();
+ }
+
+ // -----------/
+ // - Methods -/
+ // -----------/
+
+ /**
+ * Method isValid.
+ *
+ * @return true if this object is valid according to the schema
+ */
+ public boolean isValid()
+ {
+ try
+ {
+ validate();
+ } catch (org.exolab.castor.xml.ValidationException vex)
+ {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ *
+ *
+ * @param out
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void marshal(final java.io.Writer out)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException
+ {
+ Marshaller.marshal(this, out);
+ }
+
+ /**
+ *
+ *
+ * @param handler
+ * @throws java.io.IOException
+ * if an IOException occurs during marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ */
+ public void marshal(final org.xml.sax.ContentHandler handler)
+ throws java.io.IOException,
+ org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException
+ {
+ Marshaller.marshal(this, handler);
+ }
+
+ /**
+ * Method unmarshal.
+ *
+ * @param reader
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @return the unmarshaled jalview.binding.FeatureMatcher
+ */
+ public static jalview.binding.FeatureMatcher unmarshal(
+ final java.io.Reader reader)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException
+ {
+ return (jalview.binding.FeatureMatcher) Unmarshaller
+ .unmarshal(jalview.binding.MatchCondition.class, reader);
+ }
+
+ /**
+ *
+ *
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void validate() throws org.exolab.castor.xml.ValidationException
+ {
+ org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
+ validator.validate(this);
+ }
+
+}
--- /dev/null
+/*
+ * This class was automatically generated with
+ * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
+ * Schema.
+ * $Id$
+ */
+
+package jalview.binding;
+
+//---------------------------------/
+//- Imported classes and packages -/
+//---------------------------------/
+
+import org.exolab.castor.xml.Marshaller;
+import org.exolab.castor.xml.Unmarshaller;
+
+/**
+ * Class MatcherSet.
+ *
+ * @version $Revision$ $Date$
+ */
+public class MatcherSet extends FeatureMatcherSet
+ implements java.io.Serializable
+{
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public MatcherSet()
+ {
+ super();
+ }
+
+ // -----------/
+ // - Methods -/
+ // -----------/
+
+ /**
+ * Method isValid.
+ *
+ * @return true if this object is valid according to the schema
+ */
+ public boolean isValid()
+ {
+ try
+ {
+ validate();
+ } catch (org.exolab.castor.xml.ValidationException vex)
+ {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ *
+ *
+ * @param out
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void marshal(final java.io.Writer out)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException
+ {
+ Marshaller.marshal(this, out);
+ }
+
+ /**
+ *
+ *
+ * @param handler
+ * @throws java.io.IOException
+ * if an IOException occurs during marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ */
+ public void marshal(final org.xml.sax.ContentHandler handler)
+ throws java.io.IOException,
+ org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException
+ {
+ Marshaller.marshal(this, handler);
+ }
+
+ /**
+ * Method unmarshal.
+ *
+ * @param reader
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @return the unmarshaled jalview.binding.FeatureMatcherSet
+ */
+ public static jalview.binding.FeatureMatcherSet unmarshal(
+ final java.io.Reader reader)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException
+ {
+ return (jalview.binding.FeatureMatcherSet) Unmarshaller
+ .unmarshal(jalview.binding.MatcherSet.class, reader);
+ }
+
+ /**
+ *
+ *
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void validate() throws org.exolab.castor.xml.ValidationException
+ {
+ org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
+ validator.validate(this);
+ }
+
+}
--- /dev/null
+/*
+ * This class was automatically generated with
+ * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
+ * Schema.
+ * $Id$
+ */
+
+package jalview.binding.types;
+
+ //---------------------------------/
+ //- Imported classes and packages -/
+//---------------------------------/
+
+import java.util.Hashtable;
+
+/**
+ * Class ColourNoValueColourType.
+ *
+ * @version $Revision$ $Date$
+ */
+public class ColourNoValueColourType implements java.io.Serializable {
+
+
+ //--------------------------/
+ //- Class/Member Variables -/
+ //--------------------------/
+
+ /**
+ * The None type
+ */
+ public static final int NONE_TYPE = 0;
+
+ /**
+ * The instance of the None type
+ */
+ public static final ColourNoValueColourType NONE = new ColourNoValueColourType(NONE_TYPE, "None");
+
+ /**
+ * The Min type
+ */
+ public static final int MIN_TYPE = 1;
+
+ /**
+ * The instance of the Min type
+ */
+ public static final ColourNoValueColourType MIN = new ColourNoValueColourType(MIN_TYPE, "Min");
+
+ /**
+ * The Max type
+ */
+ public static final int MAX_TYPE = 2;
+
+ /**
+ * The instance of the Max type
+ */
+ public static final ColourNoValueColourType MAX = new ColourNoValueColourType(MAX_TYPE, "Max");
+
+ /**
+ * Field _memberTable.
+ */
+ private static java.util.Hashtable _memberTable = init();
+
+ /**
+ * Field type.
+ */
+ private int type = -1;
+
+ /**
+ * Field stringValue.
+ */
+ private java.lang.String stringValue = null;
+
+
+ //----------------/
+ //- Constructors -/
+ //----------------/
+
+ private ColourNoValueColourType(final int type, final java.lang.String value) {
+ super();
+ this.type = type;
+ this.stringValue = value;
+ }
+
+
+ //-----------/
+ //- Methods -/
+ //-----------/
+
+ /**
+ * Method enumerate.Returns an enumeration of all possible
+ * instances of ColourNoValueColourType
+ *
+ * @return an Enumeration over all possible instances of
+ * ColourNoValueColourType
+ */
+ public static java.util.Enumeration enumerate(
+ ) {
+ return _memberTable.elements();
+ }
+
+ /**
+ * Method getType.Returns the type of this
+ * ColourNoValueColourType
+ *
+ * @return the type of this ColourNoValueColourType
+ */
+ public int getType(
+ ) {
+ return this.type;
+ }
+
+ /**
+ * Method init.
+ *
+ * @return the initialized Hashtable for the member table
+ */
+ private static java.util.Hashtable init(
+ ) {
+ Hashtable members = new Hashtable();
+ members.put("None", NONE);
+ members.put("Min", MIN);
+ members.put("Max", MAX);
+ return members;
+ }
+
+ /**
+ * Method readResolve. will be called during deserialization to
+ * replace the deserialized object with the correct constant
+ * instance.
+ *
+ * @return this deserialized object
+ */
+ private java.lang.Object readResolve(
+ ) {
+ return valueOf(this.stringValue);
+ }
+
+ /**
+ * Method toString.Returns the String representation of this
+ * ColourNoValueColourType
+ *
+ * @return the String representation of this
+ * ColourNoValueColourType
+ */
+ public java.lang.String toString(
+ ) {
+ return this.stringValue;
+ }
+
+ /**
+ * Method valueOf.Returns a new ColourNoValueColourType based
+ * on the given String value.
+ *
+ * @param string
+ * @return the ColourNoValueColourType value of parameter
+ * 'string'
+ */
+ public static jalview.binding.types.ColourNoValueColourType valueOf(
+ final java.lang.String string) {
+ java.lang.Object obj = null;
+ if (string != null) {
+ obj = _memberTable.get(string);
+ }
+ if (obj == null) {
+ String err = "" + string + " is not a valid ColourNoValueColourType";
+ throw new IllegalArgumentException(err);
+ }
+ return (ColourNoValueColourType) obj;
+ }
+
+}
--- /dev/null
+/*
+ * This class was automatically generated with
+ * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
+ * Schema.
+ * $Id$
+ */
+
+package jalview.binding.types;
+
+ //---------------------------------/
+ //- Imported classes and packages -/
+//---------------------------------/
+
+import java.util.Hashtable;
+
+/**
+ * Class ColourThreshTypeType.
+ *
+ * @version $Revision$ $Date$
+ */
+public class ColourThreshTypeType implements java.io.Serializable {
+
+
+ //--------------------------/
+ //- Class/Member Variables -/
+ //--------------------------/
+
+ /**
+ * The NONE type
+ */
+ public static final int NONE_TYPE = 0;
+
+ /**
+ * The instance of the NONE type
+ */
+ public static final ColourThreshTypeType NONE = new ColourThreshTypeType(NONE_TYPE, "NONE");
+
+ /**
+ * The ABOVE type
+ */
+ public static final int ABOVE_TYPE = 1;
+
+ /**
+ * The instance of the ABOVE type
+ */
+ public static final ColourThreshTypeType ABOVE = new ColourThreshTypeType(ABOVE_TYPE, "ABOVE");
+
+ /**
+ * The BELOW type
+ */
+ public static final int BELOW_TYPE = 2;
+
+ /**
+ * The instance of the BELOW type
+ */
+ public static final ColourThreshTypeType BELOW = new ColourThreshTypeType(BELOW_TYPE, "BELOW");
+
+ /**
+ * Field _memberTable.
+ */
+ private static java.util.Hashtable _memberTable = init();
+
+ /**
+ * Field type.
+ */
+ private int type = -1;
+
+ /**
+ * Field stringValue.
+ */
+ private java.lang.String stringValue = null;
+
+
+ //----------------/
+ //- Constructors -/
+ //----------------/
+
+ private ColourThreshTypeType(final int type, final java.lang.String value) {
+ super();
+ this.type = type;
+ this.stringValue = value;
+ }
+
+
+ //-----------/
+ //- Methods -/
+ //-----------/
+
+ /**
+ * Method enumerate.Returns an enumeration of all possible
+ * instances of ColourThreshTypeType
+ *
+ * @return an Enumeration over all possible instances of
+ * ColourThreshTypeType
+ */
+ public static java.util.Enumeration enumerate(
+ ) {
+ return _memberTable.elements();
+ }
+
+ /**
+ * Method getType.Returns the type of this ColourThreshTypeType
+ *
+ * @return the type of this ColourThreshTypeType
+ */
+ public int getType(
+ ) {
+ return this.type;
+ }
+
+ /**
+ * Method init.
+ *
+ * @return the initialized Hashtable for the member table
+ */
+ private static java.util.Hashtable init(
+ ) {
+ Hashtable members = new Hashtable();
+ members.put("NONE", NONE);
+ members.put("ABOVE", ABOVE);
+ members.put("BELOW", BELOW);
+ return members;
+ }
+
+ /**
+ * Method readResolve. will be called during deserialization to
+ * replace the deserialized object with the correct constant
+ * instance.
+ *
+ * @return this deserialized object
+ */
+ private java.lang.Object readResolve(
+ ) {
+ return valueOf(this.stringValue);
+ }
+
+ /**
+ * Method toString.Returns the String representation of this
+ * ColourThreshTypeType
+ *
+ * @return the String representation of this ColourThreshTypeTyp
+ */
+ public java.lang.String toString(
+ ) {
+ return this.stringValue;
+ }
+
+ /**
+ * Method valueOf.Returns a new ColourThreshTypeType based on
+ * the given String value.
+ *
+ * @param string
+ * @return the ColourThreshTypeType value of parameter 'string'
+ */
+ public static jalview.binding.types.ColourThreshTypeType valueOf(
+ final java.lang.String string) {
+ java.lang.Object obj = null;
+ if (string != null) {
+ obj = _memberTable.get(string);
+ }
+ if (obj == null) {
+ String err = "" + string + " is not a valid ColourThreshTypeType";
+ throw new IllegalArgumentException(err);
+ }
+ return (ColourThreshTypeType) obj;
+ }
+
+}
--- /dev/null
+/*
+ * This class was automatically generated with
+ * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
+ * Schema.
+ * $Id$
+ */
+
+package jalview.binding.types;
+
+ //---------------------------------/
+ //- Imported classes and packages -/
+//---------------------------------/
+
+import java.util.Hashtable;
+
+/**
+ * Class FeatureMatcherByType.
+ *
+ * @version $Revision$ $Date$
+ */
+public class FeatureMatcherByType implements java.io.Serializable {
+
+
+ //--------------------------/
+ //- Class/Member Variables -/
+ //--------------------------/
+
+ /**
+ * The byLabel type
+ */
+ public static final int BYLABEL_TYPE = 0;
+
+ /**
+ * The instance of the byLabel type
+ */
+ public static final FeatureMatcherByType BYLABEL = new FeatureMatcherByType(BYLABEL_TYPE, "byLabel");
+
+ /**
+ * The byScore type
+ */
+ public static final int BYSCORE_TYPE = 1;
+
+ /**
+ * The instance of the byScore type
+ */
+ public static final FeatureMatcherByType BYSCORE = new FeatureMatcherByType(BYSCORE_TYPE, "byScore");
+
+ /**
+ * The byAttribute type
+ */
+ public static final int BYATTRIBUTE_TYPE = 2;
+
+ /**
+ * The instance of the byAttribute type
+ */
+ public static final FeatureMatcherByType BYATTRIBUTE = new FeatureMatcherByType(BYATTRIBUTE_TYPE, "byAttribute");
+
+ /**
+ * Field _memberTable.
+ */
+ private static java.util.Hashtable _memberTable = init();
+
+ /**
+ * Field type.
+ */
+ private int type = -1;
+
+ /**
+ * Field stringValue.
+ */
+ private java.lang.String stringValue = null;
+
+
+ //----------------/
+ //- Constructors -/
+ //----------------/
+
+ private FeatureMatcherByType(final int type, final java.lang.String value) {
+ super();
+ this.type = type;
+ this.stringValue = value;
+ }
+
+
+ //-----------/
+ //- Methods -/
+ //-----------/
+
+ /**
+ * Method enumerate.Returns an enumeration of all possible
+ * instances of FeatureMatcherByType
+ *
+ * @return an Enumeration over all possible instances of
+ * FeatureMatcherByType
+ */
+ public static java.util.Enumeration enumerate(
+ ) {
+ return _memberTable.elements();
+ }
+
+ /**
+ * Method getType.Returns the type of this FeatureMatcherByType
+ *
+ * @return the type of this FeatureMatcherByType
+ */
+ public int getType(
+ ) {
+ return this.type;
+ }
+
+ /**
+ * Method init.
+ *
+ * @return the initialized Hashtable for the member table
+ */
+ private static java.util.Hashtable init(
+ ) {
+ Hashtable members = new Hashtable();
+ members.put("byLabel", BYLABEL);
+ members.put("byScore", BYSCORE);
+ members.put("byAttribute", BYATTRIBUTE);
+ return members;
+ }
+
+ /**
+ * Method readResolve. will be called during deserialization to
+ * replace the deserialized object with the correct constant
+ * instance.
+ *
+ * @return this deserialized object
+ */
+ private java.lang.Object readResolve(
+ ) {
+ return valueOf(this.stringValue);
+ }
+
+ /**
+ * Method toString.Returns the String representation of this
+ * FeatureMatcherByType
+ *
+ * @return the String representation of this FeatureMatcherByTyp
+ */
+ public java.lang.String toString(
+ ) {
+ return this.stringValue;
+ }
+
+ /**
+ * Method valueOf.Returns a new FeatureMatcherByType based on
+ * the given String value.
+ *
+ * @param string
+ * @return the FeatureMatcherByType value of parameter 'string'
+ */
+ public static jalview.binding.types.FeatureMatcherByType valueOf(
+ final java.lang.String string) {
+ java.lang.Object obj = null;
+ if (string != null) {
+ obj = _memberTable.get(string);
+ }
+ if (obj == null) {
+ String err = "" + string + " is not a valid FeatureMatcherByType";
+ throw new IllegalArgumentException(err);
+ }
+ return (FeatureMatcherByType) obj;
+ }
+
+}
import jalview.bin.Cache;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.SequenceI;
+import jalview.datamodel.features.FeatureMatcher;
+import jalview.datamodel.features.FeatureMatcherI;
import jalview.datamodel.features.FeatureMatcherSet;
import jalview.datamodel.features.FeatureMatcherSetI;
import jalview.gui.Help.HelpId;
import jalview.io.JalviewFileChooser;
import jalview.io.JalviewFileView;
+import jalview.schemabinding.version2.CompoundMatcher;
+import jalview.schemabinding.version2.Filter;
import jalview.schemabinding.version2.JalviewUserColours;
+import jalview.schemabinding.version2.MatchCondition;
+import jalview.schemabinding.version2.MatcherSet;
+import jalview.schemabinding.version2.types.ColourNoValueColourType;
+import jalview.schemabinding.version2.types.ColourThreshTypeType;
+import jalview.schemabinding.version2.types.FeatureMatcherByType;
import jalview.schemes.FeatureColour;
import jalview.util.Format;
import jalview.util.MessageManager;
import jalview.util.Platform;
-import jalview.util.QuickSort;
+import jalview.util.matcher.Condition;
import jalview.viewmodel.AlignmentViewport;
import jalview.viewmodel.seqfeatures.FeatureRendererModel.FeatureSettingsBean;
import jalview.ws.DasSequenceFeatureFetcher;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.Arrays;
+import java.util.Collections;
+import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Hashtable;
Map<String, float[]> typeWidth = null;
/**
+ * Populates an XML model of the feature colour scheme for one feature type
+ *
+ * @param featureType
+ * @param fcol
+ * @return
+ */
+ protected static jalview.schemabinding.version2.Colour marshalColour(
+ String featureType, FeatureColourI fcol)
+ {
+ jalview.schemabinding.version2.Colour col = new jalview.schemabinding.version2.Colour();
+ if (fcol.isSimpleColour())
+ {
+ col.setRGB(Format.getHexString(fcol.getColour()));
+ }
+ else
+ {
+ col.setRGB(Format.getHexString(fcol.getMaxColour()));
+ col.setMin(fcol.getMin());
+ col.setMax(fcol.getMax());
+ col.setMinRGB(jalview.util.Format.getHexString(fcol.getMinColour()));
+ col.setAutoScale(fcol.isAutoScaled());
+ col.setThreshold(fcol.getThreshold());
+ col.setColourByLabel(fcol.isColourByLabel());
+ col.setThreshType(fcol.isAboveThreshold() ? ColourThreshTypeType.ABOVE
+ : (fcol.isBelowThreshold() ? ColourThreshTypeType.BELOW
+ : ColourThreshTypeType.NONE));
+ if (fcol.isColourByAttribute())
+ {
+ col.setAttributeName(fcol.getAttributeName());
+ }
+ Color noColour = fcol.getNoColour();
+ if (noColour == null)
+ {
+ col.setNoValueColour(ColourNoValueColourType.NONE);
+ }
+ else if (noColour == fcol.getMaxColour())
+ {
+ col.setNoValueColour(ColourNoValueColourType.MAX);
+ }
+ else
+ {
+ col.setNoValueColour(ColourNoValueColourType.MIN);
+ }
+ }
+ col.setName(featureType);
+ return col;
+ }
+
+ /**
+ * Populates an XML model of the feature filter(s) for one feature type
+ *
+ * @param firstMatcher
+ * the first (or only) match condition)
+ * @param filter
+ * remaining match conditions (if any)
+ * @param and
+ * if true, conditions are and-ed, else or-ed
+ */
+ protected static MatcherSet marshalFilter(FeatureMatcherI firstMatcher,
+ Iterator<FeatureMatcherI> filters, boolean and)
+ {
+ MatcherSet result = new MatcherSet();
+
+ if (filters.hasNext())
+ {
+ /*
+ * compound matcher
+ */
+ CompoundMatcher compound = new CompoundMatcher();
+ compound.setAnd(and);
+ MatcherSet matcher1 = marshalFilter(firstMatcher,
+ Collections.emptyIterator(), and);
+ compound.addMatcherSet(matcher1);
+ FeatureMatcherI nextMatcher = filters.next();
+ MatcherSet matcher2 = marshalFilter(nextMatcher, filters, and);
+ compound.addMatcherSet(matcher2);
+ result.setCompoundMatcher(compound);
+ }
+ else
+ {
+ /*
+ * single condition matcher
+ */
+ MatchCondition matcherModel = new MatchCondition();
+ matcherModel.setCondition(
+ firstMatcher.getMatcher().getCondition().getStableName());
+ matcherModel.setValue(firstMatcher.getMatcher().getPattern());
+ if (firstMatcher.isByAttribute())
+ {
+ matcherModel.setBy(FeatureMatcherByType.BYATTRIBUTE);
+ matcherModel.setAttributeName(firstMatcher.getAttribute());
+ }
+ else if (firstMatcher.isByLabel())
+ {
+ matcherModel.setBy(FeatureMatcherByType.BYLABEL);
+ }
+ else if (firstMatcher.isByScore())
+ {
+ matcherModel.setBy(FeatureMatcherByType.BYSCORE);
+ }
+ result.setMatchCondition(matcherModel);
+ }
+
+ return result;
+ }
+
+ /**
+ * Loads one XML model of a feature filter to a Jalview object
+ *
+ * @param colourModel
+ * @return
+ */
+ protected static FeatureMatcherSetI unmarshalFilter(Filter filterModel)
+ {
+ FeatureMatcherSetI result = new FeatureMatcherSet();
+ MatcherSet matcherSetModel = filterModel.getMatcherSet();
+ try
+ {
+ unmarshalFilterConditions(result, matcherSetModel, true);
+ } catch (IllegalStateException e)
+ {
+ // mixing AND and OR conditions perhaps
+ System.err.println(
+ String.format("Error reading filter conditions for '%s': %s",
+ filterModel.getFeatureType(), e.getMessage()));
+ // return as much as was parsed up to the error
+ }
+
+ return result;
+ }
+
+ /**
+ * Adds feature match conditions to matcherSet as unmarshalled from XML
+ * (possibly recursively for compound conditions)
+ *
+ * @param matcherSet
+ * @param matcherSetModel
+ * @param and
+ * if true, multiple conditions are AND-ed, else they are OR-ed
+ * @throws IllegalStateException
+ * if AND and OR conditions are mixed
+ */
+ protected static void unmarshalFilterConditions(
+ FeatureMatcherSetI matcherSet, MatcherSet matcherSetModel,
+ boolean and)
+ {
+ MatchCondition mc = matcherSetModel.getMatchCondition();
+ if (mc != null)
+ {
+ /*
+ * single condition
+ */
+ FeatureMatcherByType filterBy = mc.getBy();
+ Condition cond = Condition.fromString(mc.getCondition());
+ String pattern = mc.getValue();
+ FeatureMatcherI matchCondition = null;
+ if (filterBy == FeatureMatcherByType.BYLABEL)
+ {
+ matchCondition = FeatureMatcher.byLabel(cond, pattern);
+ }
+ else if (filterBy == FeatureMatcherByType.BYSCORE)
+ {
+ matchCondition = FeatureMatcher.byScore(cond, pattern);
+
+ }
+ else if (filterBy == FeatureMatcherByType.BYATTRIBUTE)
+ {
+ String[] attNames = mc.getAttributeName();
+ matchCondition = FeatureMatcher.byAttribute(cond, pattern,
+ attNames);
+ }
+
+ /*
+ * note this throws IllegalStateException if AND-ing to a
+ * previously OR-ed compound condition, or vice versa
+ */
+ if (and)
+ {
+ matcherSet.and(matchCondition);
+ }
+ else
+ {
+ matcherSet.or(matchCondition);
+ }
+ }
+ else
+ {
+ /*
+ * compound condition
+ */
+ MatcherSet[] matchers = matcherSetModel.getCompoundMatcher()
+ .getMatcherSet();
+ boolean anded = matcherSetModel.getCompoundMatcher().getAnd();
+ if (matchers.length == 2)
+ {
+ unmarshalFilterConditions(matcherSet, matchers[0], anded);
+ unmarshalFilterConditions(matcherSet, matchers[1], anded);
+ }
+ else
+ {
+ System.err.println("Malformed compound filter condition");
+ }
+ }
+ }
+
+ /**
+ * Loads one XML model of a feature colour to a Jalview object
+ *
+ * @param colourModel
+ * @return
+ */
+ protected static FeatureColourI unmarshalColour(
+ jalview.schemabinding.version2.Colour colourModel)
+ {
+ FeatureColourI colour = null;
+
+ if (colourModel.hasMax())
+ {
+ Color mincol = null;
+ Color maxcol = null;
+ Color noValueColour = null;
+
+ try
+ {
+ mincol = new Color(Integer.parseInt(colourModel.getMinRGB(), 16));
+ maxcol = new Color(Integer.parseInt(colourModel.getRGB(), 16));
+ } catch (Exception e)
+ {
+ Cache.log.warn("Couldn't parse out graduated feature color.", e);
+ }
+
+ ColourNoValueColourType noCol = colourModel.getNoValueColour();
+ if (noCol == ColourNoValueColourType.MIN)
+ {
+ noValueColour = mincol;
+ }
+ else if (noCol == ColourNoValueColourType.MAX)
+ {
+ noValueColour = maxcol;
+ }
+
+ colour = new FeatureColour(mincol, maxcol, noValueColour,
+ colourModel.getMin(),
+ colourModel.getMax());
+ String[] attributes = colourModel.getAttributeName();
+ if (attributes != null && attributes.length > 0)
+ {
+ colour.setAttributeName(attributes);
+ }
+ if (colourModel.hasAutoScale())
+ {
+ colour.setAutoScaled(colourModel.getAutoScale());
+ }
+ if (colourModel.hasColourByLabel())
+ {
+ colour.setColourByLabel(colourModel.getColourByLabel());
+ }
+ if (colourModel.hasThreshold())
+ {
+ colour.setThreshold(colourModel.getThreshold());
+ }
+ ColourThreshTypeType ttyp = colourModel.getThreshType();
+ if (ttyp != null)
+ {
+ if (ttyp == ColourThreshTypeType.ABOVE)
+ {
+ colour.setAboveThreshold(true);
+ }
+ else if (ttyp == ColourThreshTypeType.BELOW)
+ {
+ colour.setBelowThreshold(true);
+ }
+ }
+ }
+ else
+ {
+ Color color = new Color(Integer.parseInt(colourModel.getRGB(), 16));
+ colour = new FeatureColour(color);
+ }
+
+ return colour;
+ }
+
+ /**
* Constructor
*
* @param af
}
}
+ /**
+ * Offers a file chooser dialog, and then loads the feature colours and
+ * filters from file in XML format and unmarshals to Jalview feature settings
+ */
void load()
{
JalviewFileChooser chooser = new JalviewFileChooser("fc",
JalviewUserColours jucs = JalviewUserColours.unmarshal(in);
+ /*
+ * load feature colours
+ */
for (int i = jucs.getColourCount() - 1; i >= 0; i--)
{
- String name;
jalview.schemabinding.version2.Colour newcol = jucs.getColour(i);
- if (newcol.hasMax())
- {
- Color mincol = null, maxcol = null;
- try
- {
- mincol = new Color(Integer.parseInt(newcol.getMinRGB(), 16));
- maxcol = new Color(Integer.parseInt(newcol.getRGB(), 16));
+ FeatureColourI colour = unmarshalColour(newcol);
+ fr.setColour(newcol.getName(), colour);
+ fr.setOrder(newcol.getName(), i / (float) jucs.getColourCount());
+ }
- } catch (Exception e)
- {
- Cache.log.warn("Couldn't parse out graduated feature color.",
- e);
- }
- FeatureColourI gcol = new FeatureColour(mincol, maxcol,
- newcol.getMin(), newcol.getMax());
- if (newcol.hasAutoScale())
- {
- gcol.setAutoScaled(newcol.getAutoScale());
- }
- if (newcol.hasColourByLabel())
- {
- gcol.setColourByLabel(newcol.getColourByLabel());
- }
- if (newcol.hasThreshold())
- {
- gcol.setThreshold(newcol.getThreshold());
- }
- if (newcol.getThreshType().length() > 0)
- {
- String ttyp = newcol.getThreshType();
- if (ttyp.equalsIgnoreCase("ABOVE"))
- {
- gcol.setAboveThreshold(true);
- }
- if (ttyp.equalsIgnoreCase("BELOW"))
- {
- gcol.setBelowThreshold(true);
- }
- }
- fr.setColour(name = newcol.getName(), gcol);
- }
- else
+ /*
+ * load feature filters; loaded filters will replace any that are
+ * currently defined, other defined filters are left unchanged
+ */
+ for (int i = 0; i < jucs.getFilterCount(); i++)
+ {
+ jalview.schemabinding.version2.Filter filterModel = jucs
+ .getFilter(i);
+ FeatureMatcherSetI filter = unmarshalFilter(filterModel);
+ if (!filter.isEmpty())
{
- Color color = new Color(
- Integer.parseInt(jucs.getColour(i).getRGB(), 16));
- fr.setColour(name = jucs.getColour(i).getName(),
- new FeatureColour(color));
+ fr.setFeatureFilter(filterModel.getFeatureType(), filter);
}
- fr.setOrder(name, (i == 0) ? 0 : i / jucs.getColourCount());
}
+
+ /*
+ * update feature settings table
+ */
if (table != null)
{
resetTable(null);
}
}
+ /**
+ * Offers a file chooser dialog, and then saves the current feature colours
+ * and any filters to the selected file in XML format
+ */
void save()
{
JalviewFileChooser chooser = new JalviewFileChooser("fc",
if (value == JalviewFileChooser.APPROVE_OPTION)
{
String choice = chooser.getSelectedFile().getPath();
- jalview.schemabinding.version2.JalviewUserColours ucs = new jalview.schemabinding.version2.JalviewUserColours();
+ JalviewUserColours ucs = new JalviewUserColours();
ucs.setSchemeName("Sequence Features");
try
{
PrintWriter out = new PrintWriter(new OutputStreamWriter(
new FileOutputStream(choice), "UTF-8"));
+ /*
+ * sort feature types by colour order, from 0 (highest)
+ * to 1 (lowest)
+ */
Set<String> fr_colours = fr.getAllFeatureColours();
- Iterator<String> e = fr_colours.iterator();
- float[] sortOrder = new float[fr_colours.size()];
- String[] sortTypes = new String[fr_colours.size()];
- int i = 0;
- while (e.hasNext())
+ String[] sortedTypes = fr_colours
+ .toArray(new String[fr_colours.size()]);
+ Arrays.sort(sortedTypes, new Comparator<String>()
{
- sortTypes[i] = e.next();
- sortOrder[i] = fr.getOrder(sortTypes[i]);
- i++;
- }
- QuickSort.sort(sortOrder, sortTypes);
- sortOrder = null;
- for (i = 0; i < sortTypes.length; i++)
- {
- jalview.schemabinding.version2.Colour col = new jalview.schemabinding.version2.Colour();
- col.setName(sortTypes[i]);
- FeatureColourI fcol = fr.getFeatureStyle(sortTypes[i]);
- if (fcol.isSimpleColour())
+ @Override
+ public int compare(String type1, String type2)
{
- col.setRGB(Format.getHexString(fcol.getColour()));
+ return Float.compare(fr.getOrder(type1), fr.getOrder(type2));
}
- else
+ });
+
+ /*
+ * save feature colours
+ */
+ for (String featureType : sortedTypes)
+ {
+ FeatureColourI fcol = fr.getFeatureStyle(featureType);
+ jalview.schemabinding.version2.Colour col = marshalColour(
+ featureType, fcol);
+ ucs.addColour(col);
+ }
+
+ /*
+ * save any feature filters
+ */
+ for (String featureType : sortedTypes)
+ {
+ FeatureMatcherSetI filter = fr.getFeatureFilter(featureType);
+ if (filter != null && !filter.isEmpty())
{
- col.setRGB(Format.getHexString(fcol.getMaxColour()));
- col.setMin(fcol.getMin());
- col.setMax(fcol.getMax());
- col.setMinRGB(
- jalview.util.Format.getHexString(fcol.getMinColour()));
- col.setAutoScale(fcol.isAutoScaled());
- col.setThreshold(fcol.getThreshold());
- col.setColourByLabel(fcol.isColourByLabel());
- col.setThreshType(fcol.isAboveThreshold() ? "ABOVE"
- : (fcol.isBelowThreshold() ? "BELOW" : "NONE"));
+ Iterator<FeatureMatcherI> iterator = filter.getMatchers().iterator();
+ FeatureMatcherI firstMatcher = iterator.next();
+ MatcherSet ms = marshalFilter(firstMatcher, iterator,
+ filter.isAnded());
+ Filter filterModel = new Filter();
+ filterModel.setFeatureType(featureType);
+ filterModel.setMatcherSet(ms);
+ ucs.addFilter(filterModel);
}
- ucs.addColour(col);
}
+
ucs.marshal(out);
out.close();
} catch (Exception ex)
--- /dev/null
+/*
+ * This class was automatically generated with
+ * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
+ * Schema.
+ * $Id$
+ */
+
+package jalview.schemabinding.version2;
+
+//---------------------------------/
+//- Imported classes and packages -/
+//---------------------------------/
+
+import org.exolab.castor.xml.Marshaller;
+import org.exolab.castor.xml.Unmarshaller;
+
+/**
+ * Class CompoundMatcher.
+ *
+ * @version $Revision$ $Date$
+ */
+public class CompoundMatcher implements java.io.Serializable
+{
+
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
+
+ /**
+ * If true, matchers are AND-ed, if false they are OR-ed
+ */
+ private boolean _and;
+
+ /**
+ * keeps track of state for field: _and
+ */
+ private boolean _has_and;
+
+ /**
+ * Field _matcherSetList.
+ */
+ private java.util.Vector _matcherSetList;
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public CompoundMatcher()
+ {
+ super();
+ this._matcherSetList = new java.util.Vector();
+ }
+
+ // -----------/
+ // - Methods -/
+ // -----------/
+
+ /**
+ *
+ *
+ * @param vMatcherSet
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addMatcherSet(
+ final jalview.schemabinding.version2.MatcherSet vMatcherSet)
+ throws java.lang.IndexOutOfBoundsException
+ {
+ // check for the maximum size
+ if (this._matcherSetList.size() >= 2)
+ {
+ throw new IndexOutOfBoundsException(
+ "addMatcherSet has a maximum of 2");
+ }
+
+ this._matcherSetList.addElement(vMatcherSet);
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vMatcherSet
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addMatcherSet(final int index,
+ final jalview.schemabinding.version2.MatcherSet vMatcherSet)
+ throws java.lang.IndexOutOfBoundsException
+ {
+ // check for the maximum size
+ if (this._matcherSetList.size() >= 2)
+ {
+ throw new IndexOutOfBoundsException(
+ "addMatcherSet has a maximum of 2");
+ }
+
+ this._matcherSetList.add(index, vMatcherSet);
+ }
+
+ /**
+ */
+ public void deleteAnd()
+ {
+ this._has_and = false;
+ }
+
+ /**
+ * Method enumerateMatcherSet.
+ *
+ * @return an Enumeration over all jalview.schemabinding.version2.MatcherSet
+ * elements
+ */
+ public java.util.Enumeration enumerateMatcherSet()
+ {
+ return this._matcherSetList.elements();
+ }
+
+ /**
+ * Returns the value of field 'and'. The field 'and' has the following
+ * description: If true, matchers are AND-ed, if false they are OR-ed
+ *
+ * @return the value of field 'And'.
+ */
+ public boolean getAnd()
+ {
+ return this._and;
+ }
+
+ /**
+ * Method getMatcherSet.
+ *
+ * @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.MatcherSet at the
+ * given index
+ */
+ public jalview.schemabinding.version2.MatcherSet getMatcherSet(
+ final int index) throws java.lang.IndexOutOfBoundsException
+ {
+ // check bounds for index
+ if (index < 0 || index >= this._matcherSetList.size())
+ {
+ throw new IndexOutOfBoundsException(
+ "getMatcherSet: Index value '" + index + "' not in range [0.."
+ + (this._matcherSetList.size() - 1) + "]");
+ }
+
+ return (jalview.schemabinding.version2.MatcherSet) _matcherSetList
+ .get(index);
+ }
+
+ /**
+ * Method getMatcherSet.Returns the contents of the collection in an Array.
+ * <p>
+ * 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
+ * <i>know</i> that the Array returned is of exactly the correct length.
+ *
+ * @return this collection as an Array
+ */
+ public jalview.schemabinding.version2.MatcherSet[] getMatcherSet()
+ {
+ jalview.schemabinding.version2.MatcherSet[] array = new jalview.schemabinding.version2.MatcherSet[0];
+ return (jalview.schemabinding.version2.MatcherSet[]) this._matcherSetList
+ .toArray(array);
+ }
+
+ /**
+ * Method getMatcherSetCount.
+ *
+ * @return the size of this collection
+ */
+ public int getMatcherSetCount()
+ {
+ return this._matcherSetList.size();
+ }
+
+ /**
+ * Method hasAnd.
+ *
+ * @return true if at least one And has been added
+ */
+ public boolean hasAnd()
+ {
+ return this._has_and;
+ }
+
+ /**
+ * Returns the value of field 'and'. The field 'and' has the following
+ * description: If true, matchers are AND-ed, if false they are OR-ed
+ *
+ * @return the value of field 'And'.
+ */
+ public boolean isAnd()
+ {
+ return this._and;
+ }
+
+ /**
+ * Method isValid.
+ *
+ * @return true if this object is valid according to the schema
+ */
+ public boolean isValid()
+ {
+ try
+ {
+ validate();
+ } catch (org.exolab.castor.xml.ValidationException vex)
+ {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ *
+ *
+ * @param out
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void marshal(final java.io.Writer out)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException
+ {
+ Marshaller.marshal(this, out);
+ }
+
+ /**
+ *
+ *
+ * @param handler
+ * @throws java.io.IOException
+ * if an IOException occurs during marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ */
+ public void marshal(final org.xml.sax.ContentHandler handler)
+ throws java.io.IOException,
+ org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException
+ {
+ Marshaller.marshal(this, handler);
+ }
+
+ /**
+ */
+ public void removeAllMatcherSet()
+ {
+ this._matcherSetList.clear();
+ }
+
+ /**
+ * Method removeMatcherSet.
+ *
+ * @param vMatcherSet
+ * @return true if the object was removed from the collection.
+ */
+ public boolean removeMatcherSet(
+ final jalview.schemabinding.version2.MatcherSet vMatcherSet)
+ {
+ boolean removed = _matcherSetList.remove(vMatcherSet);
+ return removed;
+ }
+
+ /**
+ * Method removeMatcherSetAt.
+ *
+ * @param index
+ * @return the element removed from the collection
+ */
+ public jalview.schemabinding.version2.MatcherSet removeMatcherSetAt(
+ final int index)
+ {
+ java.lang.Object obj = this._matcherSetList.remove(index);
+ return (jalview.schemabinding.version2.MatcherSet) obj;
+ }
+
+ /**
+ * Sets the value of field 'and'. The field 'and' has the following
+ * description: If true, matchers are AND-ed, if false they are OR-ed
+ *
+ * @param and
+ * the value of field 'and'.
+ */
+ public void setAnd(final boolean and)
+ {
+ this._and = and;
+ this._has_and = true;
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vMatcherSet
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void setMatcherSet(final int index,
+ final jalview.schemabinding.version2.MatcherSet vMatcherSet)
+ throws java.lang.IndexOutOfBoundsException
+ {
+ // check bounds for index
+ if (index < 0 || index >= this._matcherSetList.size())
+ {
+ throw new IndexOutOfBoundsException(
+ "setMatcherSet: Index value '" + index + "' not in range [0.."
+ + (this._matcherSetList.size() - 1) + "]");
+ }
+
+ this._matcherSetList.set(index, vMatcherSet);
+ }
+
+ /**
+ *
+ *
+ * @param vMatcherSetArray
+ */
+ public void setMatcherSet(
+ final jalview.schemabinding.version2.MatcherSet[] vMatcherSetArray)
+ {
+ // -- copy array
+ _matcherSetList.clear();
+
+ for (int i = 0; i < vMatcherSetArray.length; i++)
+ {
+ this._matcherSetList.add(vMatcherSetArray[i]);
+ }
+ }
+
+ /**
+ * Method unmarshal.
+ *
+ * @param reader
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @return the unmarshaled jalview.schemabinding.version2.CompoundMatcher
+ */
+ public static jalview.schemabinding.version2.CompoundMatcher unmarshal(
+ final java.io.Reader reader)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException
+ {
+ return (jalview.schemabinding.version2.CompoundMatcher) Unmarshaller
+ .unmarshal(jalview.schemabinding.version2.CompoundMatcher.class,
+ reader);
+ }
+
+ /**
+ *
+ *
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void validate() throws org.exolab.castor.xml.ValidationException
+ {
+ org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
+ validator.validate(this);
+ }
+
+}
--- /dev/null
+/*
+ * This class was automatically generated with
+ * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
+ * Schema.
+ * $Id$
+ */
+
+package jalview.schemabinding.version2;
+
+//---------------------------------/
+//- Imported classes and packages -/
+//---------------------------------/
+
+import org.exolab.castor.xml.Marshaller;
+import org.exolab.castor.xml.Unmarshaller;
+
+/**
+ * Class FeatureMatcher.
+ *
+ * @version $Revision$ $Date$
+ */
+public class FeatureMatcher implements java.io.Serializable
+{
+
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
+
+ /**
+ * Field _by.
+ */
+ private jalview.schemabinding.version2.types.FeatureMatcherByType _by;
+
+ /**
+ * name of feature attribute to filter on, or attribute and sub-attribute
+ */
+ private java.util.Vector _attributeNameList;
+
+ /**
+ * Field _condition.
+ */
+ private java.lang.String _condition;
+
+ /**
+ * Field _value.
+ */
+ private java.lang.String _value;
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public FeatureMatcher()
+ {
+ super();
+ this._attributeNameList = new java.util.Vector();
+ }
+
+ // -----------/
+ // - Methods -/
+ // -----------/
+
+ /**
+ *
+ *
+ * @param vAttributeName
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addAttributeName(final java.lang.String vAttributeName)
+ throws java.lang.IndexOutOfBoundsException
+ {
+ // check for the maximum size
+ if (this._attributeNameList.size() >= 2)
+ {
+ throw new IndexOutOfBoundsException(
+ "addAttributeName has a maximum of 2");
+ }
+
+ this._attributeNameList.addElement(vAttributeName);
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vAttributeName
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addAttributeName(final int index,
+ final java.lang.String vAttributeName)
+ throws java.lang.IndexOutOfBoundsException
+ {
+ // check for the maximum size
+ if (this._attributeNameList.size() >= 2)
+ {
+ throw new IndexOutOfBoundsException(
+ "addAttributeName has a maximum of 2");
+ }
+
+ this._attributeNameList.add(index, vAttributeName);
+ }
+
+ /**
+ * Method enumerateAttributeName.
+ *
+ * @return an Enumeration over all java.lang.String elements
+ */
+ public java.util.Enumeration enumerateAttributeName()
+ {
+ return this._attributeNameList.elements();
+ }
+
+ /**
+ * Method getAttributeName.
+ *
+ * @param index
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ * @return the value of the java.lang.String at the given index
+ */
+ public java.lang.String getAttributeName(final int index)
+ throws java.lang.IndexOutOfBoundsException
+ {
+ // check bounds for index
+ if (index < 0 || index >= this._attributeNameList.size())
+ {
+ throw new IndexOutOfBoundsException("getAttributeName: Index value '"
+ + index + "' not in range [0.."
+ + (this._attributeNameList.size() - 1) + "]");
+ }
+
+ return (java.lang.String) _attributeNameList.get(index);
+ }
+
+ /**
+ * Method getAttributeName.Returns the contents of the collection in an Array.
+ * <p>
+ * 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
+ * <i>know</i> that the Array returned is of exactly the correct length.
+ *
+ * @return this collection as an Array
+ */
+ public java.lang.String[] getAttributeName()
+ {
+ java.lang.String[] array = new java.lang.String[0];
+ return (java.lang.String[]) this._attributeNameList.toArray(array);
+ }
+
+ /**
+ * Method getAttributeNameCount.
+ *
+ * @return the size of this collection
+ */
+ public int getAttributeNameCount()
+ {
+ return this._attributeNameList.size();
+ }
+
+ /**
+ * Returns the value of field 'by'.
+ *
+ * @return the value of field 'By'.
+ */
+ public jalview.schemabinding.version2.types.FeatureMatcherByType getBy()
+ {
+ return this._by;
+ }
+
+ /**
+ * Returns the value of field 'condition'.
+ *
+ * @return the value of field 'Condition'.
+ */
+ public java.lang.String getCondition()
+ {
+ return this._condition;
+ }
+
+ /**
+ * Returns the value of field 'value'.
+ *
+ * @return the value of field 'Value'.
+ */
+ public java.lang.String getValue()
+ {
+ return this._value;
+ }
+
+ /**
+ * Method isValid.
+ *
+ * @return true if this object is valid according to the schema
+ */
+ public boolean isValid()
+ {
+ try
+ {
+ validate();
+ } catch (org.exolab.castor.xml.ValidationException vex)
+ {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ *
+ *
+ * @param out
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void marshal(final java.io.Writer out)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException
+ {
+ Marshaller.marshal(this, out);
+ }
+
+ /**
+ *
+ *
+ * @param handler
+ * @throws java.io.IOException
+ * if an IOException occurs during marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ */
+ public void marshal(final org.xml.sax.ContentHandler handler)
+ throws java.io.IOException,
+ org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException
+ {
+ Marshaller.marshal(this, handler);
+ }
+
+ /**
+ */
+ public void removeAllAttributeName()
+ {
+ this._attributeNameList.clear();
+ }
+
+ /**
+ * Method removeAttributeName.
+ *
+ * @param vAttributeName
+ * @return true if the object was removed from the collection.
+ */
+ public boolean removeAttributeName(final java.lang.String vAttributeName)
+ {
+ boolean removed = _attributeNameList.remove(vAttributeName);
+ return removed;
+ }
+
+ /**
+ * Method removeAttributeNameAt.
+ *
+ * @param index
+ * @return the element removed from the collection
+ */
+ public java.lang.String removeAttributeNameAt(final int index)
+ {
+ java.lang.Object obj = this._attributeNameList.remove(index);
+ return (java.lang.String) obj;
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vAttributeName
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void setAttributeName(final int index,
+ final java.lang.String vAttributeName)
+ throws java.lang.IndexOutOfBoundsException
+ {
+ // check bounds for index
+ if (index < 0 || index >= this._attributeNameList.size())
+ {
+ throw new IndexOutOfBoundsException("setAttributeName: Index value '"
+ + index + "' not in range [0.."
+ + (this._attributeNameList.size() - 1) + "]");
+ }
+
+ this._attributeNameList.set(index, vAttributeName);
+ }
+
+ /**
+ *
+ *
+ * @param vAttributeNameArray
+ */
+ public void setAttributeName(final java.lang.String[] vAttributeNameArray)
+ {
+ // -- copy array
+ _attributeNameList.clear();
+
+ for (int i = 0; i < vAttributeNameArray.length; i++)
+ {
+ this._attributeNameList.add(vAttributeNameArray[i]);
+ }
+ }
+
+ /**
+ * Sets the value of field 'by'.
+ *
+ * @param by
+ * the value of field 'by'.
+ */
+ public void setBy(
+ final jalview.schemabinding.version2.types.FeatureMatcherByType by)
+ {
+ this._by = by;
+ }
+
+ /**
+ * Sets the value of field 'condition'.
+ *
+ * @param condition
+ * the value of field 'condition'.
+ */
+ public void setCondition(final java.lang.String condition)
+ {
+ this._condition = condition;
+ }
+
+ /**
+ * Sets the value of field 'value'.
+ *
+ * @param value
+ * the value of field 'value'.
+ */
+ public void setValue(final java.lang.String value)
+ {
+ this._value = value;
+ }
+
+ /**
+ * Method unmarshal.
+ *
+ * @param reader
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @return the unmarshaled jalview.schemabinding.version2.FeatureMatcher
+ */
+ public static jalview.schemabinding.version2.FeatureMatcher unmarshal(
+ final java.io.Reader reader)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException
+ {
+ return (jalview.schemabinding.version2.FeatureMatcher) Unmarshaller
+ .unmarshal(jalview.schemabinding.version2.FeatureMatcher.class,
+ reader);
+ }
+
+ /**
+ *
+ *
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void validate() throws org.exolab.castor.xml.ValidationException
+ {
+ org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
+ validator.validate(this);
+ }
+
+}
--- /dev/null
+/*
+ * This class was automatically generated with
+ * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
+ * Schema.
+ * $Id$
+ */
+
+package jalview.schemabinding.version2;
+
+//---------------------------------/
+//- Imported classes and packages -/
+//---------------------------------/
+
+import org.exolab.castor.xml.Marshaller;
+import org.exolab.castor.xml.Unmarshaller;
+
+/**
+ * A feature match condition, which may be simple or compound
+ *
+ * @version $Revision$ $Date$
+ */
+public class FeatureMatcherSet implements java.io.Serializable
+{
+
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
+
+ /**
+ * Internal choice value storage
+ */
+ private java.lang.Object _choiceValue;
+
+ /**
+ * Field _matchCondition.
+ */
+ private jalview.schemabinding.version2.MatchCondition _matchCondition;
+
+ /**
+ * Field _compoundMatcher.
+ */
+ private jalview.schemabinding.version2.CompoundMatcher _compoundMatcher;
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public FeatureMatcherSet()
+ {
+ super();
+ }
+
+ // -----------/
+ // - Methods -/
+ // -----------/
+
+ /**
+ * Returns the value of field 'choiceValue'. The field 'choiceValue' has the
+ * following description: Internal choice value storage
+ *
+ * @return the value of field 'ChoiceValue'.
+ */
+ public java.lang.Object getChoiceValue()
+ {
+ return this._choiceValue;
+ }
+
+ /**
+ * Returns the value of field 'compoundMatcher'.
+ *
+ * @return the value of field 'CompoundMatcher'.
+ */
+ public jalview.schemabinding.version2.CompoundMatcher getCompoundMatcher()
+ {
+ return this._compoundMatcher;
+ }
+
+ /**
+ * Returns the value of field 'matchCondition'.
+ *
+ * @return the value of field 'MatchCondition'.
+ */
+ public jalview.schemabinding.version2.MatchCondition getMatchCondition()
+ {
+ return this._matchCondition;
+ }
+
+ /**
+ * Method isValid.
+ *
+ * @return true if this object is valid according to the schema
+ */
+ public boolean isValid()
+ {
+ try
+ {
+ validate();
+ } catch (org.exolab.castor.xml.ValidationException vex)
+ {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ *
+ *
+ * @param out
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void marshal(final java.io.Writer out)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException
+ {
+ Marshaller.marshal(this, out);
+ }
+
+ /**
+ *
+ *
+ * @param handler
+ * @throws java.io.IOException
+ * if an IOException occurs during marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ */
+ public void marshal(final org.xml.sax.ContentHandler handler)
+ throws java.io.IOException,
+ org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException
+ {
+ Marshaller.marshal(this, handler);
+ }
+
+ /**
+ * Sets the value of field 'compoundMatcher'.
+ *
+ * @param compoundMatcher
+ * the value of field 'compoundMatcher'.
+ */
+ public void setCompoundMatcher(
+ final jalview.schemabinding.version2.CompoundMatcher compoundMatcher)
+ {
+ this._compoundMatcher = compoundMatcher;
+ this._choiceValue = compoundMatcher;
+ }
+
+ /**
+ * Sets the value of field 'matchCondition'.
+ *
+ * @param matchCondition
+ * the value of field 'matchCondition'.
+ */
+ public void setMatchCondition(
+ final jalview.schemabinding.version2.MatchCondition matchCondition)
+ {
+ this._matchCondition = matchCondition;
+ this._choiceValue = matchCondition;
+ }
+
+ /**
+ * Method unmarshal.
+ *
+ * @param reader
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @return the unmarshaled jalview.schemabinding.version2.FeatureMatcherSet
+ */
+ public static jalview.schemabinding.version2.FeatureMatcherSet unmarshal(
+ final java.io.Reader reader)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException
+ {
+ return (jalview.schemabinding.version2.FeatureMatcherSet) Unmarshaller
+ .unmarshal(
+ jalview.schemabinding.version2.FeatureMatcherSet.class,
+ reader);
+ }
+
+ /**
+ *
+ *
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void validate() throws org.exolab.castor.xml.ValidationException
+ {
+ org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
+ validator.validate(this);
+ }
+
+}
--- /dev/null
+/*
+ * This class was automatically generated with
+ * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
+ * Schema.
+ * $Id$
+ */
+
+package jalview.schemabinding.version2;
+
+//---------------------------------/
+//- Imported classes and packages -/
+//---------------------------------/
+
+import org.exolab.castor.xml.Marshaller;
+import org.exolab.castor.xml.Unmarshaller;
+
+/**
+ * Class Filter.
+ *
+ * @version $Revision$ $Date$
+ */
+public class Filter implements java.io.Serializable
+{
+
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
+
+ /**
+ * Field _featureType.
+ */
+ private java.lang.String _featureType;
+
+ /**
+ * Field _matcherSet.
+ */
+ private jalview.schemabinding.version2.MatcherSet _matcherSet;
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public Filter()
+ {
+ super();
+ }
+
+ // -----------/
+ // - Methods -/
+ // -----------/
+
+ /**
+ * Returns the value of field 'featureType'.
+ *
+ * @return the value of field 'FeatureType'.
+ */
+ public java.lang.String getFeatureType()
+ {
+ return this._featureType;
+ }
+
+ /**
+ * Returns the value of field 'matcherSet'.
+ *
+ * @return the value of field 'MatcherSet'.
+ */
+ public jalview.schemabinding.version2.MatcherSet getMatcherSet()
+ {
+ return this._matcherSet;
+ }
+
+ /**
+ * Method isValid.
+ *
+ * @return true if this object is valid according to the schema
+ */
+ public boolean isValid()
+ {
+ try
+ {
+ validate();
+ } catch (org.exolab.castor.xml.ValidationException vex)
+ {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ *
+ *
+ * @param out
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void marshal(final java.io.Writer out)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException
+ {
+ Marshaller.marshal(this, out);
+ }
+
+ /**
+ *
+ *
+ * @param handler
+ * @throws java.io.IOException
+ * if an IOException occurs during marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ */
+ public void marshal(final org.xml.sax.ContentHandler handler)
+ throws java.io.IOException,
+ org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException
+ {
+ Marshaller.marshal(this, handler);
+ }
+
+ /**
+ * Sets the value of field 'featureType'.
+ *
+ * @param featureType
+ * the value of field 'featureType'.
+ */
+ public void setFeatureType(final java.lang.String featureType)
+ {
+ this._featureType = featureType;
+ }
+
+ /**
+ * Sets the value of field 'matcherSet'.
+ *
+ * @param matcherSet
+ * the value of field 'matcherSet'.
+ */
+ public void setMatcherSet(
+ final jalview.schemabinding.version2.MatcherSet matcherSet)
+ {
+ this._matcherSet = matcherSet;
+ }
+
+ /**
+ * Method unmarshal.
+ *
+ * @param reader
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @return the unmarshaled jalview.schemabinding.version2.Filter
+ */
+ public static jalview.schemabinding.version2.Filter unmarshal(
+ final java.io.Reader reader)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException
+ {
+ return (jalview.schemabinding.version2.Filter) Unmarshaller
+ .unmarshal(jalview.schemabinding.version2.Filter.class, reader);
+ }
+
+ /**
+ *
+ *
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void validate() throws org.exolab.castor.xml.ValidationException
+ {
+ org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
+ validator.validate(this);
+ }
+
+}
*/
private java.util.Vector _colourList;
+ /**
+ * Field _filterList.
+ */
+ private java.util.Vector _filterList;
+
// ----------------/
// - Constructors -/
// ----------------/
{
super();
this._colourList = new java.util.Vector();
+ this._filterList = new java.util.Vector();
}
// -----------/
}
/**
+ *
+ *
+ * @param vFilter
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addFilter(final Filter vFilter)
+ throws java.lang.IndexOutOfBoundsException
+ {
+ this._filterList.addElement(vFilter);
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vFilter
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addFilter(final int index, final Filter vFilter)
+ throws java.lang.IndexOutOfBoundsException
+ {
+ this._filterList.add(index, vFilter);
+ }
+
+ /**
* Method enumerateColour.
*
* @return an Enumeration over all Colour elements
}
/**
+ * Method enumerateFilter.
+ *
+ * @return an Enumeration over all Filter elements
+ */
+ public java.util.Enumeration enumerateFilter()
+ {
+ return this._filterList.elements();
+ }
+
+ /**
* Method getColour.
*
* @param index
// check bounds for index
if (index < 0 || index >= this._colourList.size())
{
- throw new IndexOutOfBoundsException("getColour: Index value '"
- + index + "' not in range [0.."
- + (this._colourList.size() - 1) + "]");
+ throw new IndexOutOfBoundsException(
+ "getColour: Index value '" + index + "' not in range [0.."
+ + (this._colourList.size() - 1) + "]");
}
return (Colour) _colourList.get(index);
}
/**
+ * Method getFilter.
+ *
+ * @param index
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ * @return the value of the Filter at the given index
+ */
+ public Filter getFilter(final int index)
+ throws java.lang.IndexOutOfBoundsException
+ {
+ // check bounds for index
+ if (index < 0 || index >= this._filterList.size())
+ {
+ throw new IndexOutOfBoundsException(
+ "getFilter: Index value '" + index + "' not in range [0.."
+ + (this._filterList.size() - 1) + "]");
+ }
+
+ return (Filter) _filterList.get(index);
+ }
+
+ /**
+ * Method getFilter.Returns the contents of the collection in an Array.
+ * <p>
+ * 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
+ * <i>know</i> that the Array returned is of exactly the correct length.
+ *
+ * @return this collection as an Array
+ */
+ public Filter[] getFilter()
+ {
+ Filter[] array = new Filter[0];
+ return (Filter[]) this._filterList.toArray(array);
+ }
+
+ /**
+ * Method getFilterCount.
+ *
+ * @return the size of this collection
+ */
+ public int getFilterCount()
+ {
+ return this._filterList.size();
+ }
+
+ /**
* Returns the value of field 'schemeName'.
*
* @return the value of field 'SchemeName'.
}
/**
- */
+ */
public void removeAllColour()
{
this._colourList.clear();
}
/**
+ */
+ public void removeAllFilter()
+ {
+ this._filterList.clear();
+ }
+
+ /**
* Method removeColour.
*
* @param vColour
}
/**
+ * Method removeFilter.
+ *
+ * @param vFilter
+ * @return true if the object was removed from the collection.
+ */
+ public boolean removeFilter(final Filter vFilter)
+ {
+ boolean removed = _filterList.remove(vFilter);
+ return removed;
+ }
+
+ /**
+ * Method removeFilterAt.
+ *
+ * @param index
+ * @return the element removed from the collection
+ */
+ public Filter removeFilterAt(final int index)
+ {
+ java.lang.Object obj = this._filterList.remove(index);
+ return (Filter) obj;
+ }
+
+ /**
*
*
* @param index
// check bounds for index
if (index < 0 || index >= this._colourList.size())
{
- throw new IndexOutOfBoundsException("setColour: Index value '"
- + index + "' not in range [0.."
- + (this._colourList.size() - 1) + "]");
+ throw new IndexOutOfBoundsException(
+ "setColour: Index value '" + index + "' not in range [0.."
+ + (this._colourList.size() - 1) + "]");
}
this._colourList.set(index, vColour);
}
/**
+ *
+ *
+ * @param index
+ * @param vFilter
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void setFilter(final int index, final Filter vFilter)
+ throws java.lang.IndexOutOfBoundsException
+ {
+ // check bounds for index
+ if (index < 0 || index >= this._filterList.size())
+ {
+ throw new IndexOutOfBoundsException(
+ "setFilter: Index value '" + index + "' not in range [0.."
+ + (this._filterList.size() - 1) + "]");
+ }
+
+ this._filterList.set(index, vFilter);
+ }
+
+ /**
+ *
+ *
+ * @param vFilterArray
+ */
+ public void setFilter(final Filter[] vFilterArray)
+ {
+ // -- copy array
+ _filterList.clear();
+
+ for (int i = 0; i < vFilterArray.length; i++)
+ {
+ this._filterList.add(vFilterArray[i]);
+ }
+ }
+
+ /**
* Sets the value of field 'schemeName'.
*
* @param schemeName
--- /dev/null
+/*
+ * This class was automatically generated with
+ * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
+ * Schema.
+ * $Id$
+ */
+
+package jalview.schemabinding.version2;
+
+//---------------------------------/
+//- Imported classes and packages -/
+//---------------------------------/
+
+import org.exolab.castor.xml.Marshaller;
+import org.exolab.castor.xml.Unmarshaller;
+
+/**
+ * Class MatchCondition.
+ *
+ * @version $Revision$ $Date$
+ */
+public class MatchCondition extends FeatureMatcher
+ implements java.io.Serializable
+{
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public MatchCondition()
+ {
+ super();
+ }
+
+ // -----------/
+ // - Methods -/
+ // -----------/
+
+ /**
+ * Method isValid.
+ *
+ * @return true if this object is valid according to the schema
+ */
+ public boolean isValid()
+ {
+ try
+ {
+ validate();
+ } catch (org.exolab.castor.xml.ValidationException vex)
+ {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ *
+ *
+ * @param out
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void marshal(final java.io.Writer out)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException
+ {
+ Marshaller.marshal(this, out);
+ }
+
+ /**
+ *
+ *
+ * @param handler
+ * @throws java.io.IOException
+ * if an IOException occurs during marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ */
+ public void marshal(final org.xml.sax.ContentHandler handler)
+ throws java.io.IOException,
+ org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException
+ {
+ Marshaller.marshal(this, handler);
+ }
+
+ /**
+ * Method unmarshal.
+ *
+ * @param reader
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @return the unmarshaled jalview.schemabinding.version2.FeatureMatcher
+ */
+ public static jalview.schemabinding.version2.FeatureMatcher unmarshal(
+ final java.io.Reader reader)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException
+ {
+ return (jalview.schemabinding.version2.FeatureMatcher) Unmarshaller
+ .unmarshal(jalview.schemabinding.version2.MatchCondition.class,
+ reader);
+ }
+
+ /**
+ *
+ *
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void validate() throws org.exolab.castor.xml.ValidationException
+ {
+ org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
+ validator.validate(this);
+ }
+
+}
--- /dev/null
+/*
+ * This class was automatically generated with
+ * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
+ * Schema.
+ * $Id$
+ */
+
+package jalview.schemabinding.version2;
+
+//---------------------------------/
+//- Imported classes and packages -/
+//---------------------------------/
+
+import org.exolab.castor.xml.Marshaller;
+import org.exolab.castor.xml.Unmarshaller;
+
+/**
+ * Class MatcherSet.
+ *
+ * @version $Revision$ $Date$
+ */
+public class MatcherSet extends FeatureMatcherSet
+ implements java.io.Serializable
+{
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public MatcherSet()
+ {
+ super();
+ }
+
+ // -----------/
+ // - Methods -/
+ // -----------/
+
+ /**
+ * Method isValid.
+ *
+ * @return true if this object is valid according to the schema
+ */
+ public boolean isValid()
+ {
+ try
+ {
+ validate();
+ } catch (org.exolab.castor.xml.ValidationException vex)
+ {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ *
+ *
+ * @param out
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void marshal(final java.io.Writer out)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException
+ {
+ Marshaller.marshal(this, out);
+ }
+
+ /**
+ *
+ *
+ * @param handler
+ * @throws java.io.IOException
+ * if an IOException occurs during marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ */
+ public void marshal(final org.xml.sax.ContentHandler handler)
+ throws java.io.IOException,
+ org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException
+ {
+ Marshaller.marshal(this, handler);
+ }
+
+ /**
+ * Method unmarshal.
+ *
+ * @param reader
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @return the unmarshaled jalview.schemabinding.version2.FeatureMatcherSet
+ */
+ public static jalview.schemabinding.version2.FeatureMatcherSet unmarshal(
+ final java.io.Reader reader)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException
+ {
+ return (jalview.schemabinding.version2.FeatureMatcherSet) Unmarshaller
+ .unmarshal(jalview.schemabinding.version2.MatcherSet.class,
+ reader);
+ }
+
+ /**
+ *
+ *
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void validate() throws org.exolab.castor.xml.ValidationException
+ {
+ org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
+ validator.validate(this);
+ }
+
+}
*
* @version $Revision$ $Date$
*/
-public class ColourDescriptor extends
- org.exolab.castor.xml.util.XMLClassDescriptorImpl
+public class ColourDescriptor
+ extends org.exolab.castor.xml.util.XMLClassDescriptorImpl
{
// --------------------------/
super();
_xmlName = "colour";
_elementDefinition = true;
+
+ // -- set grouping compositor
+ setCompositorAsSequence();
org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
org.exolab.castor.mapping.FieldHandler handler = null;
org.exolab.castor.xml.FieldValidator fieldValidator = null;
typeValidator.setWhiteSpace("preserve");
}
desc.setValidator(fieldValidator);
- // -- _threshType
+ // -- _noValueColour
desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
- java.lang.String.class, "_threshType", "threshType",
+ jalview.schemabinding.version2.types.ColourNoValueColourType.class,
+ "_noValueColour", "noValueColour",
org.exolab.castor.xml.NodeType.Attribute);
+ handler = new org.exolab.castor.xml.XMLFieldHandler()
+ {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException
+ {
+ Colour target = (Colour) object;
+ return target.getNoValueColour();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException
+ {
+ try
+ {
+ Colour target = (Colour) object;
+ target.setNoValueColour(
+ (jalview.schemabinding.version2.types.ColourNoValueColourType) value);
+ } catch (java.lang.Exception ex)
+ {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent)
+ {
+ return null;
+ }
+ };
+ handler = new org.exolab.castor.xml.handlers.EnumFieldHandler(
+ jalview.schemabinding.version2.types.ColourNoValueColourType.class,
+ handler);
desc.setImmutable(true);
+ desc.setHandler(handler);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _noValueColour
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ { // -- local scope
+ }
+ desc.setValidator(fieldValidator);
+ // -- _threshType
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ jalview.schemabinding.version2.types.ColourThreshTypeType.class,
+ "_threshType", "threshType",
+ org.exolab.castor.xml.NodeType.Attribute);
handler = new org.exolab.castor.xml.XMLFieldHandler()
{
public java.lang.Object getValue(java.lang.Object object)
try
{
Colour target = (Colour) object;
- target.setThreshType((java.lang.String) value);
+ target.setThreshType(
+ (jalview.schemabinding.version2.types.ColourThreshTypeType) value);
} catch (java.lang.Exception ex)
{
throw new IllegalStateException(ex.toString());
return null;
}
};
+ handler = new org.exolab.castor.xml.handlers.EnumFieldHandler(
+ jalview.schemabinding.version2.types.ColourThreshTypeType.class,
+ handler);
+ desc.setImmutable(true);
desc.setHandler(handler);
desc.setMultivalued(false);
addFieldDescriptor(desc);
// -- validation code for: _threshType
fieldValidator = new org.exolab.castor.xml.FieldValidator();
{ // -- local scope
- org.exolab.castor.xml.validators.StringValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.StringValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setWhiteSpace("preserve");
}
desc.setValidator(fieldValidator);
// -- _threshold
target.deleteColourByLabel();
return;
}
- target.setColourByLabel(((java.lang.Boolean) value)
- .booleanValue());
+ target.setColourByLabel(
+ ((java.lang.Boolean) value).booleanValue());
} catch (java.lang.Exception ex)
{
throw new IllegalStateException(ex.toString());
desc.setValidator(fieldValidator);
// -- initialize element descriptors
+ // -- _attributeNameList
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.String.class, "_attributeNameList", "attributeName",
+ org.exolab.castor.xml.NodeType.Element);
+ desc.setImmutable(true);
+ handler = new org.exolab.castor.xml.XMLFieldHandler()
+ {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException
+ {
+ Colour target = (Colour) object;
+ return target.getAttributeName();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException
+ {
+ try
+ {
+ Colour target = (Colour) object;
+ target.addAttributeName((java.lang.String) value);
+ } catch (java.lang.Exception ex)
+ {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
+
+ public void resetValue(Object object)
+ throws IllegalStateException, IllegalArgumentException
+ {
+ try
+ {
+ Colour target = (Colour) object;
+ target.removeAllAttributeName();
+ } catch (java.lang.Exception ex)
+ {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent)
+ {
+ return null;
+ }
+ };
+ desc.setHandler(handler);
+ desc.setMultivalued(true);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _attributeNameList
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(0);
+ fieldValidator.setMaxOccurs(2);
+ { // -- local scope
+ org.exolab.castor.xml.validators.StringValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.StringValidator();
+ fieldValidator.setValidator(typeValidator);
+ typeValidator.setWhiteSpace("preserve");
+ }
+ desc.setValidator(fieldValidator);
}
// -----------/
--- /dev/null
+/*
+ * This class was automatically generated with
+ * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
+ * Schema.
+ * $Id$
+ */
+
+package jalview.schemabinding.version2.descriptors;
+
+//---------------------------------/
+//- Imported classes and packages -/
+//---------------------------------/
+
+import jalview.schemabinding.version2.CompoundMatcher;
+
+/**
+ * Class CompoundMatcherDescriptor.
+ *
+ * @version $Revision$ $Date$
+ */
+public class CompoundMatcherDescriptor
+ extends org.exolab.castor.xml.util.XMLClassDescriptorImpl
+{
+
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
+
+ /**
+ * Field _elementDefinition.
+ */
+ private boolean _elementDefinition;
+
+ /**
+ * Field _nsPrefix.
+ */
+ private java.lang.String _nsPrefix;
+
+ /**
+ * Field _nsURI.
+ */
+ private java.lang.String _nsURI;
+
+ /**
+ * Field _xmlName.
+ */
+ private java.lang.String _xmlName;
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public CompoundMatcherDescriptor()
+ {
+ super();
+ _xmlName = "compoundMatcher";
+ _elementDefinition = true;
+
+ // -- set grouping compositor
+ setCompositorAsSequence();
+ org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
+ org.exolab.castor.mapping.FieldHandler handler = null;
+ org.exolab.castor.xml.FieldValidator fieldValidator = null;
+ // -- initialize attribute descriptors
+
+ // -- _and
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.Boolean.TYPE, "_and", "and",
+ org.exolab.castor.xml.NodeType.Attribute);
+ handler = new org.exolab.castor.xml.XMLFieldHandler()
+ {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException
+ {
+ CompoundMatcher target = (CompoundMatcher) object;
+ if (!target.hasAnd())
+ {
+ return null;
+ }
+ return (target.getAnd() ? java.lang.Boolean.TRUE
+ : java.lang.Boolean.FALSE);
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException
+ {
+ try
+ {
+ CompoundMatcher target = (CompoundMatcher) object;
+ // ignore null values for non optional primitives
+ if (value == null)
+ {
+ return;
+ }
+
+ target.setAnd(((java.lang.Boolean) value).booleanValue());
+ } catch (java.lang.Exception ex)
+ {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent)
+ {
+ return null;
+ }
+ };
+ desc.setHandler(handler);
+ desc.setRequired(true);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _and
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(1);
+ { // -- local scope
+ org.exolab.castor.xml.validators.BooleanValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
+ fieldValidator.setValidator(typeValidator);
+ }
+ desc.setValidator(fieldValidator);
+ // -- initialize element descriptors
+
+ // -- _matcherSetList
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ jalview.schemabinding.version2.MatcherSet.class,
+ "_matcherSetList", "matcherSet",
+ org.exolab.castor.xml.NodeType.Element);
+ handler = new org.exolab.castor.xml.XMLFieldHandler()
+ {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException
+ {
+ CompoundMatcher target = (CompoundMatcher) object;
+ return target.getMatcherSet();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException
+ {
+ try
+ {
+ CompoundMatcher target = (CompoundMatcher) object;
+ target.addMatcherSet(
+ (jalview.schemabinding.version2.MatcherSet) value);
+ } catch (java.lang.Exception ex)
+ {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
+
+ public void resetValue(Object object)
+ throws IllegalStateException, IllegalArgumentException
+ {
+ try
+ {
+ CompoundMatcher target = (CompoundMatcher) object;
+ target.removeAllMatcherSet();
+ } catch (java.lang.Exception ex)
+ {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent)
+ {
+ return new jalview.schemabinding.version2.MatcherSet();
+ }
+ };
+ desc.setHandler(handler);
+ desc.setRequired(true);
+ desc.setMultivalued(true);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _matcherSetList
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(2);
+ fieldValidator.setMaxOccurs(2);
+ { // -- local scope
+ }
+ desc.setValidator(fieldValidator);
+ }
+
+ // -----------/
+ // - Methods -/
+ // -----------/
+
+ /**
+ * Method getAccessMode.
+ *
+ * @return the access mode specified for this class.
+ */
+ public org.exolab.castor.mapping.AccessMode getAccessMode()
+ {
+ return null;
+ }
+
+ /**
+ * Method getIdentity.
+ *
+ * @return the identity field, null if this class has no identity.
+ */
+ public org.exolab.castor.mapping.FieldDescriptor getIdentity()
+ {
+ return super.getIdentity();
+ }
+
+ /**
+ * Method getJavaClass.
+ *
+ * @return the Java class represented by this descriptor.
+ */
+ public java.lang.Class getJavaClass()
+ {
+ return jalview.schemabinding.version2.CompoundMatcher.class;
+ }
+
+ /**
+ * Method getNameSpacePrefix.
+ *
+ * @return the namespace prefix to use when marshaling as XML.
+ */
+ public java.lang.String getNameSpacePrefix()
+ {
+ return _nsPrefix;
+ }
+
+ /**
+ * Method getNameSpaceURI.
+ *
+ * @return the namespace URI used when marshaling and unmarshaling as XML.
+ */
+ public java.lang.String getNameSpaceURI()
+ {
+ return _nsURI;
+ }
+
+ /**
+ * Method getValidator.
+ *
+ * @return a specific validator for the class described by this
+ * ClassDescriptor.
+ */
+ public org.exolab.castor.xml.TypeValidator getValidator()
+ {
+ return this;
+ }
+
+ /**
+ * Method getXMLName.
+ *
+ * @return the XML Name for the Class being described.
+ */
+ public java.lang.String getXMLName()
+ {
+ return _xmlName;
+ }
+
+ /**
+ * Method isElementDefinition.
+ *
+ * @return true if XML schema definition of this Class is that of a global
+ * element or element with anonymous type definition.
+ */
+ public boolean isElementDefinition()
+ {
+ return _elementDefinition;
+ }
+
+}
--- /dev/null
+/*
+ * This class was automatically generated with
+ * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
+ * Schema.
+ * $Id$
+ */
+
+package jalview.schemabinding.version2.descriptors;
+
+//---------------------------------/
+//- Imported classes and packages -/
+//---------------------------------/
+
+import jalview.schemabinding.version2.FeatureMatcher;
+
+/**
+ * Class FeatureMatcherDescriptor.
+ *
+ * @version $Revision$ $Date$
+ */
+public class FeatureMatcherDescriptor
+ extends org.exolab.castor.xml.util.XMLClassDescriptorImpl
+{
+
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
+
+ /**
+ * Field _elementDefinition.
+ */
+ private boolean _elementDefinition;
+
+ /**
+ * Field _nsPrefix.
+ */
+ private java.lang.String _nsPrefix;
+
+ /**
+ * Field _nsURI.
+ */
+ private java.lang.String _nsURI;
+
+ /**
+ * Field _xmlName.
+ */
+ private java.lang.String _xmlName;
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public FeatureMatcherDescriptor()
+ {
+ super();
+ _nsURI = "www.jalview.org/colours";
+ _xmlName = "FeatureMatcher";
+ _elementDefinition = false;
+
+ // -- set grouping compositor
+ setCompositorAsSequence();
+ org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
+ org.exolab.castor.mapping.FieldHandler handler = null;
+ org.exolab.castor.xml.FieldValidator fieldValidator = null;
+ // -- initialize attribute descriptors
+
+ // -- _by
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ jalview.schemabinding.version2.types.FeatureMatcherByType.class,
+ "_by", "by", org.exolab.castor.xml.NodeType.Attribute);
+ handler = new org.exolab.castor.xml.XMLFieldHandler()
+ {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException
+ {
+ FeatureMatcher target = (FeatureMatcher) object;
+ return target.getBy();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException
+ {
+ try
+ {
+ FeatureMatcher target = (FeatureMatcher) object;
+ target.setBy(
+ (jalview.schemabinding.version2.types.FeatureMatcherByType) value);
+ } catch (java.lang.Exception ex)
+ {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent)
+ {
+ return null;
+ }
+ };
+ handler = new org.exolab.castor.xml.handlers.EnumFieldHandler(
+ jalview.schemabinding.version2.types.FeatureMatcherByType.class,
+ handler);
+ desc.setImmutable(true);
+ desc.setHandler(handler);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _by
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ { // -- local scope
+ }
+ desc.setValidator(fieldValidator);
+ // -- initialize element descriptors
+
+ // -- _attributeNameList
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.String.class, "_attributeNameList", "attributeName",
+ org.exolab.castor.xml.NodeType.Element);
+ desc.setImmutable(true);
+ handler = new org.exolab.castor.xml.XMLFieldHandler()
+ {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException
+ {
+ FeatureMatcher target = (FeatureMatcher) object;
+ return target.getAttributeName();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException
+ {
+ try
+ {
+ FeatureMatcher target = (FeatureMatcher) object;
+ target.addAttributeName((java.lang.String) value);
+ } catch (java.lang.Exception ex)
+ {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
+
+ public void resetValue(Object object)
+ throws IllegalStateException, IllegalArgumentException
+ {
+ try
+ {
+ FeatureMatcher target = (FeatureMatcher) object;
+ target.removeAllAttributeName();
+ } catch (java.lang.Exception ex)
+ {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent)
+ {
+ return null;
+ }
+ };
+ desc.setHandler(handler);
+ desc.setMultivalued(true);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _attributeNameList
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(0);
+ fieldValidator.setMaxOccurs(2);
+ { // -- local scope
+ org.exolab.castor.xml.validators.StringValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.StringValidator();
+ fieldValidator.setValidator(typeValidator);
+ typeValidator.setWhiteSpace("preserve");
+ }
+ desc.setValidator(fieldValidator);
+ // -- _condition
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.String.class, "_condition", "condition",
+ org.exolab.castor.xml.NodeType.Element);
+ desc.setImmutable(true);
+ handler = new org.exolab.castor.xml.XMLFieldHandler()
+ {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException
+ {
+ FeatureMatcher target = (FeatureMatcher) object;
+ return target.getCondition();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException
+ {
+ try
+ {
+ FeatureMatcher target = (FeatureMatcher) object;
+ target.setCondition((java.lang.String) value);
+ } catch (java.lang.Exception ex)
+ {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent)
+ {
+ return null;
+ }
+ };
+ desc.setHandler(handler);
+ desc.setRequired(true);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _condition
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(1);
+ { // -- local scope
+ org.exolab.castor.xml.validators.StringValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.StringValidator();
+ fieldValidator.setValidator(typeValidator);
+ typeValidator.setWhiteSpace("preserve");
+ }
+ desc.setValidator(fieldValidator);
+ // -- _value
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.String.class, "_value", "value",
+ org.exolab.castor.xml.NodeType.Element);
+ desc.setImmutable(true);
+ handler = new org.exolab.castor.xml.XMLFieldHandler()
+ {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException
+ {
+ FeatureMatcher target = (FeatureMatcher) object;
+ return target.getValue();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException
+ {
+ try
+ {
+ FeatureMatcher target = (FeatureMatcher) object;
+ target.setValue((java.lang.String) value);
+ } catch (java.lang.Exception ex)
+ {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent)
+ {
+ return null;
+ }
+ };
+ desc.setHandler(handler);
+ desc.setRequired(true);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _value
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(1);
+ { // -- local scope
+ org.exolab.castor.xml.validators.StringValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.StringValidator();
+ fieldValidator.setValidator(typeValidator);
+ typeValidator.setWhiteSpace("preserve");
+ }
+ desc.setValidator(fieldValidator);
+ }
+
+ // -----------/
+ // - Methods -/
+ // -----------/
+
+ /**
+ * Method getAccessMode.
+ *
+ * @return the access mode specified for this class.
+ */
+ public org.exolab.castor.mapping.AccessMode getAccessMode()
+ {
+ return null;
+ }
+
+ /**
+ * Method getIdentity.
+ *
+ * @return the identity field, null if this class has no identity.
+ */
+ public org.exolab.castor.mapping.FieldDescriptor getIdentity()
+ {
+ return super.getIdentity();
+ }
+
+ /**
+ * Method getJavaClass.
+ *
+ * @return the Java class represented by this descriptor.
+ */
+ public java.lang.Class getJavaClass()
+ {
+ return jalview.schemabinding.version2.FeatureMatcher.class;
+ }
+
+ /**
+ * Method getNameSpacePrefix.
+ *
+ * @return the namespace prefix to use when marshaling as XML.
+ */
+ public java.lang.String getNameSpacePrefix()
+ {
+ return _nsPrefix;
+ }
+
+ /**
+ * Method getNameSpaceURI.
+ *
+ * @return the namespace URI used when marshaling and unmarshaling as XML.
+ */
+ public java.lang.String getNameSpaceURI()
+ {
+ return _nsURI;
+ }
+
+ /**
+ * Method getValidator.
+ *
+ * @return a specific validator for the class described by this
+ * ClassDescriptor.
+ */
+ public org.exolab.castor.xml.TypeValidator getValidator()
+ {
+ return this;
+ }
+
+ /**
+ * Method getXMLName.
+ *
+ * @return the XML Name for the Class being described.
+ */
+ public java.lang.String getXMLName()
+ {
+ return _xmlName;
+ }
+
+ /**
+ * Method isElementDefinition.
+ *
+ * @return true if XML schema definition of this Class is that of a global
+ * element or element with anonymous type definition.
+ */
+ public boolean isElementDefinition()
+ {
+ return _elementDefinition;
+ }
+
+}
--- /dev/null
+/*
+ * This class was automatically generated with
+ * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
+ * Schema.
+ * $Id$
+ */
+
+package jalview.schemabinding.version2.descriptors;
+
+//---------------------------------/
+//- Imported classes and packages -/
+//---------------------------------/
+
+import jalview.schemabinding.version2.FeatureMatcherSet;
+
+/**
+ * Class FeatureMatcherSetDescriptor.
+ *
+ * @version $Revision$ $Date$
+ */
+public class FeatureMatcherSetDescriptor
+ extends org.exolab.castor.xml.util.XMLClassDescriptorImpl
+{
+
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
+
+ /**
+ * Field _elementDefinition.
+ */
+ private boolean _elementDefinition;
+
+ /**
+ * Field _nsPrefix.
+ */
+ private java.lang.String _nsPrefix;
+
+ /**
+ * Field _nsURI.
+ */
+ private java.lang.String _nsURI;
+
+ /**
+ * Field _xmlName.
+ */
+ private java.lang.String _xmlName;
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public FeatureMatcherSetDescriptor()
+ {
+ super();
+ _nsURI = "www.jalview.org/colours";
+ _xmlName = "FeatureMatcherSet";
+ _elementDefinition = false;
+
+ // -- set grouping compositor
+ setCompositorAsChoice();
+ org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
+ org.exolab.castor.mapping.FieldHandler handler = null;
+ org.exolab.castor.xml.FieldValidator fieldValidator = null;
+ // -- initialize attribute descriptors
+
+ // -- initialize element descriptors
+
+ // -- _matchCondition
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ jalview.schemabinding.version2.MatchCondition.class,
+ "_matchCondition", "matchCondition",
+ org.exolab.castor.xml.NodeType.Element);
+ handler = new org.exolab.castor.xml.XMLFieldHandler()
+ {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException
+ {
+ FeatureMatcherSet target = (FeatureMatcherSet) object;
+ return target.getMatchCondition();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException
+ {
+ try
+ {
+ FeatureMatcherSet target = (FeatureMatcherSet) object;
+ target.setMatchCondition(
+ (jalview.schemabinding.version2.MatchCondition) value);
+ } catch (java.lang.Exception ex)
+ {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent)
+ {
+ return new jalview.schemabinding.version2.MatchCondition();
+ }
+ };
+ desc.setHandler(handler);
+ desc.setRequired(true);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _matchCondition
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(1);
+ { // -- local scope
+ }
+ desc.setValidator(fieldValidator);
+ // -- _compoundMatcher
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ jalview.schemabinding.version2.CompoundMatcher.class,
+ "_compoundMatcher", "compoundMatcher",
+ org.exolab.castor.xml.NodeType.Element);
+ handler = new org.exolab.castor.xml.XMLFieldHandler()
+ {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException
+ {
+ FeatureMatcherSet target = (FeatureMatcherSet) object;
+ return target.getCompoundMatcher();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException
+ {
+ try
+ {
+ FeatureMatcherSet target = (FeatureMatcherSet) object;
+ target.setCompoundMatcher(
+ (jalview.schemabinding.version2.CompoundMatcher) value);
+ } catch (java.lang.Exception ex)
+ {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent)
+ {
+ return new jalview.schemabinding.version2.CompoundMatcher();
+ }
+ };
+ desc.setHandler(handler);
+ desc.setRequired(true);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _compoundMatcher
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(1);
+ { // -- local scope
+ }
+ desc.setValidator(fieldValidator);
+ }
+
+ // -----------/
+ // - Methods -/
+ // -----------/
+
+ /**
+ * Method getAccessMode.
+ *
+ * @return the access mode specified for this class.
+ */
+ public org.exolab.castor.mapping.AccessMode getAccessMode()
+ {
+ return null;
+ }
+
+ /**
+ * Method getIdentity.
+ *
+ * @return the identity field, null if this class has no identity.
+ */
+ public org.exolab.castor.mapping.FieldDescriptor getIdentity()
+ {
+ return super.getIdentity();
+ }
+
+ /**
+ * Method getJavaClass.
+ *
+ * @return the Java class represented by this descriptor.
+ */
+ public java.lang.Class getJavaClass()
+ {
+ return jalview.schemabinding.version2.FeatureMatcherSet.class;
+ }
+
+ /**
+ * Method getNameSpacePrefix.
+ *
+ * @return the namespace prefix to use when marshaling as XML.
+ */
+ public java.lang.String getNameSpacePrefix()
+ {
+ return _nsPrefix;
+ }
+
+ /**
+ * Method getNameSpaceURI.
+ *
+ * @return the namespace URI used when marshaling and unmarshaling as XML.
+ */
+ public java.lang.String getNameSpaceURI()
+ {
+ return _nsURI;
+ }
+
+ /**
+ * Method getValidator.
+ *
+ * @return a specific validator for the class described by this
+ * ClassDescriptor.
+ */
+ public org.exolab.castor.xml.TypeValidator getValidator()
+ {
+ return this;
+ }
+
+ /**
+ * Method getXMLName.
+ *
+ * @return the XML Name for the Class being described.
+ */
+ public java.lang.String getXMLName()
+ {
+ return _xmlName;
+ }
+
+ /**
+ * Method isElementDefinition.
+ *
+ * @return true if XML schema definition of this Class is that of a global
+ * element or element with anonymous type definition.
+ */
+ public boolean isElementDefinition()
+ {
+ return _elementDefinition;
+ }
+
+}
--- /dev/null
+/*
+ * This class was automatically generated with
+ * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
+ * Schema.
+ * $Id$
+ */
+
+package jalview.schemabinding.version2.descriptors;
+
+//---------------------------------/
+//- Imported classes and packages -/
+//---------------------------------/
+
+import jalview.schemabinding.version2.Filter;
+
+/**
+ * Class FilterDescriptor.
+ *
+ * @version $Revision$ $Date$
+ */
+public class FilterDescriptor
+ extends org.exolab.castor.xml.util.XMLClassDescriptorImpl
+{
+
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
+
+ /**
+ * Field _elementDefinition.
+ */
+ private boolean _elementDefinition;
+
+ /**
+ * Field _nsPrefix.
+ */
+ private java.lang.String _nsPrefix;
+
+ /**
+ * Field _nsURI.
+ */
+ private java.lang.String _nsURI;
+
+ /**
+ * Field _xmlName.
+ */
+ private java.lang.String _xmlName;
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public FilterDescriptor()
+ {
+ super();
+ _xmlName = "filter";
+ _elementDefinition = true;
+
+ // -- set grouping compositor
+ setCompositorAsSequence();
+ org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
+ org.exolab.castor.mapping.FieldHandler handler = null;
+ org.exolab.castor.xml.FieldValidator fieldValidator = null;
+ // -- initialize attribute descriptors
+
+ // -- _featureType
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.String.class, "_featureType", "featureType",
+ org.exolab.castor.xml.NodeType.Attribute);
+ desc.setImmutable(true);
+ handler = new org.exolab.castor.xml.XMLFieldHandler()
+ {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException
+ {
+ Filter target = (Filter) object;
+ return target.getFeatureType();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException
+ {
+ try
+ {
+ Filter target = (Filter) object;
+ target.setFeatureType((java.lang.String) value);
+ } catch (java.lang.Exception ex)
+ {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent)
+ {
+ return null;
+ }
+ };
+ desc.setHandler(handler);
+ desc.setRequired(true);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _featureType
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(1);
+ { // -- local scope
+ org.exolab.castor.xml.validators.StringValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.StringValidator();
+ fieldValidator.setValidator(typeValidator);
+ typeValidator.setWhiteSpace("preserve");
+ }
+ desc.setValidator(fieldValidator);
+ // -- initialize element descriptors
+
+ // -- _matcherSet
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ jalview.schemabinding.version2.MatcherSet.class, "_matcherSet",
+ "matcherSet", org.exolab.castor.xml.NodeType.Element);
+ handler = new org.exolab.castor.xml.XMLFieldHandler()
+ {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException
+ {
+ Filter target = (Filter) object;
+ return target.getMatcherSet();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException
+ {
+ try
+ {
+ Filter target = (Filter) object;
+ target.setMatcherSet(
+ (jalview.schemabinding.version2.MatcherSet) value);
+ } catch (java.lang.Exception ex)
+ {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent)
+ {
+ return new jalview.schemabinding.version2.MatcherSet();
+ }
+ };
+ desc.setHandler(handler);
+ desc.setRequired(true);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _matcherSet
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(1);
+ { // -- local scope
+ }
+ desc.setValidator(fieldValidator);
+ }
+
+ // -----------/
+ // - Methods -/
+ // -----------/
+
+ /**
+ * Method getAccessMode.
+ *
+ * @return the access mode specified for this class.
+ */
+ public org.exolab.castor.mapping.AccessMode getAccessMode()
+ {
+ return null;
+ }
+
+ /**
+ * Method getIdentity.
+ *
+ * @return the identity field, null if this class has no identity.
+ */
+ public org.exolab.castor.mapping.FieldDescriptor getIdentity()
+ {
+ return super.getIdentity();
+ }
+
+ /**
+ * Method getJavaClass.
+ *
+ * @return the Java class represented by this descriptor.
+ */
+ public java.lang.Class getJavaClass()
+ {
+ return jalview.schemabinding.version2.Filter.class;
+ }
+
+ /**
+ * Method getNameSpacePrefix.
+ *
+ * @return the namespace prefix to use when marshaling as XML.
+ */
+ public java.lang.String getNameSpacePrefix()
+ {
+ return _nsPrefix;
+ }
+
+ /**
+ * Method getNameSpaceURI.
+ *
+ * @return the namespace URI used when marshaling and unmarshaling as XML.
+ */
+ public java.lang.String getNameSpaceURI()
+ {
+ return _nsURI;
+ }
+
+ /**
+ * Method getValidator.
+ *
+ * @return a specific validator for the class described by this
+ * ClassDescriptor.
+ */
+ public org.exolab.castor.xml.TypeValidator getValidator()
+ {
+ return this;
+ }
+
+ /**
+ * Method getXMLName.
+ *
+ * @return the XML Name for the Class being described.
+ */
+ public java.lang.String getXMLName()
+ {
+ return _xmlName;
+ }
+
+ /**
+ * Method isElementDefinition.
+ *
+ * @return true if XML schema definition of this Class is that of a global
+ * element or element with anonymous type definition.
+ */
+ public boolean isElementDefinition()
+ {
+ return _elementDefinition;
+ }
+
+}
package jalview.schemabinding.version2.descriptors;
+import jalview.schemabinding.version2.Colour;
+import jalview.schemabinding.version2.Filter;
+
//---------------------------------/
//- Imported classes and packages -/
//---------------------------------/
-import jalview.schemabinding.version2.Colour;
import jalview.schemabinding.version2.JalviewUserColours;
/**
*
* @version $Revision$ $Date$
*/
-public class JalviewUserColoursDescriptor extends
- org.exolab.castor.xml.util.XMLClassDescriptorImpl
+public class JalviewUserColoursDescriptor
+ extends org.exolab.castor.xml.util.XMLClassDescriptorImpl
{
// --------------------------/
}
@Override
- public void resetValue(Object object) throws IllegalStateException,
- IllegalArgumentException
+ public void resetValue(Object object)
+ throws IllegalStateException, IllegalArgumentException
{
try
{
{ // -- local scope
}
desc.setValidator(fieldValidator);
+ // -- _filterList
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ Filter.class, "_filterList", "filter",
+ org.exolab.castor.xml.NodeType.Element);
+ handler = new org.exolab.castor.xml.XMLFieldHandler()
+ {
+ @Override
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException
+ {
+ JalviewUserColours target = (JalviewUserColours) object;
+ return target.getFilter();
+ }
+
+ @Override
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException
+ {
+ try
+ {
+ JalviewUserColours target = (JalviewUserColours) object;
+ target.addFilter((Filter) value);
+ } catch (java.lang.Exception ex)
+ {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
+
+ @Override
+ public void resetValue(Object object)
+ throws IllegalStateException, IllegalArgumentException
+ {
+ try
+ {
+ JalviewUserColours target = (JalviewUserColours) object;
+ target.removeAllFilter();
+ } catch (java.lang.Exception ex)
+ {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
+
+ @Override
+ public java.lang.Object newInstance(java.lang.Object parent)
+ {
+ return new Filter();
+ }
+ };
+ desc.setHandler(handler);
+ desc.setMultivalued(true);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _filterList
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(0);
+ { // -- local scope
+ }
+ desc.setValidator(fieldValidator);
}
// -----------/
--- /dev/null
+/*
+ * This class was automatically generated with
+ * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
+ * Schema.
+ * $Id$
+ */
+
+package jalview.schemabinding.version2.descriptors;
+
+//---------------------------------/
+//- Imported classes and packages -/
+//---------------------------------/
+
+import jalview.schemabinding.version2.MatchCondition;
+
+/**
+ * Class MatchConditionDescriptor.
+ *
+ * @version $Revision$ $Date$
+ */
+public class MatchConditionDescriptor extends
+ jalview.schemabinding.version2.descriptors.FeatureMatcherDescriptor
+{
+
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
+
+ /**
+ * Field _elementDefinition.
+ */
+ private boolean _elementDefinition;
+
+ /**
+ * Field _nsPrefix.
+ */
+ private java.lang.String _nsPrefix;
+
+ /**
+ * Field _nsURI.
+ */
+ private java.lang.String _nsURI;
+
+ /**
+ * Field _xmlName.
+ */
+ private java.lang.String _xmlName;
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public MatchConditionDescriptor()
+ {
+ super();
+ setExtendsWithoutFlatten(
+ new jalview.schemabinding.version2.descriptors.FeatureMatcherDescriptor());
+ _xmlName = "matchCondition";
+ _elementDefinition = true;
+ }
+
+ // -----------/
+ // - Methods -/
+ // -----------/
+
+ /**
+ * Method getAccessMode.
+ *
+ * @return the access mode specified for this class.
+ */
+ public org.exolab.castor.mapping.AccessMode getAccessMode()
+ {
+ return null;
+ }
+
+ /**
+ * Method getIdentity.
+ *
+ * @return the identity field, null if this class has no identity.
+ */
+ public org.exolab.castor.mapping.FieldDescriptor getIdentity()
+ {
+ return super.getIdentity();
+ }
+
+ /**
+ * Method getJavaClass.
+ *
+ * @return the Java class represented by this descriptor.
+ */
+ public java.lang.Class getJavaClass()
+ {
+ return jalview.schemabinding.version2.MatchCondition.class;
+ }
+
+ /**
+ * Method getNameSpacePrefix.
+ *
+ * @return the namespace prefix to use when marshaling as XML.
+ */
+ public java.lang.String getNameSpacePrefix()
+ {
+ return _nsPrefix;
+ }
+
+ /**
+ * Method getNameSpaceURI.
+ *
+ * @return the namespace URI used when marshaling and unmarshaling as XML.
+ */
+ public java.lang.String getNameSpaceURI()
+ {
+ return _nsURI;
+ }
+
+ /**
+ * Method getValidator.
+ *
+ * @return a specific validator for the class described by this
+ * ClassDescriptor.
+ */
+ public org.exolab.castor.xml.TypeValidator getValidator()
+ {
+ return this;
+ }
+
+ /**
+ * Method getXMLName.
+ *
+ * @return the XML Name for the Class being described.
+ */
+ public java.lang.String getXMLName()
+ {
+ return _xmlName;
+ }
+
+ /**
+ * Method isElementDefinition.
+ *
+ * @return true if XML schema definition of this Class is that of a global
+ * element or element with anonymous type definition.
+ */
+ public boolean isElementDefinition()
+ {
+ return _elementDefinition;
+ }
+
+}
--- /dev/null
+/*
+ * This class was automatically generated with
+ * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
+ * Schema.
+ * $Id$
+ */
+
+package jalview.schemabinding.version2.descriptors;
+
+//---------------------------------/
+//- Imported classes and packages -/
+//---------------------------------/
+
+import jalview.schemabinding.version2.MatcherSet;
+
+/**
+ * Class MatcherSetDescriptor.
+ *
+ * @version $Revision$ $Date$
+ */
+public class MatcherSetDescriptor extends
+ jalview.schemabinding.version2.descriptors.FeatureMatcherSetDescriptor
+{
+
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
+
+ /**
+ * Field _elementDefinition.
+ */
+ private boolean _elementDefinition;
+
+ /**
+ * Field _nsPrefix.
+ */
+ private java.lang.String _nsPrefix;
+
+ /**
+ * Field _nsURI.
+ */
+ private java.lang.String _nsURI;
+
+ /**
+ * Field _xmlName.
+ */
+ private java.lang.String _xmlName;
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public MatcherSetDescriptor()
+ {
+ super();
+ setExtendsWithoutFlatten(
+ new jalview.schemabinding.version2.descriptors.FeatureMatcherSetDescriptor());
+ _xmlName = "matcherSet";
+ _elementDefinition = true;
+ }
+
+ // -----------/
+ // - Methods -/
+ // -----------/
+
+ /**
+ * Method getAccessMode.
+ *
+ * @return the access mode specified for this class.
+ */
+ public org.exolab.castor.mapping.AccessMode getAccessMode()
+ {
+ return null;
+ }
+
+ /**
+ * Method getIdentity.
+ *
+ * @return the identity field, null if this class has no identity.
+ */
+ public org.exolab.castor.mapping.FieldDescriptor getIdentity()
+ {
+ return super.getIdentity();
+ }
+
+ /**
+ * Method getJavaClass.
+ *
+ * @return the Java class represented by this descriptor.
+ */
+ public java.lang.Class getJavaClass()
+ {
+ return jalview.schemabinding.version2.MatcherSet.class;
+ }
+
+ /**
+ * Method getNameSpacePrefix.
+ *
+ * @return the namespace prefix to use when marshaling as XML.
+ */
+ public java.lang.String getNameSpacePrefix()
+ {
+ return _nsPrefix;
+ }
+
+ /**
+ * Method getNameSpaceURI.
+ *
+ * @return the namespace URI used when marshaling and unmarshaling as XML.
+ */
+ public java.lang.String getNameSpaceURI()
+ {
+ return _nsURI;
+ }
+
+ /**
+ * Method getValidator.
+ *
+ * @return a specific validator for the class described by this
+ * ClassDescriptor.
+ */
+ public org.exolab.castor.xml.TypeValidator getValidator()
+ {
+ return this;
+ }
+
+ /**
+ * Method getXMLName.
+ *
+ * @return the XML Name for the Class being described.
+ */
+ public java.lang.String getXMLName()
+ {
+ return _xmlName;
+ }
+
+ /**
+ * Method isElementDefinition.
+ *
+ * @return true if XML schema definition of this Class is that of a global
+ * element or element with anonymous type definition.
+ */
+ public boolean isElementDefinition()
+ {
+ return _elementDefinition;
+ }
+
+}
--- /dev/null
+#Thu Dec 14 09:10:14 GMT 2017
+jalview.schemabinding.version2.types.ColourNoValueColourType=jalview.schemabinding.version2.types.descriptors.ColourNoValueColourTypeDescriptor
+jalview.schemabinding.version2.types.FeatureMatcherByType=jalview.schemabinding.version2.types.descriptors.FeatureMatcherByTypeDescriptor
+jalview.schemabinding.version2.types.ColourThreshTypeType=jalview.schemabinding.version2.types.descriptors.ColourThreshTypeTypeDescriptor
--- /dev/null
+/*
+ * This class was automatically generated with
+ * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
+ * Schema.
+ * $Id$
+ */
+
+package jalview.schemabinding.version2.types;
+
+ //---------------------------------/
+ //- Imported classes and packages -/
+//---------------------------------/
+
+import java.util.Hashtable;
+
+/**
+ * Class ColourNoValueColourType.
+ *
+ * @version $Revision$ $Date$
+ */
+public class ColourNoValueColourType implements java.io.Serializable {
+
+
+ //--------------------------/
+ //- Class/Member Variables -/
+ //--------------------------/
+
+ /**
+ * The None type
+ */
+ public static final int NONE_TYPE = 0;
+
+ /**
+ * The instance of the None type
+ */
+ public static final ColourNoValueColourType NONE = new ColourNoValueColourType(NONE_TYPE, "None");
+
+ /**
+ * The Min type
+ */
+ public static final int MIN_TYPE = 1;
+
+ /**
+ * The instance of the Min type
+ */
+ public static final ColourNoValueColourType MIN = new ColourNoValueColourType(MIN_TYPE, "Min");
+
+ /**
+ * The Max type
+ */
+ public static final int MAX_TYPE = 2;
+
+ /**
+ * The instance of the Max type
+ */
+ public static final ColourNoValueColourType MAX = new ColourNoValueColourType(MAX_TYPE, "Max");
+
+ /**
+ * Field _memberTable.
+ */
+ private static java.util.Hashtable _memberTable = init();
+
+ /**
+ * Field type.
+ */
+ private int type = -1;
+
+ /**
+ * Field stringValue.
+ */
+ private java.lang.String stringValue = null;
+
+
+ //----------------/
+ //- Constructors -/
+ //----------------/
+
+ private ColourNoValueColourType(final int type, final java.lang.String value) {
+ super();
+ this.type = type;
+ this.stringValue = value;
+ }
+
+
+ //-----------/
+ //- Methods -/
+ //-----------/
+
+ /**
+ * Method enumerate.Returns an enumeration of all possible
+ * instances of ColourNoValueColourType
+ *
+ * @return an Enumeration over all possible instances of
+ * ColourNoValueColourType
+ */
+ public static java.util.Enumeration enumerate(
+ ) {
+ return _memberTable.elements();
+ }
+
+ /**
+ * Method getType.Returns the type of this
+ * ColourNoValueColourType
+ *
+ * @return the type of this ColourNoValueColourType
+ */
+ public int getType(
+ ) {
+ return this.type;
+ }
+
+ /**
+ * Method init.
+ *
+ * @return the initialized Hashtable for the member table
+ */
+ private static java.util.Hashtable init(
+ ) {
+ Hashtable members = new Hashtable();
+ members.put("None", NONE);
+ members.put("Min", MIN);
+ members.put("Max", MAX);
+ return members;
+ }
+
+ /**
+ * Method readResolve. will be called during deserialization to
+ * replace the deserialized object with the correct constant
+ * instance.
+ *
+ * @return this deserialized object
+ */
+ private java.lang.Object readResolve(
+ ) {
+ return valueOf(this.stringValue);
+ }
+
+ /**
+ * Method toString.Returns the String representation of this
+ * ColourNoValueColourType
+ *
+ * @return the String representation of this
+ * ColourNoValueColourType
+ */
+ public java.lang.String toString(
+ ) {
+ return this.stringValue;
+ }
+
+ /**
+ * Method valueOf.Returns a new ColourNoValueColourType based
+ * on the given String value.
+ *
+ * @param string
+ * @return the ColourNoValueColourType value of parameter
+ * 'string'
+ */
+ public static jalview.schemabinding.version2.types.ColourNoValueColourType valueOf(
+ final java.lang.String string) {
+ java.lang.Object obj = null;
+ if (string != null) {
+ obj = _memberTable.get(string);
+ }
+ if (obj == null) {
+ String err = "" + string + " is not a valid ColourNoValueColourType";
+ throw new IllegalArgumentException(err);
+ }
+ return (ColourNoValueColourType) obj;
+ }
+
+}
--- /dev/null
+/*
+ * This class was automatically generated with
+ * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
+ * Schema.
+ * $Id$
+ */
+
+package jalview.schemabinding.version2.types;
+
+ //---------------------------------/
+ //- Imported classes and packages -/
+//---------------------------------/
+
+import java.util.Hashtable;
+
+/**
+ * Class ColourThreshTypeType.
+ *
+ * @version $Revision$ $Date$
+ */
+public class ColourThreshTypeType implements java.io.Serializable {
+
+
+ //--------------------------/
+ //- Class/Member Variables -/
+ //--------------------------/
+
+ /**
+ * The NONE type
+ */
+ public static final int NONE_TYPE = 0;
+
+ /**
+ * The instance of the NONE type
+ */
+ public static final ColourThreshTypeType NONE = new ColourThreshTypeType(NONE_TYPE, "NONE");
+
+ /**
+ * The ABOVE type
+ */
+ public static final int ABOVE_TYPE = 1;
+
+ /**
+ * The instance of the ABOVE type
+ */
+ public static final ColourThreshTypeType ABOVE = new ColourThreshTypeType(ABOVE_TYPE, "ABOVE");
+
+ /**
+ * The BELOW type
+ */
+ public static final int BELOW_TYPE = 2;
+
+ /**
+ * The instance of the BELOW type
+ */
+ public static final ColourThreshTypeType BELOW = new ColourThreshTypeType(BELOW_TYPE, "BELOW");
+
+ /**
+ * Field _memberTable.
+ */
+ private static java.util.Hashtable _memberTable = init();
+
+ /**
+ * Field type.
+ */
+ private int type = -1;
+
+ /**
+ * Field stringValue.
+ */
+ private java.lang.String stringValue = null;
+
+
+ //----------------/
+ //- Constructors -/
+ //----------------/
+
+ private ColourThreshTypeType(final int type, final java.lang.String value) {
+ super();
+ this.type = type;
+ this.stringValue = value;
+ }
+
+
+ //-----------/
+ //- Methods -/
+ //-----------/
+
+ /**
+ * Method enumerate.Returns an enumeration of all possible
+ * instances of ColourThreshTypeType
+ *
+ * @return an Enumeration over all possible instances of
+ * ColourThreshTypeType
+ */
+ public static java.util.Enumeration enumerate(
+ ) {
+ return _memberTable.elements();
+ }
+
+ /**
+ * Method getType.Returns the type of this ColourThreshTypeType
+ *
+ * @return the type of this ColourThreshTypeType
+ */
+ public int getType(
+ ) {
+ return this.type;
+ }
+
+ /**
+ * Method init.
+ *
+ * @return the initialized Hashtable for the member table
+ */
+ private static java.util.Hashtable init(
+ ) {
+ Hashtable members = new Hashtable();
+ members.put("NONE", NONE);
+ members.put("ABOVE", ABOVE);
+ members.put("BELOW", BELOW);
+ return members;
+ }
+
+ /**
+ * Method readResolve. will be called during deserialization to
+ * replace the deserialized object with the correct constant
+ * instance.
+ *
+ * @return this deserialized object
+ */
+ private java.lang.Object readResolve(
+ ) {
+ return valueOf(this.stringValue);
+ }
+
+ /**
+ * Method toString.Returns the String representation of this
+ * ColourThreshTypeType
+ *
+ * @return the String representation of this ColourThreshTypeTyp
+ */
+ public java.lang.String toString(
+ ) {
+ return this.stringValue;
+ }
+
+ /**
+ * Method valueOf.Returns a new ColourThreshTypeType based on
+ * the given String value.
+ *
+ * @param string
+ * @return the ColourThreshTypeType value of parameter 'string'
+ */
+ public static jalview.schemabinding.version2.types.ColourThreshTypeType valueOf(
+ final java.lang.String string) {
+ java.lang.Object obj = null;
+ if (string != null) {
+ obj = _memberTable.get(string);
+ }
+ if (obj == null) {
+ String err = "" + string + " is not a valid ColourThreshTypeType";
+ throw new IllegalArgumentException(err);
+ }
+ return (ColourThreshTypeType) obj;
+ }
+
+}
--- /dev/null
+/*
+ * This class was automatically generated with
+ * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
+ * Schema.
+ * $Id$
+ */
+
+package jalview.schemabinding.version2.types;
+
+ //---------------------------------/
+ //- Imported classes and packages -/
+//---------------------------------/
+
+import java.util.Hashtable;
+
+/**
+ * Class FeatureMatcherByType.
+ *
+ * @version $Revision$ $Date$
+ */
+public class FeatureMatcherByType implements java.io.Serializable {
+
+
+ //--------------------------/
+ //- Class/Member Variables -/
+ //--------------------------/
+
+ /**
+ * The byLabel type
+ */
+ public static final int BYLABEL_TYPE = 0;
+
+ /**
+ * The instance of the byLabel type
+ */
+ public static final FeatureMatcherByType BYLABEL = new FeatureMatcherByType(BYLABEL_TYPE, "byLabel");
+
+ /**
+ * The byScore type
+ */
+ public static final int BYSCORE_TYPE = 1;
+
+ /**
+ * The instance of the byScore type
+ */
+ public static final FeatureMatcherByType BYSCORE = new FeatureMatcherByType(BYSCORE_TYPE, "byScore");
+
+ /**
+ * The byAttribute type
+ */
+ public static final int BYATTRIBUTE_TYPE = 2;
+
+ /**
+ * The instance of the byAttribute type
+ */
+ public static final FeatureMatcherByType BYATTRIBUTE = new FeatureMatcherByType(BYATTRIBUTE_TYPE, "byAttribute");
+
+ /**
+ * Field _memberTable.
+ */
+ private static java.util.Hashtable _memberTable = init();
+
+ /**
+ * Field type.
+ */
+ private int type = -1;
+
+ /**
+ * Field stringValue.
+ */
+ private java.lang.String stringValue = null;
+
+
+ //----------------/
+ //- Constructors -/
+ //----------------/
+
+ private FeatureMatcherByType(final int type, final java.lang.String value) {
+ super();
+ this.type = type;
+ this.stringValue = value;
+ }
+
+
+ //-----------/
+ //- Methods -/
+ //-----------/
+
+ /**
+ * Method enumerate.Returns an enumeration of all possible
+ * instances of FeatureMatcherByType
+ *
+ * @return an Enumeration over all possible instances of
+ * FeatureMatcherByType
+ */
+ public static java.util.Enumeration enumerate(
+ ) {
+ return _memberTable.elements();
+ }
+
+ /**
+ * Method getType.Returns the type of this FeatureMatcherByType
+ *
+ * @return the type of this FeatureMatcherByType
+ */
+ public int getType(
+ ) {
+ return this.type;
+ }
+
+ /**
+ * Method init.
+ *
+ * @return the initialized Hashtable for the member table
+ */
+ private static java.util.Hashtable init(
+ ) {
+ Hashtable members = new Hashtable();
+ members.put("byLabel", BYLABEL);
+ members.put("byScore", BYSCORE);
+ members.put("byAttribute", BYATTRIBUTE);
+ return members;
+ }
+
+ /**
+ * Method readResolve. will be called during deserialization to
+ * replace the deserialized object with the correct constant
+ * instance.
+ *
+ * @return this deserialized object
+ */
+ private java.lang.Object readResolve(
+ ) {
+ return valueOf(this.stringValue);
+ }
+
+ /**
+ * Method toString.Returns the String representation of this
+ * FeatureMatcherByType
+ *
+ * @return the String representation of this FeatureMatcherByTyp
+ */
+ public java.lang.String toString(
+ ) {
+ return this.stringValue;
+ }
+
+ /**
+ * Method valueOf.Returns a new FeatureMatcherByType based on
+ * the given String value.
+ *
+ * @param string
+ * @return the FeatureMatcherByType value of parameter 'string'
+ */
+ public static jalview.schemabinding.version2.types.FeatureMatcherByType valueOf(
+ final java.lang.String string) {
+ java.lang.Object obj = null;
+ if (string != null) {
+ obj = _memberTable.get(string);
+ }
+ if (obj == null) {
+ String err = "" + string + " is not a valid FeatureMatcherByType";
+ throw new IllegalArgumentException(err);
+ }
+ return (FeatureMatcherByType) obj;
+ }
+
+}
--- /dev/null
+/*
+ * This class was automatically generated with
+ * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
+ * Schema.
+ * $Id$
+ */
+
+package jalview.schemabinding.version2.types.descriptors;
+
+ //---------------------------------/
+ //- Imported classes and packages -/
+//---------------------------------/
+
+import jalview.schemabinding.version2.types.ColourNoValueColourType;
+
+/**
+ * Class ColourNoValueColourTypeDescriptor.
+ *
+ * @version $Revision$ $Date$
+ */
+public class ColourNoValueColourTypeDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl {
+
+
+ //--------------------------/
+ //- Class/Member Variables -/
+ //--------------------------/
+
+ /**
+ * Field _elementDefinition.
+ */
+ private boolean _elementDefinition;
+
+ /**
+ * Field _nsPrefix.
+ */
+ private java.lang.String _nsPrefix;
+
+ /**
+ * Field _nsURI.
+ */
+ private java.lang.String _nsURI;
+
+ /**
+ * Field _xmlName.
+ */
+ private java.lang.String _xmlName;
+
+
+ //----------------/
+ //- Constructors -/
+ //----------------/
+
+ public ColourNoValueColourTypeDescriptor() {
+ super();
+ _nsURI = "www.jalview.org/colours";
+ _xmlName = "ColourNoValueColourType";
+ _elementDefinition = false;
+ }
+
+
+ //-----------/
+ //- Methods -/
+ //-----------/
+
+ /**
+ * Method getAccessMode.
+ *
+ * @return the access mode specified for this class.
+ */
+ public org.exolab.castor.mapping.AccessMode getAccessMode(
+ ) {
+ return null;
+ }
+
+ /**
+ * Method getIdentity.
+ *
+ * @return the identity field, null if this class has no
+ * identity.
+ */
+ public org.exolab.castor.mapping.FieldDescriptor getIdentity(
+ ) {
+ return super.getIdentity();
+ }
+
+ /**
+ * Method getJavaClass.
+ *
+ * @return the Java class represented by this descriptor.
+ */
+ public java.lang.Class getJavaClass(
+ ) {
+ return jalview.schemabinding.version2.types.ColourNoValueColourType.class;
+ }
+
+ /**
+ * Method getNameSpacePrefix.
+ *
+ * @return the namespace prefix to use when marshaling as XML.
+ */
+ public java.lang.String getNameSpacePrefix(
+ ) {
+ return _nsPrefix;
+ }
+
+ /**
+ * Method getNameSpaceURI.
+ *
+ * @return the namespace URI used when marshaling and
+ * unmarshaling as XML.
+ */
+ public java.lang.String getNameSpaceURI(
+ ) {
+ return _nsURI;
+ }
+
+ /**
+ * Method getValidator.
+ *
+ * @return a specific validator for the class described by this
+ * ClassDescriptor.
+ */
+ public org.exolab.castor.xml.TypeValidator getValidator(
+ ) {
+ return this;
+ }
+
+ /**
+ * Method getXMLName.
+ *
+ * @return the XML Name for the Class being described.
+ */
+ public java.lang.String getXMLName(
+ ) {
+ return _xmlName;
+ }
+
+ /**
+ * Method isElementDefinition.
+ *
+ * @return true if XML schema definition of this Class is that
+ * of a global
+ * element or element with anonymous type definition.
+ */
+ public boolean isElementDefinition(
+ ) {
+ return _elementDefinition;
+ }
+
+}
--- /dev/null
+/*
+ * This class was automatically generated with
+ * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
+ * Schema.
+ * $Id$
+ */
+
+package jalview.schemabinding.version2.types.descriptors;
+
+ //---------------------------------/
+ //- Imported classes and packages -/
+//---------------------------------/
+
+import jalview.schemabinding.version2.types.ColourThreshTypeType;
+
+/**
+ * Class ColourThreshTypeTypeDescriptor.
+ *
+ * @version $Revision$ $Date$
+ */
+public class ColourThreshTypeTypeDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl {
+
+
+ //--------------------------/
+ //- Class/Member Variables -/
+ //--------------------------/
+
+ /**
+ * Field _elementDefinition.
+ */
+ private boolean _elementDefinition;
+
+ /**
+ * Field _nsPrefix.
+ */
+ private java.lang.String _nsPrefix;
+
+ /**
+ * Field _nsURI.
+ */
+ private java.lang.String _nsURI;
+
+ /**
+ * Field _xmlName.
+ */
+ private java.lang.String _xmlName;
+
+
+ //----------------/
+ //- Constructors -/
+ //----------------/
+
+ public ColourThreshTypeTypeDescriptor() {
+ super();
+ _nsURI = "www.jalview.org/colours";
+ _xmlName = "ColourThreshTypeType";
+ _elementDefinition = false;
+ }
+
+
+ //-----------/
+ //- Methods -/
+ //-----------/
+
+ /**
+ * Method getAccessMode.
+ *
+ * @return the access mode specified for this class.
+ */
+ public org.exolab.castor.mapping.AccessMode getAccessMode(
+ ) {
+ return null;
+ }
+
+ /**
+ * Method getIdentity.
+ *
+ * @return the identity field, null if this class has no
+ * identity.
+ */
+ public org.exolab.castor.mapping.FieldDescriptor getIdentity(
+ ) {
+ return super.getIdentity();
+ }
+
+ /**
+ * Method getJavaClass.
+ *
+ * @return the Java class represented by this descriptor.
+ */
+ public java.lang.Class getJavaClass(
+ ) {
+ return jalview.schemabinding.version2.types.ColourThreshTypeType.class;
+ }
+
+ /**
+ * Method getNameSpacePrefix.
+ *
+ * @return the namespace prefix to use when marshaling as XML.
+ */
+ public java.lang.String getNameSpacePrefix(
+ ) {
+ return _nsPrefix;
+ }
+
+ /**
+ * Method getNameSpaceURI.
+ *
+ * @return the namespace URI used when marshaling and
+ * unmarshaling as XML.
+ */
+ public java.lang.String getNameSpaceURI(
+ ) {
+ return _nsURI;
+ }
+
+ /**
+ * Method getValidator.
+ *
+ * @return a specific validator for the class described by this
+ * ClassDescriptor.
+ */
+ public org.exolab.castor.xml.TypeValidator getValidator(
+ ) {
+ return this;
+ }
+
+ /**
+ * Method getXMLName.
+ *
+ * @return the XML Name for the Class being described.
+ */
+ public java.lang.String getXMLName(
+ ) {
+ return _xmlName;
+ }
+
+ /**
+ * Method isElementDefinition.
+ *
+ * @return true if XML schema definition of this Class is that
+ * of a global
+ * element or element with anonymous type definition.
+ */
+ public boolean isElementDefinition(
+ ) {
+ return _elementDefinition;
+ }
+
+}
--- /dev/null
+/*
+ * This class was automatically generated with
+ * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
+ * Schema.
+ * $Id$
+ */
+
+package jalview.schemabinding.version2.types.descriptors;
+
+ //---------------------------------/
+ //- Imported classes and packages -/
+//---------------------------------/
+
+import jalview.schemabinding.version2.types.FeatureMatcherByType;
+
+/**
+ * Class FeatureMatcherByTypeDescriptor.
+ *
+ * @version $Revision$ $Date$
+ */
+public class FeatureMatcherByTypeDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl {
+
+
+ //--------------------------/
+ //- Class/Member Variables -/
+ //--------------------------/
+
+ /**
+ * Field _elementDefinition.
+ */
+ private boolean _elementDefinition;
+
+ /**
+ * Field _nsPrefix.
+ */
+ private java.lang.String _nsPrefix;
+
+ /**
+ * Field _nsURI.
+ */
+ private java.lang.String _nsURI;
+
+ /**
+ * Field _xmlName.
+ */
+ private java.lang.String _xmlName;
+
+
+ //----------------/
+ //- Constructors -/
+ //----------------/
+
+ public FeatureMatcherByTypeDescriptor() {
+ super();
+ _nsURI = "www.jalview.org/colours";
+ _xmlName = "FeatureMatcherByType";
+ _elementDefinition = false;
+ }
+
+
+ //-----------/
+ //- Methods -/
+ //-----------/
+
+ /**
+ * Method getAccessMode.
+ *
+ * @return the access mode specified for this class.
+ */
+ public org.exolab.castor.mapping.AccessMode getAccessMode(
+ ) {
+ return null;
+ }
+
+ /**
+ * Method getIdentity.
+ *
+ * @return the identity field, null if this class has no
+ * identity.
+ */
+ public org.exolab.castor.mapping.FieldDescriptor getIdentity(
+ ) {
+ return super.getIdentity();
+ }
+
+ /**
+ * Method getJavaClass.
+ *
+ * @return the Java class represented by this descriptor.
+ */
+ public java.lang.Class getJavaClass(
+ ) {
+ return jalview.schemabinding.version2.types.FeatureMatcherByType.class;
+ }
+
+ /**
+ * Method getNameSpacePrefix.
+ *
+ * @return the namespace prefix to use when marshaling as XML.
+ */
+ public java.lang.String getNameSpacePrefix(
+ ) {
+ return _nsPrefix;
+ }
+
+ /**
+ * Method getNameSpaceURI.
+ *
+ * @return the namespace URI used when marshaling and
+ * unmarshaling as XML.
+ */
+ public java.lang.String getNameSpaceURI(
+ ) {
+ return _nsURI;
+ }
+
+ /**
+ * Method getValidator.
+ *
+ * @return a specific validator for the class described by this
+ * ClassDescriptor.
+ */
+ public org.exolab.castor.xml.TypeValidator getValidator(
+ ) {
+ return this;
+ }
+
+ /**
+ * Method getXMLName.
+ *
+ * @return the XML Name for the Class being described.
+ */
+ public java.lang.String getXMLName(
+ ) {
+ return _xmlName;
+ }
+
+ /**
+ * Method isElementDefinition.
+ *
+ * @return true if XML schema definition of this Class is that
+ * of a global
+ * element or element with anonymous type definition.
+ */
+ public boolean isElementDefinition(
+ ) {
+ return _elementDefinition;
+ }
+
+}