</xs:attribute>
<xs:attribute name="RGB" type="xs:string" use="required"/>
<xs:attribute name="minRGB" type="xs:string" use="optional"/>
- <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="noValueColour" use="optional" type="jalview:NoValueColour" default="Min" />
<xs:attribute name="threshType" use="optional">
<xs:simpleType>
<xs:restriction base="xs:string">
</xs:attribute>
</xs:complexType>
+ <xs:simpleType name="NoValueColour">
+ <xs:annotation>
+ <xs:documentation>Graduated feature colour if no score (or attribute) value</xs:documentation>
+ </xs:annotation>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="None" />
+ <xs:enumeration value="Min" />
+ <xs:enumeration value="Max" />
+ </xs:restriction>
+ </xs:simpleType>
</xs:schema>
<xs:sequence>
<xs:element name="setting" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
+ <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:element name="matcherSet" minOccurs="0" type="jalview:FeatureMatcherSet">
+ <xs:annotation>
+ <xs:documentation>optional filter(s) applied to the feature type</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:sequence>
<xs:attribute name="type" type="xs:string" use="required" />
<xs:attribute name="colour" type="xs:int" use="required" />
<xs:attribute name="display" type="xs:boolean"
</xs:documentation>
</xs:annotation>
</xs:attribute>
+ <xs:attribute name="noValueColour" use="optional" type="jalview:NoValueColour" default="Min" />
<xs:attribute name="threshold" type="xs:float"
use="optional">
<xs:annotation>
+++ /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;
+
+/**
+ * Graduated feature colour if no score (or attribute) value
+ *
+ * @version $Revision$ $Date$
+ */
+public class NoValueColour 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 NoValueColour NONE = new NoValueColour(NONE_TYPE,
+ "None");
+
+ /**
+ * The Min type
+ */
+ public static final int MIN_TYPE = 1;
+
+ /**
+ * The instance of the Min type
+ */
+ public static final NoValueColour MIN = new NoValueColour(MIN_TYPE,
+ "Min");
+
+ /**
+ * The Max type
+ */
+ public static final int MAX_TYPE = 2;
+
+ /**
+ * The instance of the Max type
+ */
+ public static final NoValueColour MAX = new NoValueColour(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 NoValueColour(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
+ * NoValueColour
+ *
+ * @return an Enumeration over all possible instances of NoValueColour
+ */
+ public static java.util.Enumeration enumerate()
+ {
+ return _memberTable.elements();
+ }
+
+ /**
+ * Method getType.Returns the type of this NoValueColour
+ *
+ * @return the type of this NoValueColour
+ */
+ 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 NoValueColour
+ *
+ * @return the String representation of this NoValueColour
+ */
+ public java.lang.String toString()
+ {
+ return this.stringValue;
+ }
+
+ /**
+ * Method valueOf.Returns a new NoValueColour based on the given String value.
+ *
+ * @param string
+ * @return the NoValueColour value of parameter 'string'
+ */
+ public static jalview.binding.types.NoValueColour 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 NoValueColour";
+ throw new IllegalArgumentException(err);
+ }
+ return (NoValueColour) obj;
+ }
+
+}
import jalview.api.FeatureColourI;
import jalview.api.FeatureSettingsControllerI;
-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.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;
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
for (int i = jucs.getColourCount() - 1; i >= 0; i--)
{
jalview.schemabinding.version2.Colour newcol = jucs.getColour(i);
- FeatureColourI colour = unmarshalColour(newcol);
+ FeatureColourI colour = Jalview2XML.unmarshalColour(newcol);
fr.setColour(newcol.getName(), colour);
fr.setOrder(newcol.getName(), i / (float) jucs.getColourCount());
}
{
jalview.schemabinding.version2.Filter filterModel = jucs
.getFilter(i);
- FeatureMatcherSetI filter = unmarshalFilter(filterModel);
+ String featureType = filterModel.getFeatureType();
+ FeatureMatcherSetI filter = Jalview2XML.unmarshalFilter(featureType,
+ filterModel.getMatcherSet());
if (!filter.isEmpty())
{
- fr.setFeatureFilter(filterModel.getFeatureType(), filter);
+ fr.setFeatureFilter(featureType, filter);
}
}
for (String featureType : sortedTypes)
{
FeatureColourI fcol = fr.getFeatureStyle(featureType);
- jalview.schemabinding.version2.Colour col = marshalColour(
+ jalview.schemabinding.version2.Colour col = Jalview2XML.marshalColour(
featureType, fcol);
ucs.addColour(col);
}
{
Iterator<FeatureMatcherI> iterator = filter.getMatchers().iterator();
FeatureMatcherI firstMatcher = iterator.next();
- MatcherSet ms = marshalFilter(firstMatcher, iterator,
+ MatcherSet ms = Jalview2XML.marshalFilter(firstMatcher, iterator,
filter.isAnded());
Filter filterModel = new Filter();
filterModel.setFeatureType(featureType);
import jalview.datamodel.SequenceI;
import jalview.datamodel.StructureViewerModel;
import jalview.datamodel.StructureViewerModel.StructureData;
+import jalview.datamodel.features.FeatureMatcher;
+import jalview.datamodel.features.FeatureMatcherI;
+import jalview.datamodel.features.FeatureMatcherSet;
+import jalview.datamodel.features.FeatureMatcherSetI;
import jalview.ext.varna.RnaModel;
import jalview.gui.StructureViewer.ViewerType;
import jalview.io.DataSourceType;
import jalview.schemabinding.version2.AnnotationColours;
import jalview.schemabinding.version2.AnnotationElement;
import jalview.schemabinding.version2.CalcIdParam;
+import jalview.schemabinding.version2.Colour;
+import jalview.schemabinding.version2.CompoundMatcher;
import jalview.schemabinding.version2.DBRef;
import jalview.schemabinding.version2.Features;
import jalview.schemabinding.version2.Group;
import jalview.schemabinding.version2.MapListTo;
import jalview.schemabinding.version2.Mapping;
import jalview.schemabinding.version2.MappingChoice;
+import jalview.schemabinding.version2.MatchCondition;
+import jalview.schemabinding.version2.MatcherSet;
import jalview.schemabinding.version2.OtherData;
import jalview.schemabinding.version2.PdbentryItem;
import jalview.schemabinding.version2.Pdbids;
import jalview.schemabinding.version2.Tree;
import jalview.schemabinding.version2.UserColours;
import jalview.schemabinding.version2.Viewport;
+import jalview.schemabinding.version2.types.ColourThreshTypeType;
+import jalview.schemabinding.version2.types.FeatureMatcherByType;
+import jalview.schemabinding.version2.types.NoValueColour;
import jalview.schemes.AnnotationColourGradient;
import jalview.schemes.ColourSchemeI;
import jalview.schemes.ColourSchemeProperty;
import jalview.schemes.UserColourScheme;
import jalview.structure.StructureSelectionManager;
import jalview.structures.models.AAStructureBindingModel;
+import jalview.util.Format;
import jalview.util.MessageManager;
import jalview.util.Platform;
import jalview.util.StringUtils;
import jalview.util.jarInputStreamProvider;
+import jalview.util.matcher.Condition;
import jalview.viewmodel.AlignmentViewport;
import jalview.viewmodel.ViewportRanges;
import jalview.viewmodel.seqfeatures.FeatureRendererSettings;
import java.net.URL;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Collections;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.HashSet;
{
jalview.schemabinding.version2.FeatureSettings fs = new jalview.schemabinding.version2.FeatureSettings();
- String[] renderOrder = ap.getSeqPanel().seqCanvas
- .getFeatureRenderer().getRenderOrder()
- .toArray(new String[0]);
+ FeatureRenderer fr = ap.getSeqPanel().seqCanvas
+ .getFeatureRenderer();
+ String[] renderOrder = fr.getRenderOrder().toArray(new String[0]);
Vector<String> settingsAdded = new Vector<>();
if (renderOrder != null)
{
for (String featureType : renderOrder)
{
- FeatureColourI fcol = ap.getSeqPanel().seqCanvas
- .getFeatureRenderer().getFeatureStyle(featureType);
Setting setting = new Setting();
setting.setType(featureType);
+
+ /*
+ * save any filter for the feature type
+ */
+ FeatureMatcherSetI filter = fr.getFeatureFilter(featureType);
+ if (filter != null) {
+ Iterator<FeatureMatcherI> filters = filter.getMatchers().iterator();
+ FeatureMatcherI firstFilter = filters.next();
+ setting.setMatcherSet(Jalview2XML.marshalFilter(
+ firstFilter, filters, filter.isAnded()));
+ }
+
+ /*
+ * save colour scheme for the feature type
+ */
+ FeatureColourI fcol = fr.getFeatureStyle(featureType);
if (!fcol.isSimpleColour())
{
setting.setColour(fcol.getMaxColour().getRGB());
setting.setMin(fcol.getMin());
setting.setMax(fcol.getMax());
setting.setColourByLabel(fcol.isColourByLabel());
+ if (fcol.isColourByAttribute())
+ {
+ setting.setAttributeName(fcol.getAttributeName());
+ }
setting.setAutoScale(fcol.isAutoScaled());
setting.setThreshold(fcol.getThreshold());
+ Color noColour = fcol.getNoColour();
+ if (noColour == null)
+ {
+ setting.setNoValueColour(NoValueColour.NONE);
+ }
+ else if (noColour.equals(fcol.getMaxColour()))
+ {
+ setting.setNoValueColour(NoValueColour.MAX);
+ }
+ else
+ {
+ setting.setNoValueColour(NoValueColour.MIN);
+ }
// -1 = No threshold, 0 = Below, 1 = Above
setting.setThreshstate(fcol.isAboveThreshold() ? 1
: (fcol.isBelowThreshold() ? 0 : -1));
setting.setDisplay(
av.getFeaturesDisplayed().isVisible(featureType));
- float rorder = ap.getSeqPanel().seqCanvas.getFeatureRenderer()
+ float rorder = fr
.getOrder(featureType);
if (rorder > -1)
{
}
// is groups actually supposed to be a map here ?
- Iterator<String> en = ap.getSeqPanel().seqCanvas
- .getFeatureRenderer().getFeatureGroups().iterator();
+ Iterator<String> en = fr.getFeatureGroups().iterator();
Vector<String> groupsAdded = new Vector<>();
while (en.hasNext())
{
}
Group g = new Group();
g.setName(grp);
- g.setDisplay(((Boolean) ap.getSeqPanel().seqCanvas
- .getFeatureRenderer().checkGroupVisibility(grp, false))
+ g.setDisplay(((Boolean) fr.checkGroupVisibility(grp, false))
.booleanValue());
fs.addGroup(g);
groupsAdded.addElement(grp);
af.viewport.setShowGroupConservation(false);
}
- // recover featre settings
+ // recover feature settings
if (jms.getFeatureSettings() != null)
{
+ FeatureRenderer fr = af.alignPanel.getSeqPanel().seqCanvas
+ .getFeatureRenderer();
FeaturesDisplayed fdi;
af.viewport.setFeaturesDisplayed(fdi = new FeaturesDisplayed());
String[] renderOrder = new String[jms.getFeatureSettings()
.getSettingCount(); fs++)
{
Setting setting = jms.getFeatureSettings().getSetting(fs);
+ String featureType = setting.getType();
+
+ /*
+ * restore feature filters (if any)
+ */
+ MatcherSet filters = setting.getMatcherSet();
+ if (filters != null)
+ {
+ FeatureMatcherSetI filter = Jalview2XML
+ .unmarshalFilter(featureType, filters);
+ if (!filter.isEmpty())
+ {
+ fr.setFeatureFilter(featureType, filter);
+ }
+ }
+
+ /*
+ * restore feature colour scheme
+ */
+ Color maxColour = new Color(setting.getColour());
if (setting.hasMincolour())
{
- FeatureColourI gc = setting.hasMin()
- ? new FeatureColour(new Color(setting.getMincolour()),
- new Color(setting.getColour()), setting.getMin(),
- setting.getMax())
- : new FeatureColour(new Color(setting.getMincolour()),
- new Color(setting.getColour()), 0, 1);
+ /*
+ * minColour is always set unless a simple colour
+ * (including for colour by label though it doesn't use it)
+ */
+ Color minColour = new Color(setting.getMincolour());
+ Color noValueColour = minColour;
+ NoValueColour noColour = setting.getNoValueColour();
+ if (noColour == NoValueColour.NONE)
+ {
+ noValueColour = null;
+ }
+ else if (noColour == NoValueColour.MAX)
+ {
+ noValueColour = maxColour;
+ }
+ float min = setting.hasMin() ? setting.getMin() : 0f;
+ float max = setting.hasMin() ? setting.getMax() : 1f;
+ FeatureColourI gc = new FeatureColour(minColour, maxColour,
+ noValueColour, min, max);
+ if (setting.getAttributeNameCount() > 0)
+ {
+ gc.setAttributeName(setting.getAttributeName());
+ }
if (setting.hasThreshold())
{
gc.setThreshold(setting.getThreshold());
gc.setColourByLabel(setting.getColourByLabel());
}
// and put in the feature colour table.
- featureColours.put(setting.getType(), gc);
+ featureColours.put(featureType, gc);
}
else
{
- featureColours.put(setting.getType(),
- new FeatureColour(new Color(setting.getColour())));
+ featureColours.put(featureType,
+ new FeatureColour(maxColour));
}
- renderOrder[fs] = setting.getType();
+ renderOrder[fs] = featureType;
if (setting.hasOrder())
{
- featureOrder.put(setting.getType(), setting.getOrder());
+ featureOrder.put(featureType, setting.getOrder());
}
else
{
- featureOrder.put(setting.getType(), new Float(
+ featureOrder.put(featureType, new Float(
fs / jms.getFeatureSettings().getSettingCount()));
}
if (setting.getDisplay())
{
- fdi.setVisible(setting.getType());
+ fdi.setVisible(featureType);
}
}
Map<String, Boolean> fgtable = new Hashtable<>();
// jms.getFeatureSettings().getTransparency() : 0.0, featureOrder);
FeatureRendererSettings frs = new FeatureRendererSettings(renderOrder,
fgtable, featureColours, 1.0f, featureOrder);
- af.alignPanel.getSeqPanel().seqCanvas.getFeatureRenderer()
- .transferSettings(frs);
-
+ fr.transferSettings(frs);
}
if (view.getHiddenColumnsCount() > 0)
{
return counter++;
}
+
+ /**
+ * 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(NoValueColour.NONE);
+ }
+ else if (noColour == fcol.getMaxColour())
+ {
+ col.setNoValueColour(NoValueColour.MAX);
+ }
+ else
+ {
+ col.setNoValueColour(NoValueColour.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 featureType
+ * @param matcherSetModel
+ * @return
+ */
+ protected static FeatureMatcherSetI unmarshalFilter(
+ String featureType, MatcherSet matcherSetModel)
+ {
+ FeatureMatcherSetI result = new FeatureMatcherSet();
+ 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",
+ featureType, 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);
+ }
+
+ NoValueColour noCol = colourModel.getNoValueColour();
+ if (noCol == NoValueColour.MIN)
+ {
+ noValueColour = mincol;
+ }
+ else if (noCol == NoValueColour.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;
+ }
}
private java.lang.String _minRGB;
/**
- * Colour if no attribute or score value
+ * Field _noValueColour.
*/
- private jalview.schemabinding.version2.types.ColourNoValueColourType _noValueColour = jalview.schemabinding.version2.types.ColourNoValueColourType
+ private jalview.schemabinding.version2.types.NoValueColour _noValueColour = jalview.schemabinding.version2.types.NoValueColour
.valueOf("Min");
/**
public Colour()
{
super();
- setNoValueColour(
- jalview.schemabinding.version2.types.ColourNoValueColourType
- .valueOf("Min"));
+ setNoValueColour(jalview.schemabinding.version2.types.NoValueColour
+ .valueOf("Min"));
this._attributeNameList = new java.util.Vector();
}
}
/**
- * Returns the value of field 'noValueColour'. The field 'noValueColour' has
- * the following description: Colour if no attribute or score value
+ * Returns the value of field 'noValueColour'.
*
* @return the value of field 'NoValueColour'.
*/
- public jalview.schemabinding.version2.types.ColourNoValueColourType getNoValueColour()
+ public jalview.schemabinding.version2.types.NoValueColour getNoValueColour()
{
return this._noValueColour;
}
}
/**
- * Sets the value of field 'noValueColour'. The field 'noValueColour' has the
- * following description: Colour if no attribute or score value
+ * Sets the value of field 'noValueColour'.
*
* @param noValueColour
* the value of field 'noValueColour'.
*/
public void setNoValueColour(
- final jalview.schemabinding.version2.types.ColourNoValueColourType noValueColour)
+ final jalview.schemabinding.version2.types.NoValueColour noValueColour)
{
this._noValueColour = noValueColour;
}
/**
* Field _matchCondition.
*/
- private jalview.schemabinding.version2.MatchCondition _matchCondition;
+ private MatchCondition _matchCondition;
/**
* Field _compoundMatcher.
*/
- private jalview.schemabinding.version2.CompoundMatcher _compoundMatcher;
+ private CompoundMatcher _compoundMatcher;
// ----------------/
// - Constructors -/
*
* @return the value of field 'CompoundMatcher'.
*/
- public jalview.schemabinding.version2.CompoundMatcher getCompoundMatcher()
+ public CompoundMatcher getCompoundMatcher()
{
return this._compoundMatcher;
}
*
* @return the value of field 'MatchCondition'.
*/
- public jalview.schemabinding.version2.MatchCondition getMatchCondition()
+ public MatchCondition getMatchCondition()
{
return this._matchCondition;
}
* @param compoundMatcher
* the value of field 'compoundMatcher'.
*/
- public void setCompoundMatcher(
- final jalview.schemabinding.version2.CompoundMatcher compoundMatcher)
+ public void setCompoundMatcher(final CompoundMatcher compoundMatcher)
{
this._compoundMatcher = compoundMatcher;
this._choiceValue = compoundMatcher;
* @param matchCondition
* the value of field 'matchCondition'.
*/
- public void setMatchCondition(
- final jalview.schemabinding.version2.MatchCondition matchCondition)
+ public void setMatchCondition(final MatchCondition matchCondition)
{
this._matchCondition = matchCondition;
this._choiceValue = matchCondition;
import org.exolab.castor.xml.Unmarshaller;
/**
- * Class MatcherSet.
+ * optional filter(s) applied to the feature type
*
* @version $Revision$ $Date$
*/
private boolean _has_mincolour;
/**
+ * Field _noValueColour.
+ */
+ private jalview.schemabinding.version2.types.NoValueColour _noValueColour = jalview.schemabinding.version2.types.NoValueColour
+ .valueOf("Min");
+
+ /**
* threshold value for graduated feature colour
*
*/
*/
private boolean _has_autoScale;
+ /**
+ * name of feature attribute to colour by, or attribute and sub-attribute
+ */
+ private java.util.Vector _attributeNameList;
+
+ /**
+ * optional filter(s) applied to the feature type
+ */
+ private jalview.schemabinding.version2.MatcherSet _matcherSet;
+
// ----------------/
// - Constructors -/
// ----------------/
public Setting()
{
super();
+ setNoValueColour(jalview.schemabinding.version2.types.NoValueColour
+ .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 deleteColour()
{
this._has_colour = false;
}
/**
- */
+ */
public void deleteColourByLabel()
{
this._has_colourByLabel = false;
}
/**
- */
+ */
public void deleteDisplay()
{
this._has_display = false;
}
/**
- */
+ */
public void deleteMax()
{
this._has_max = false;
}
/**
- */
+ */
public void deleteMin()
{
this._has_min = false;
}
/**
- */
+ */
public void deleteMincolour()
{
this._has_mincolour = false;
}
/**
- */
+ */
public void deleteOrder()
{
this._has_order = false;
}
/**
- */
+ */
public void deleteThreshold()
{
this._has_threshold = false;
}
/**
- */
+ */
public void deleteThreshstate()
{
this._has_threshstate = 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 'matcherSet'. The field 'matcherSet' has the
+ * following description: optional filter(s) applied to the feature type
+ *
+ * @return the value of field 'MatcherSet'.
+ */
+ public jalview.schemabinding.version2.MatcherSet getMatcherSet()
+ {
+ return this._matcherSet;
+ }
+
+ /**
* Returns the value of field 'max'.
*
* @return the value of field 'Max'.
}
/**
+ * Returns the value of field 'noValueColour'.
+ *
+ * @return the value of field 'NoValueColour'.
+ */
+ public jalview.schemabinding.version2.types.NoValueColour getNoValueColour()
+ {
+ return this._noValueColour;
+ }
+
+ /**
* Returns the value of field 'order'.
*
* @return the value of field 'Order'.
}
/**
+ */
+ 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 'matcherSet'. The field 'matcherSet' has the
+ * following description: optional filter(s) applied to the feature type
+ *
+ * @param matcherSet
+ * the value of field 'matcherSet'.
+ */
+ public void setMatcherSet(
+ final jalview.schemabinding.version2.MatcherSet matcherSet)
+ {
+ this._matcherSet = matcherSet;
+ }
+
+ /**
* Sets the value of field 'max'.
*
* @param max
}
/**
+ * Sets the value of field 'noValueColour'.
+ *
+ * @param noValueColour
+ * the value of field 'noValueColour'.
+ */
+ public void setNoValueColour(
+ final jalview.schemabinding.version2.types.NoValueColour noValueColour)
+ {
+ this._noValueColour = noValueColour;
+ }
+
+ /**
* Sets the value of field 'order'.
*
* @param order
desc.setValidator(fieldValidator);
// -- _noValueColour
desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
- jalview.schemabinding.version2.types.ColourNoValueColourType.class,
+ jalview.schemabinding.version2.types.NoValueColour.class,
"_noValueColour", "noValueColour",
org.exolab.castor.xml.NodeType.Attribute);
handler = new org.exolab.castor.xml.XMLFieldHandler()
{
Colour target = (Colour) object;
target.setNoValueColour(
- (jalview.schemabinding.version2.types.ColourNoValueColourType) value);
+ (jalview.schemabinding.version2.types.NoValueColour) value);
} catch (java.lang.Exception ex)
{
throw new IllegalStateException(ex.toString());
}
};
handler = new org.exolab.castor.xml.handlers.EnumFieldHandler(
- jalview.schemabinding.version2.types.ColourNoValueColourType.class,
+ jalview.schemabinding.version2.types.NoValueColour.class,
handler);
desc.setImmutable(true);
desc.setHandler(handler);
package jalview.schemabinding.version2.descriptors;
+import jalview.schemabinding.version2.CompoundMatcher;
+
//---------------------------------/
//- Imported classes and packages -/
//---------------------------------/
import jalview.schemabinding.version2.FeatureMatcherSet;
+import jalview.schemabinding.version2.MatchCondition;
/**
* Class FeatureMatcherSetDescriptor.
// -- _matchCondition
desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
- jalview.schemabinding.version2.MatchCondition.class,
- "_matchCondition", "matchCondition",
+ MatchCondition.class, "_matchCondition", "matchCondition",
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
{
return target.getMatchCondition();
}
+ @Override
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);
+ target.setMatchCondition((MatchCondition) value);
} catch (java.lang.Exception ex)
{
throw new IllegalStateException(ex.toString());
}
}
+ @Override
public java.lang.Object newInstance(java.lang.Object parent)
{
- return new jalview.schemabinding.version2.MatchCondition();
+ return new MatchCondition();
}
};
desc.setHandler(handler);
desc.setValidator(fieldValidator);
// -- _compoundMatcher
desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
- jalview.schemabinding.version2.CompoundMatcher.class,
- "_compoundMatcher", "compoundMatcher",
+ CompoundMatcher.class, "_compoundMatcher", "compoundMatcher",
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
{
return target.getCompoundMatcher();
}
+ @Override
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);
+ target.setCompoundMatcher((CompoundMatcher) value);
} catch (java.lang.Exception ex)
{
throw new IllegalStateException(ex.toString());
}
}
+ @Override
public java.lang.Object newInstance(java.lang.Object parent)
{
- return new jalview.schemabinding.version2.CompoundMatcher();
+ return new CompoundMatcher();
}
};
desc.setHandler(handler);
*
* @return the access mode specified for this class.
*/
+ @Override
public org.exolab.castor.mapping.AccessMode getAccessMode()
{
return null;
*
* @return the identity field, null if this class has no identity.
*/
+ @Override
public org.exolab.castor.mapping.FieldDescriptor getIdentity()
{
return super.getIdentity();
*
* @return the Java class represented by this descriptor.
*/
+ @Override
public java.lang.Class getJavaClass()
{
return jalview.schemabinding.version2.FeatureMatcherSet.class;
*
* @return the namespace prefix to use when marshaling as XML.
*/
+ @Override
public java.lang.String getNameSpacePrefix()
{
return _nsPrefix;
*
* @return the namespace URI used when marshaling and unmarshaling as XML.
*/
+ @Override
public java.lang.String getNameSpaceURI()
{
return _nsURI;
* @return a specific validator for the class described by this
* ClassDescriptor.
*/
+ @Override
public org.exolab.castor.xml.TypeValidator getValidator()
{
return this;
*
* @return the XML Name for the Class being described.
*/
+ @Override
public java.lang.String getXMLName()
{
return _xmlName;
* @return true if XML schema definition of this Class is that of a global
* element or element with anonymous type definition.
*/
+ @Override
public boolean isElementDefinition()
{
return _elementDefinition;
*
* @version $Revision$ $Date$
*/
-public class SettingDescriptor extends
- org.exolab.castor.xml.util.XMLClassDescriptorImpl
+public class SettingDescriptor
+ extends org.exolab.castor.xml.util.XMLClassDescriptorImpl
{
// --------------------------/
_nsURI = "www.jalview.org";
_xmlName = "setting";
_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.setMaxInclusive(2147483647);
}
desc.setValidator(fieldValidator);
+ // -- _noValueColour
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ jalview.schemabinding.version2.types.NoValueColour.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
+ {
+ Setting target = (Setting) object;
+ return target.getNoValueColour();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException
+ {
+ try
+ {
+ Setting target = (Setting) object;
+ target.setNoValueColour(
+ (jalview.schemabinding.version2.types.NoValueColour) 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.NoValueColour.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);
// -- _threshold
desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
java.lang.Float.TYPE, "_threshold", "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
+ {
+ Setting target = (Setting) object;
+ return target.getAttributeName();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException
+ {
+ try
+ {
+ Setting target = (Setting) 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
+ {
+ Setting target = (Setting) 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.setNameSpaceURI("www.jalview.org");
+ 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);
+ // -- _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
+ {
+ Setting target = (Setting) object;
+ return target.getMatcherSet();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException
+ {
+ try
+ {
+ Setting target = (Setting) 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.setNameSpaceURI("www.jalview.org");
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _matcherSet
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ { // -- local scope
+ }
+ desc.setValidator(fieldValidator);
}
// -----------/
-#Thu Dec 14 09:10:14 GMT 2017
+#Thu Dec 14 15:28:22 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.NoValueColour=jalview.schemabinding.version2.types.descriptors.NoValueColourDescriptor
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;
+
+/**
+ * Graduated feature colour if no score (or attribute) value
+ *
+ * @version $Revision$ $Date$
+ */
+public class NoValueColour 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 NoValueColour NONE = new NoValueColour(NONE_TYPE,
+ "None");
+
+ /**
+ * The Min type
+ */
+ public static final int MIN_TYPE = 1;
+
+ /**
+ * The instance of the Min type
+ */
+ public static final NoValueColour MIN = new NoValueColour(MIN_TYPE,
+ "Min");
+
+ /**
+ * The Max type
+ */
+ public static final int MAX_TYPE = 2;
+
+ /**
+ * The instance of the Max type
+ */
+ public static final NoValueColour MAX = new NoValueColour(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 NoValueColour(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
+ * NoValueColour
+ *
+ * @return an Enumeration over all possible instances of NoValueColour
+ */
+ public static java.util.Enumeration enumerate()
+ {
+ return _memberTable.elements();
+ }
+
+ /**
+ * Method getType.Returns the type of this NoValueColour
+ *
+ * @return the type of this NoValueColour
+ */
+ 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 NoValueColour
+ *
+ * @return the String representation of this NoValueColour
+ */
+ public java.lang.String toString()
+ {
+ return this.stringValue;
+ }
+
+ /**
+ * Method valueOf.Returns a new NoValueColour based on the given String value.
+ *
+ * @param string
+ * @return the NoValueColour value of parameter 'string'
+ */
+ public static jalview.schemabinding.version2.types.NoValueColour 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 NoValueColour";
+ throw new IllegalArgumentException(err);
+ }
+ return (NoValueColour) 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.NoValueColour;
+
+/**
+ * Class NoValueColourDescriptor.
+ *
+ * @version $Revision$ $Date$
+ */
+public class NoValueColourDescriptor
+ 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 NoValueColourDescriptor()
+ {
+ super();
+ _nsURI = "www.jalview.org/colours";
+ _xmlName = "NoValueColour";
+ _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.NoValueColour.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;
+ }
+
+}