From: amwaterhouse Date: Wed, 5 Apr 2006 15:52:01 +0000 (+0000) Subject: Save graph threshold and annotation colours X-Git-Tag: Release_2_08~55 X-Git-Url: http://source.jalview.org/gitweb/?p=jalview.git;a=commitdiff_plain;h=224791537adfcd1d6efff3e24fa7c653d042b222;hp=7cdae57d68efc9bae8e64511bd7d41eda7d6c33d Save graph threshold and annotation colours --- diff --git a/schemas/jalview.xsd b/schemas/jalview.xsd index 2bedcd6..cc7ffdc 100755 --- a/schemas/jalview.xsd +++ b/schemas/jalview.xsd @@ -1,12 +1,7 @@ - - - - + + + @@ -16,20 +11,19 @@ - - - - - - - - - + + + + + + + + - - + + @@ -45,6 +39,18 @@ + + + + + + + + + + + + @@ -75,7 +81,7 @@ - + @@ -83,7 +89,7 @@ - + @@ -102,25 +108,22 @@ - - - - - - - - - - - - - + + + + + + + + + + + + - - @@ -129,7 +132,6 @@ - @@ -142,5 +144,4 @@ - diff --git a/schemas/vamsas.xsd b/schemas/vamsas.xsd index a7f731a..1a4e57e 100755 --- a/schemas/vamsas.xsd +++ b/schemas/vamsas.xsd @@ -12,6 +12,13 @@ + + + + + + + diff --git a/src/jalview/schemabinding/version2/Annotation.java b/src/jalview/schemabinding/version2/Annotation.java index 54811be..6003b86 100755 --- a/src/jalview/schemabinding/version2/Annotation.java +++ b/src/jalview/schemabinding/version2/Annotation.java @@ -70,6 +70,11 @@ public class Annotation implements java.io.Serializable { */ private java.lang.String _description; + /** + * Field _thresholdLine + */ + private jalview.schemabinding.version2.ThresholdLine _thresholdLine; + //----------------/ //- Constructors -/ @@ -235,6 +240,17 @@ public class Annotation implements java.io.Serializable { } //-- java.lang.String getLabel() /** + * Returns the value of field 'thresholdLine'. + * + * @return ThresholdLine + * @return the value of field 'thresholdLine'. + */ + public jalview.schemabinding.version2.ThresholdLine getThresholdLine() + { + return this._thresholdLine; + } //-- jalview.schemabinding.version2.ThresholdLine getThresholdLine() + + /** * Method hasGraph * * @@ -405,6 +421,16 @@ public class Annotation implements java.io.Serializable { } //-- void setLabel(java.lang.String) /** + * Sets the value of field 'thresholdLine'. + * + * @param thresholdLine the value of field 'thresholdLine'. + */ + public void setThresholdLine(jalview.schemabinding.version2.ThresholdLine thresholdLine) + { + this._thresholdLine = thresholdLine; + } //-- void setThresholdLine(jalview.schemabinding.version2.ThresholdLine) + + /** * Method unmarshal * * diff --git a/src/jalview/schemabinding/version2/AnnotationColours.java b/src/jalview/schemabinding/version2/AnnotationColours.java new file mode 100755 index 0000000..b2af2c4 --- /dev/null +++ b/src/jalview/schemabinding/version2/AnnotationColours.java @@ -0,0 +1,385 @@ +/* + * This class was automatically generated with + * Castor 0.9.6, using an XML + * Schema. + * $Id$ + */ + +package jalview.schemabinding.version2; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import java.io.IOException; +import java.io.Reader; +import java.io.Serializable; +import java.io.Writer; +import org.exolab.castor.xml.MarshalException; +import org.exolab.castor.xml.Marshaller; +import org.exolab.castor.xml.Unmarshaller; +import org.exolab.castor.xml.ValidationException; +import org.xml.sax.ContentHandler; + +/** + * Class AnnotationColours. + * + * @version $Revision$ $Date$ + */ +public class AnnotationColours implements java.io.Serializable { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field _aboveThreshold + */ + private int _aboveThreshold; + + /** + * keeps track of state for field: _aboveThreshold + */ + private boolean _has_aboveThreshold; + + /** + * Field _annotation + */ + private java.lang.String _annotation; + + /** + * Field _minColour + */ + private int _minColour; + + /** + * keeps track of state for field: _minColour + */ + private boolean _has_minColour; + + /** + * Field _maxColour + */ + private int _maxColour; + + /** + * keeps track of state for field: _maxColour + */ + private boolean _has_maxColour; + + /** + * Field _colourScheme + */ + private java.lang.String _colourScheme; + + /** + * Field _threshold + */ + private float _threshold; + + /** + * keeps track of state for field: _threshold + */ + private boolean _has_threshold; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public AnnotationColours() { + super(); + } //-- jalview.schemabinding.version2.AnnotationColours() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method deleteAboveThreshold + * + */ + public void deleteAboveThreshold() + { + this._has_aboveThreshold= false; + } //-- void deleteAboveThreshold() + + /** + * Method deleteMaxColour + * + */ + public void deleteMaxColour() + { + this._has_maxColour= false; + } //-- void deleteMaxColour() + + /** + * Method deleteMinColour + * + */ + public void deleteMinColour() + { + this._has_minColour= false; + } //-- void deleteMinColour() + + /** + * Method deleteThreshold + * + */ + public void deleteThreshold() + { + this._has_threshold= false; + } //-- void deleteThreshold() + + /** + * Returns the value of field 'aboveThreshold'. + * + * @return int + * @return the value of field 'aboveThreshold'. + */ + public int getAboveThreshold() + { + return this._aboveThreshold; + } //-- int getAboveThreshold() + + /** + * Returns the value of field 'annotation'. + * + * @return String + * @return the value of field 'annotation'. + */ + public java.lang.String getAnnotation() + { + return this._annotation; + } //-- java.lang.String getAnnotation() + + /** + * Returns the value of field 'colourScheme'. + * + * @return String + * @return the value of field 'colourScheme'. + */ + public java.lang.String getColourScheme() + { + return this._colourScheme; + } //-- java.lang.String getColourScheme() + + /** + * Returns the value of field 'maxColour'. + * + * @return int + * @return the value of field 'maxColour'. + */ + public int getMaxColour() + { + return this._maxColour; + } //-- int getMaxColour() + + /** + * Returns the value of field 'minColour'. + * + * @return int + * @return the value of field 'minColour'. + */ + public int getMinColour() + { + return this._minColour; + } //-- int getMinColour() + + /** + * Returns the value of field 'threshold'. + * + * @return float + * @return the value of field 'threshold'. + */ + public float getThreshold() + { + return this._threshold; + } //-- float getThreshold() + + /** + * Method hasAboveThreshold + * + * + * + * @return boolean + */ + public boolean hasAboveThreshold() + { + return this._has_aboveThreshold; + } //-- boolean hasAboveThreshold() + + /** + * Method hasMaxColour + * + * + * + * @return boolean + */ + public boolean hasMaxColour() + { + return this._has_maxColour; + } //-- boolean hasMaxColour() + + /** + * Method hasMinColour + * + * + * + * @return boolean + */ + public boolean hasMinColour() + { + return this._has_minColour; + } //-- boolean hasMinColour() + + /** + * Method hasThreshold + * + * + * + * @return boolean + */ + public boolean hasThreshold() + { + return this._has_threshold; + } //-- boolean hasThreshold() + + /** + * Method isValid + * + * + * + * @return boolean + */ + public boolean isValid() + { + try { + validate(); + } + catch (org.exolab.castor.xml.ValidationException vex) { + return false; + } + return true; + } //-- boolean isValid() + + /** + * Method marshal + * + * + * + * @param out + */ + public void marshal(java.io.Writer out) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + + Marshaller.marshal(this, out); + } //-- void marshal(java.io.Writer) + + /** + * Method marshal + * + * + * + * @param handler + */ + public void marshal(org.xml.sax.ContentHandler handler) + throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + + Marshaller.marshal(this, handler); + } //-- void marshal(org.xml.sax.ContentHandler) + + /** + * Sets the value of field 'aboveThreshold'. + * + * @param aboveThreshold the value of field 'aboveThreshold'. + */ + public void setAboveThreshold(int aboveThreshold) + { + this._aboveThreshold = aboveThreshold; + this._has_aboveThreshold = true; + } //-- void setAboveThreshold(int) + + /** + * Sets the value of field 'annotation'. + * + * @param annotation the value of field 'annotation'. + */ + public void setAnnotation(java.lang.String annotation) + { + this._annotation = annotation; + } //-- void setAnnotation(java.lang.String) + + /** + * Sets the value of field 'colourScheme'. + * + * @param colourScheme the value of field 'colourScheme'. + */ + public void setColourScheme(java.lang.String colourScheme) + { + this._colourScheme = colourScheme; + } //-- void setColourScheme(java.lang.String) + + /** + * Sets the value of field 'maxColour'. + * + * @param maxColour the value of field 'maxColour'. + */ + public void setMaxColour(int maxColour) + { + this._maxColour = maxColour; + this._has_maxColour = true; + } //-- void setMaxColour(int) + + /** + * Sets the value of field 'minColour'. + * + * @param minColour the value of field 'minColour'. + */ + public void setMinColour(int minColour) + { + this._minColour = minColour; + this._has_minColour = true; + } //-- void setMinColour(int) + + /** + * Sets the value of field 'threshold'. + * + * @param threshold the value of field 'threshold'. + */ + public void setThreshold(float threshold) + { + this._threshold = threshold; + this._has_threshold = true; + } //-- void setThreshold(float) + + /** + * Method unmarshal + * + * + * + * @param reader + * @return Object + */ + public static java.lang.Object unmarshal(java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + return (jalview.schemabinding.version2.AnnotationColours) Unmarshaller.unmarshal(jalview.schemabinding.version2.AnnotationColours.class, reader); + } //-- java.lang.Object unmarshal(java.io.Reader) + + /** + * Method validate + * + */ + public void validate() + throws org.exolab.castor.xml.ValidationException + { + org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); + validator.validate(this); + } //-- void validate() + +} diff --git a/src/jalview/schemabinding/version2/AnnotationColoursDescriptor.java b/src/jalview/schemabinding/version2/AnnotationColoursDescriptor.java new file mode 100755 index 0000000..c3c06e6 --- /dev/null +++ b/src/jalview/schemabinding/version2/AnnotationColoursDescriptor.java @@ -0,0 +1,406 @@ +/* + * This class was automatically generated with + * Castor 0.9.6, using an XML + * Schema. + * $Id$ + */ + +package jalview.schemabinding.version2; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import org.exolab.castor.mapping.AccessMode; +import org.exolab.castor.xml.TypeValidator; +import org.exolab.castor.xml.XMLFieldDescriptor; +import org.exolab.castor.xml.validators.*; + +/** + * Class AnnotationColoursDescriptor. + * + * @version $Revision$ $Date$ + */ +public class AnnotationColoursDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field nsPrefix + */ + private java.lang.String nsPrefix; + + /** + * Field nsURI + */ + private java.lang.String nsURI; + + /** + * Field xmlName + */ + private java.lang.String xmlName; + + /** + * Field identity + */ + private org.exolab.castor.xml.XMLFieldDescriptor identity; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public AnnotationColoursDescriptor() { + super(); + nsURI = "www.jalview.org"; + xmlName = "AnnotationColours"; + org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; + org.exolab.castor.xml.XMLFieldHandler handler = null; + org.exolab.castor.xml.FieldValidator fieldValidator = null; + //-- initialize attribute descriptors + + //-- _aboveThreshold + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_aboveThreshold", "aboveThreshold", org.exolab.castor.xml.NodeType.Attribute); + handler = (new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + AnnotationColours target = (AnnotationColours) object; + if(!target.hasAboveThreshold()) + return null; + return new java.lang.Integer(target.getAboveThreshold()); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + AnnotationColours target = (AnnotationColours) object; + // if null, use delete method for optional primitives + if (value == null) { + target.deleteAboveThreshold(); + return; + } + target.setAboveThreshold( ((java.lang.Integer)value).intValue()); + } + catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance( java.lang.Object parent ) { + return null; + } + } ); + desc.setHandler(handler); + addFieldDescriptor(desc); + + //-- validation code for: _aboveThreshold + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + IntegerValidator typeValidator= new IntegerValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _annotation + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_annotation", "annotation", 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 + { + AnnotationColours target = (AnnotationColours) object; + return target.getAnnotation(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + AnnotationColours target = (AnnotationColours) object; + target.setAnnotation( (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); + addFieldDescriptor(desc); + + //-- validation code for: _annotation + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + StringValidator typeValidator = new StringValidator(); + typeValidator.setWhiteSpace("preserve"); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _minColour + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_minColour", "minColour", org.exolab.castor.xml.NodeType.Attribute); + handler = (new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + AnnotationColours target = (AnnotationColours) object; + if(!target.hasMinColour()) + return null; + return new java.lang.Integer(target.getMinColour()); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + AnnotationColours target = (AnnotationColours) object; + // if null, use delete method for optional primitives + if (value == null) { + target.deleteMinColour(); + return; + } + target.setMinColour( ((java.lang.Integer)value).intValue()); + } + catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance( java.lang.Object parent ) { + return null; + } + } ); + desc.setHandler(handler); + addFieldDescriptor(desc); + + //-- validation code for: _minColour + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + IntegerValidator typeValidator= new IntegerValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _maxColour + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_maxColour", "maxColour", org.exolab.castor.xml.NodeType.Attribute); + handler = (new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + AnnotationColours target = (AnnotationColours) object; + if(!target.hasMaxColour()) + return null; + return new java.lang.Integer(target.getMaxColour()); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + AnnotationColours target = (AnnotationColours) object; + // if null, use delete method for optional primitives + if (value == null) { + target.deleteMaxColour(); + return; + } + target.setMaxColour( ((java.lang.Integer)value).intValue()); + } + catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance( java.lang.Object parent ) { + return null; + } + } ); + desc.setHandler(handler); + addFieldDescriptor(desc); + + //-- validation code for: _maxColour + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + IntegerValidator typeValidator= new IntegerValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _colourScheme + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_colourScheme", "colourScheme", 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 + { + AnnotationColours target = (AnnotationColours) object; + return target.getColourScheme(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + AnnotationColours target = (AnnotationColours) object; + target.setColourScheme( (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); + addFieldDescriptor(desc); + + //-- validation code for: _colourScheme + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + StringValidator typeValidator = new StringValidator(); + typeValidator.setWhiteSpace("preserve"); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _threshold + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(float.class, "_threshold", "threshold", org.exolab.castor.xml.NodeType.Attribute); + handler = (new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + AnnotationColours target = (AnnotationColours) object; + if(!target.hasThreshold()) + return null; + return new java.lang.Float(target.getThreshold()); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + AnnotationColours target = (AnnotationColours) object; + // if null, use delete method for optional primitives + if (value == null) { + target.deleteThreshold(); + return; + } + target.setThreshold( ((java.lang.Float)value).floatValue()); + } + catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance( java.lang.Object parent ) { + return null; + } + } ); + desc.setHandler(handler); + addFieldDescriptor(desc); + + //-- validation code for: _threshold + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + FloatValidator typeValidator = new FloatValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- initialize element descriptors + + } //-- jalview.schemabinding.version2.AnnotationColoursDescriptor() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method getAccessMode + * + * + * + * @return AccessMode + */ + public org.exolab.castor.mapping.AccessMode getAccessMode() + { + return null; + } //-- org.exolab.castor.mapping.AccessMode getAccessMode() + + /** + * Method getExtends + * + * + * + * @return ClassDescriptor + */ + public org.exolab.castor.mapping.ClassDescriptor getExtends() + { + return null; + } //-- org.exolab.castor.mapping.ClassDescriptor getExtends() + + /** + * Method getIdentity + * + * + * + * @return FieldDescriptor + */ + public org.exolab.castor.mapping.FieldDescriptor getIdentity() + { + return identity; + } //-- org.exolab.castor.mapping.FieldDescriptor getIdentity() + + /** + * Method getJavaClass + * + * + * + * @return Class + */ + public java.lang.Class getJavaClass() + { + return jalview.schemabinding.version2.AnnotationColours.class; + } //-- java.lang.Class getJavaClass() + + /** + * Method getNameSpacePrefix + * + * + * + * @return String + */ + public java.lang.String getNameSpacePrefix() + { + return nsPrefix; + } //-- java.lang.String getNameSpacePrefix() + + /** + * Method getNameSpaceURI + * + * + * + * @return String + */ + public java.lang.String getNameSpaceURI() + { + return nsURI; + } //-- java.lang.String getNameSpaceURI() + + /** + * Method getValidator + * + * + * + * @return TypeValidator + */ + public org.exolab.castor.xml.TypeValidator getValidator() + { + return this; + } //-- org.exolab.castor.xml.TypeValidator getValidator() + + /** + * Method getXMLName + * + * + * + * @return String + */ + public java.lang.String getXMLName() + { + return xmlName; + } //-- java.lang.String getXMLName() + +} diff --git a/src/jalview/schemabinding/version2/AnnotationDescriptor.java b/src/jalview/schemabinding/version2/AnnotationDescriptor.java index d60b680..9e34a53 100755 --- a/src/jalview/schemabinding/version2/AnnotationDescriptor.java +++ b/src/jalview/schemabinding/version2/AnnotationDescriptor.java @@ -265,6 +265,40 @@ public class AnnotationDescriptor extends org.exolab.castor.xml.util.XMLClassDes fieldValidator.setValidator(typeValidator); } desc.setValidator(fieldValidator); + //-- _thresholdLine + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(jalview.schemabinding.version2.ThresholdLine.class, "_thresholdLine", "thresholdLine", org.exolab.castor.xml.NodeType.Element); + handler = (new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Annotation target = (Annotation) object; + return target.getThresholdLine(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Annotation target = (Annotation) object; + target.setThresholdLine( (jalview.schemabinding.version2.ThresholdLine) 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.ThresholdLine(); + } + } ); + desc.setHandler(handler); + desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2"); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _thresholdLine + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + } + desc.setValidator(fieldValidator); } //-- jalview.schemabinding.version2.AnnotationDescriptor() diff --git a/src/jalview/schemabinding/version2/ThresholdLine.java b/src/jalview/schemabinding/version2/ThresholdLine.java new file mode 100755 index 0000000..85854c1 --- /dev/null +++ b/src/jalview/schemabinding/version2/ThresholdLine.java @@ -0,0 +1,253 @@ +/* + * This class was automatically generated with + * Castor 0.9.6, using an XML + * Schema. + * $Id$ + */ + +package jalview.schemabinding.version2; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import java.io.IOException; +import java.io.Reader; +import java.io.Serializable; +import java.io.Writer; +import org.exolab.castor.xml.MarshalException; +import org.exolab.castor.xml.Marshaller; +import org.exolab.castor.xml.Unmarshaller; +import org.exolab.castor.xml.ValidationException; +import org.xml.sax.ContentHandler; + +/** + * Class ThresholdLine. + * + * @version $Revision$ $Date$ + */ +public class ThresholdLine implements java.io.Serializable { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field _label + */ + private java.lang.String _label; + + /** + * Field _value + */ + private float _value; + + /** + * keeps track of state for field: _value + */ + private boolean _has_value; + + /** + * Field _colour + */ + private int _colour; + + /** + * keeps track of state for field: _colour + */ + private boolean _has_colour; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public ThresholdLine() { + super(); + } //-- jalview.schemabinding.version2.ThresholdLine() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method deleteColour + * + */ + public void deleteColour() + { + this._has_colour= false; + } //-- void deleteColour() + + /** + * Method deleteValue + * + */ + public void deleteValue() + { + this._has_value= false; + } //-- void deleteValue() + + /** + * Returns the value of field 'colour'. + * + * @return int + * @return the value of field 'colour'. + */ + public int getColour() + { + return this._colour; + } //-- int getColour() + + /** + * Returns the value of field 'label'. + * + * @return String + * @return the value of field 'label'. + */ + public java.lang.String getLabel() + { + return this._label; + } //-- java.lang.String getLabel() + + /** + * Returns the value of field 'value'. + * + * @return float + * @return the value of field 'value'. + */ + public float getValue() + { + return this._value; + } //-- float getValue() + + /** + * Method hasColour + * + * + * + * @return boolean + */ + public boolean hasColour() + { + return this._has_colour; + } //-- boolean hasColour() + + /** + * Method hasValue + * + * + * + * @return boolean + */ + public boolean hasValue() + { + return this._has_value; + } //-- boolean hasValue() + + /** + * Method isValid + * + * + * + * @return boolean + */ + public boolean isValid() + { + try { + validate(); + } + catch (org.exolab.castor.xml.ValidationException vex) { + return false; + } + return true; + } //-- boolean isValid() + + /** + * Method marshal + * + * + * + * @param out + */ + public void marshal(java.io.Writer out) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + + Marshaller.marshal(this, out); + } //-- void marshal(java.io.Writer) + + /** + * Method marshal + * + * + * + * @param handler + */ + public void marshal(org.xml.sax.ContentHandler handler) + throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + + Marshaller.marshal(this, handler); + } //-- void marshal(org.xml.sax.ContentHandler) + + /** + * Sets the value of field 'colour'. + * + * @param colour the value of field 'colour'. + */ + public void setColour(int colour) + { + this._colour = colour; + this._has_colour = true; + } //-- void setColour(int) + + /** + * Sets the value of field 'label'. + * + * @param label the value of field 'label'. + */ + public void setLabel(java.lang.String label) + { + this._label = label; + } //-- void setLabel(java.lang.String) + + /** + * Sets the value of field 'value'. + * + * @param value the value of field 'value'. + */ + public void setValue(float value) + { + this._value = value; + this._has_value = true; + } //-- void setValue(float) + + /** + * Method unmarshal + * + * + * + * @param reader + * @return Object + */ + public static java.lang.Object unmarshal(java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + return (jalview.schemabinding.version2.ThresholdLine) Unmarshaller.unmarshal(jalview.schemabinding.version2.ThresholdLine.class, reader); + } //-- java.lang.Object unmarshal(java.io.Reader) + + /** + * Method validate + * + */ + public void validate() + throws org.exolab.castor.xml.ValidationException + { + org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); + validator.validate(this); + } //-- void validate() + +} diff --git a/src/jalview/schemabinding/version2/ThresholdLineDescriptor.java b/src/jalview/schemabinding/version2/ThresholdLineDescriptor.java new file mode 100755 index 0000000..9241003 --- /dev/null +++ b/src/jalview/schemabinding/version2/ThresholdLineDescriptor.java @@ -0,0 +1,288 @@ +/* + * This class was automatically generated with + * Castor 0.9.6, using an XML + * Schema. + * $Id$ + */ + +package jalview.schemabinding.version2; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import org.exolab.castor.mapping.AccessMode; +import org.exolab.castor.xml.TypeValidator; +import org.exolab.castor.xml.XMLFieldDescriptor; +import org.exolab.castor.xml.validators.*; + +/** + * Class ThresholdLineDescriptor. + * + * @version $Revision$ $Date$ + */ +public class ThresholdLineDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field nsPrefix + */ + private java.lang.String nsPrefix; + + /** + * Field nsURI + */ + private java.lang.String nsURI; + + /** + * Field xmlName + */ + private java.lang.String xmlName; + + /** + * Field identity + */ + private org.exolab.castor.xml.XMLFieldDescriptor identity; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public ThresholdLineDescriptor() { + super(); + nsURI = "www.vamsas.ac.uk/jalview/version2"; + xmlName = "thresholdLine"; + org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; + org.exolab.castor.xml.XMLFieldHandler handler = null; + org.exolab.castor.xml.FieldValidator fieldValidator = null; + //-- initialize attribute descriptors + + //-- _label + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_label", "label", 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 + { + ThresholdLine target = (ThresholdLine) object; + return target.getLabel(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + ThresholdLine target = (ThresholdLine) object; + target.setLabel( (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); + addFieldDescriptor(desc); + + //-- validation code for: _label + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + StringValidator typeValidator = new StringValidator(); + typeValidator.setWhiteSpace("preserve"); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _value + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(float.class, "_value", "value", org.exolab.castor.xml.NodeType.Attribute); + handler = (new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + ThresholdLine target = (ThresholdLine) object; + if(!target.hasValue()) + return null; + return new java.lang.Float(target.getValue()); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + ThresholdLine target = (ThresholdLine) object; + // if null, use delete method for optional primitives + if (value == null) { + target.deleteValue(); + return; + } + target.setValue( ((java.lang.Float)value).floatValue()); + } + catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance( java.lang.Object parent ) { + return null; + } + } ); + desc.setHandler(handler); + addFieldDescriptor(desc); + + //-- validation code for: _value + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + FloatValidator typeValidator = new FloatValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _colour + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_colour", "colour", org.exolab.castor.xml.NodeType.Attribute); + handler = (new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + ThresholdLine target = (ThresholdLine) object; + if(!target.hasColour()) + return null; + return new java.lang.Integer(target.getColour()); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + ThresholdLine target = (ThresholdLine) object; + // if null, use delete method for optional primitives + if (value == null) { + target.deleteColour(); + return; + } + target.setColour( ((java.lang.Integer)value).intValue()); + } + catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance( java.lang.Object parent ) { + return null; + } + } ); + desc.setHandler(handler); + addFieldDescriptor(desc); + + //-- validation code for: _colour + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + IntegerValidator typeValidator= new IntegerValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- initialize element descriptors + + } //-- jalview.schemabinding.version2.ThresholdLineDescriptor() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method getAccessMode + * + * + * + * @return AccessMode + */ + public org.exolab.castor.mapping.AccessMode getAccessMode() + { + return null; + } //-- org.exolab.castor.mapping.AccessMode getAccessMode() + + /** + * Method getExtends + * + * + * + * @return ClassDescriptor + */ + public org.exolab.castor.mapping.ClassDescriptor getExtends() + { + return null; + } //-- org.exolab.castor.mapping.ClassDescriptor getExtends() + + /** + * Method getIdentity + * + * + * + * @return FieldDescriptor + */ + public org.exolab.castor.mapping.FieldDescriptor getIdentity() + { + return identity; + } //-- org.exolab.castor.mapping.FieldDescriptor getIdentity() + + /** + * Method getJavaClass + * + * + * + * @return Class + */ + public java.lang.Class getJavaClass() + { + return jalview.schemabinding.version2.ThresholdLine.class; + } //-- java.lang.Class getJavaClass() + + /** + * Method getNameSpacePrefix + * + * + * + * @return String + */ + public java.lang.String getNameSpacePrefix() + { + return nsPrefix; + } //-- java.lang.String getNameSpacePrefix() + + /** + * Method getNameSpaceURI + * + * + * + * @return String + */ + public java.lang.String getNameSpaceURI() + { + return nsURI; + } //-- java.lang.String getNameSpaceURI() + + /** + * Method getValidator + * + * + * + * @return TypeValidator + */ + public org.exolab.castor.xml.TypeValidator getValidator() + { + return this; + } //-- org.exolab.castor.xml.TypeValidator getValidator() + + /** + * Method getXMLName + * + * + * + * @return String + */ + public java.lang.String getXMLName() + { + return xmlName; + } //-- java.lang.String getXMLName() + +} diff --git a/src/jalview/schemabinding/version2/Viewport.java b/src/jalview/schemabinding/version2/Viewport.java index 4e6747e..543c110 100755 --- a/src/jalview/schemabinding/version2/Viewport.java +++ b/src/jalview/schemabinding/version2/Viewport.java @@ -278,6 +278,11 @@ public class Viewport implements java.io.Serializable { */ private boolean _has_fontStyle; + /** + * Field _annotationColours + */ + private jalview.schemabinding.version2.AnnotationColours _annotationColours; + //----------------/ //- Constructors -/ @@ -500,6 +505,17 @@ public class Viewport implements java.io.Serializable { } //-- void deleteYpos() /** + * Returns the value of field 'annotationColours'. + * + * @return AnnotationColours + * @return the value of field 'annotationColours'. + */ + public jalview.schemabinding.version2.AnnotationColours getAnnotationColours() + { + return this._annotationColours; + } //-- jalview.schemabinding.version2.AnnotationColours getAnnotationColours() + + /** * Returns the value of field 'bgColour'. * * @return String @@ -1108,6 +1124,17 @@ public class Viewport implements java.io.Serializable { } //-- void marshal(org.xml.sax.ContentHandler) /** + * Sets the value of field 'annotationColours'. + * + * @param annotationColours the value of field + * 'annotationColours'. + */ + public void setAnnotationColours(jalview.schemabinding.version2.AnnotationColours annotationColours) + { + this._annotationColours = annotationColours; + } //-- void setAnnotationColours(jalview.schemabinding.version2.AnnotationColours) + + /** * Sets the value of field 'bgColour'. * * @param bgColour the value of field 'bgColour'. diff --git a/src/jalview/schemabinding/version2/ViewportDescriptor.java b/src/jalview/schemabinding/version2/ViewportDescriptor.java index 66a3d77..02e9be9 100755 --- a/src/jalview/schemabinding/version2/ViewportDescriptor.java +++ b/src/jalview/schemabinding/version2/ViewportDescriptor.java @@ -57,6 +57,9 @@ public class ViewportDescriptor extends org.exolab.castor.xml.util.XMLClassDescr super(); nsURI = "www.jalview.org"; xmlName = "Viewport"; + + //-- set grouping compositor + setCompositorAsSequence(); org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; org.exolab.castor.xml.XMLFieldHandler handler = null; org.exolab.castor.xml.FieldValidator fieldValidator = null; @@ -1115,6 +1118,40 @@ public class ViewportDescriptor extends org.exolab.castor.xml.util.XMLClassDescr desc.setValidator(fieldValidator); //-- initialize element descriptors + //-- _annotationColours + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(jalview.schemabinding.version2.AnnotationColours.class, "_annotationColours", "AnnotationColours", org.exolab.castor.xml.NodeType.Element); + handler = (new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Viewport target = (Viewport) object; + return target.getAnnotationColours(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Viewport target = (Viewport) object; + target.setAnnotationColours( (jalview.schemabinding.version2.AnnotationColours) 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.AnnotationColours(); + } + } ); + desc.setHandler(handler); + desc.setNameSpaceURI("www.jalview.org"); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _annotationColours + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + } + desc.setValidator(fieldValidator); } //-- jalview.schemabinding.version2.ViewportDescriptor()