From cfa1e4489edf808823a672584fe41084cb33b00f Mon Sep 17 00:00:00 2001 From: jprocter Date: Fri, 6 Feb 2009 14:51:06 +0000 Subject: [PATCH] added showUnconserved property to group and view attributes --- schemas/jalview.xsd | 3 + src/jalview/schemabinding/version2/.castor.cdr | 8 +-- src/jalview/schemabinding/version2/JGroup.java | 58 ++++++++++++++++++++ src/jalview/schemabinding/version2/Viewport.java | 58 ++++++++++++++++++++ .../version2/descriptors/JGroupDescriptor.java | 41 ++++++++++++++ .../version2/descriptors/ViewportDescriptor.java | 41 ++++++++++++++ 6 files changed, 205 insertions(+), 4 deletions(-) diff --git a/schemas/jalview.xsd b/schemas/jalview.xsd index 06473bc..72c1270 100755 --- a/schemas/jalview.xsd +++ b/schemas/jalview.xsd @@ -73,6 +73,8 @@ + + @@ -105,6 +107,7 @@ + diff --git a/src/jalview/schemabinding/version2/.castor.cdr b/src/jalview/schemabinding/version2/.castor.cdr index 7e3a754..92a62c4 100644 --- a/src/jalview/schemabinding/version2/.castor.cdr +++ b/src/jalview/schemabinding/version2/.castor.cdr @@ -1,4 +1,4 @@ -#Sun Dec 14 18:51:51 GMT 2008 +#Fri Feb 06 14:21:53 GMT 2009 jalview.schemabinding.version2.ThresholdLine=jalview.schemabinding.version2.descriptors.ThresholdLineDescriptor jalview.schemabinding.version2.SequenceSetProperties=jalview.schemabinding.version2.descriptors.SequenceSetPropertiesDescriptor jalview.schemabinding.version2.StructureState=jalview.schemabinding.version2.descriptors.StructureStateDescriptor @@ -33,12 +33,12 @@ jalview.schemabinding.version2.MapListFrom=jalview.schemabinding.version2.descri jalview.schemabinding.version2.PdbentryItem=jalview.schemabinding.version2.descriptors.PdbentryItemDescriptor jalview.schemabinding.version2.FeatureSettings=jalview.schemabinding.version2.descriptors.FeatureSettingsDescriptor jalview.schemabinding.version2.JGroup=jalview.schemabinding.version2.descriptors.JGroupDescriptor -jalview.schemabinding.version2.MapListTo=jalview.schemabinding.version2.descriptors.MapListToDescriptor -jalview.schemabinding.version2.JalviewUserColours=jalview.schemabinding.version2.descriptors.JalviewUserColoursDescriptor jalview.schemabinding.version2.VamsasModel=jalview.schemabinding.version2.descriptors.VamsasModelDescriptor +jalview.schemabinding.version2.JalviewUserColours=jalview.schemabinding.version2.descriptors.JalviewUserColoursDescriptor +jalview.schemabinding.version2.MapListTo=jalview.schemabinding.version2.descriptors.MapListToDescriptor jalview.schemabinding.version2.Pdbentry=jalview.schemabinding.version2.descriptors.PdbentryDescriptor jalview.schemabinding.version2.HiddenColumns=jalview.schemabinding.version2.descriptors.HiddenColumnsDescriptor -jalview.schemabinding.version2.DseqFor=jalview.schemabinding.version2.descriptors.DseqForDescriptor jalview.schemabinding.version2.Features=jalview.schemabinding.version2.descriptors.FeaturesDescriptor +jalview.schemabinding.version2.DseqFor=jalview.schemabinding.version2.descriptors.DseqForDescriptor jalview.schemabinding.version2.VAMSAS=jalview.schemabinding.version2.descriptors.VAMSASDescriptor jalview.schemabinding.version2.MappingChoiceItem=jalview.schemabinding.version2.descriptors.MappingChoiceItemDescriptor diff --git a/src/jalview/schemabinding/version2/JGroup.java b/src/jalview/schemabinding/version2/JGroup.java index ca77ed2..3563186 100755 --- a/src/jalview/schemabinding/version2/JGroup.java +++ b/src/jalview/schemabinding/version2/JGroup.java @@ -147,6 +147,16 @@ public class JGroup implements java.io.Serializable { private boolean _has_textColThreshold; /** + * Field _showUnconserved. + */ + private boolean _showUnconserved; + + /** + * keeps track of state for field: _showUnconserved + */ + private boolean _has_showUnconserved; + + /** * Field _seqList. */ private java.util.Vector _seqList; @@ -245,6 +255,13 @@ public class JGroup implements java.io.Serializable { /** */ + public void deleteShowUnconserved( + ) { + this._has_showUnconserved= false; + } + + /** + */ public void deleteStart( ) { this._has_start= false; @@ -416,6 +433,16 @@ public class JGroup implements java.io.Serializable { } /** + * Returns the value of field 'showUnconserved'. + * + * @return the value of field 'ShowUnconserved'. + */ + public boolean getShowUnconserved( + ) { + return this._showUnconserved; + } + + /** * Returns the value of field 'start'. * * @return the value of field 'Start'. @@ -526,6 +553,16 @@ public class JGroup implements java.io.Serializable { } /** + * Method hasShowUnconserved. + * + * @return true if at least one ShowUnconserved has been added + */ + public boolean hasShowUnconserved( + ) { + return this._has_showUnconserved; + } + + /** * Method hasStart. * * @return true if at least one Start has been added @@ -596,6 +633,16 @@ public class JGroup implements java.io.Serializable { } /** + * Returns the value of field 'showUnconserved'. + * + * @return the value of field 'ShowUnconserved'. + */ + public boolean isShowUnconserved( + ) { + return this._showUnconserved; + } + + /** * Method isValid. * * @return true if this object is valid according to the schema @@ -806,6 +853,17 @@ public class JGroup implements java.io.Serializable { } /** + * Sets the value of field 'showUnconserved'. + * + * @param showUnconserved the value of field 'showUnconserved'. + */ + public void setShowUnconserved( + final boolean showUnconserved) { + this._showUnconserved = showUnconserved; + this._has_showUnconserved = true; + } + + /** * Sets the value of field 'start'. * * @param start the value of field 'start'. diff --git a/src/jalview/schemabinding/version2/Viewport.java b/src/jalview/schemabinding/version2/Viewport.java index 07ddd65..d212e84 100755 --- a/src/jalview/schemabinding/version2/Viewport.java +++ b/src/jalview/schemabinding/version2/Viewport.java @@ -117,6 +117,16 @@ public class Viewport implements java.io.Serializable { private boolean _has_showColourText; /** + * Field _showUnconserved. + */ + private boolean _showUnconserved; + + /** + * keeps track of state for field: _showUnconserved + */ + private boolean _has_showUnconserved; + + /** * Field _showBoxes. */ private boolean _showBoxes; @@ -475,6 +485,13 @@ public class Viewport implements java.io.Serializable { /** */ + public void deleteShowUnconserved( + ) { + this._has_showUnconserved= false; + } + + /** + */ public void deleteStartRes( ) { this._has_startRes= false; @@ -808,6 +825,16 @@ public class Viewport implements java.io.Serializable { } /** + * Returns the value of field 'showUnconserved'. + * + * @return the value of field 'ShowUnconserved'. + */ + public boolean getShowUnconserved( + ) { + return this._showUnconserved; + } + + /** * Returns the value of field 'startRes'. * * @return the value of field 'StartRes'. @@ -1080,6 +1107,16 @@ public class Viewport implements java.io.Serializable { } /** + * Method hasShowUnconserved. + * + * @return true if at least one ShowUnconserved has been added + */ + public boolean hasShowUnconserved( + ) { + return this._has_showUnconserved; + } + + /** * Method hasStartRes. * * @return true if at least one StartRes has been added @@ -1280,6 +1317,16 @@ public class Viewport implements java.io.Serializable { } /** + * Returns the value of field 'showUnconserved'. + * + * @return the value of field 'ShowUnconserved'. + */ + public boolean isShowUnconserved( + ) { + return this._showUnconserved; + } + + /** * Method isValid. * * @return true if this object is valid according to the schema @@ -1635,6 +1682,17 @@ public class Viewport implements java.io.Serializable { } /** + * Sets the value of field 'showUnconserved'. + * + * @param showUnconserved the value of field 'showUnconserved'. + */ + public void setShowUnconserved( + final boolean showUnconserved) { + this._showUnconserved = showUnconserved; + this._has_showUnconserved = true; + } + + /** * Sets the value of field 'startRes'. * * @param startRes the value of field 'startRes'. diff --git a/src/jalview/schemabinding/version2/descriptors/JGroupDescriptor.java b/src/jalview/schemabinding/version2/descriptors/JGroupDescriptor.java index 21b3b67..e6ebec7 100644 --- a/src/jalview/schemabinding/version2/descriptors/JGroupDescriptor.java +++ b/src/jalview/schemabinding/version2/descriptors/JGroupDescriptor.java @@ -604,6 +604,47 @@ public class JGroupDescriptor extends org.exolab.castor.xml.util.XMLClassDescrip typeValidator.setMaxInclusive(2147483647); } desc.setValidator(fieldValidator); + //-- _showUnconserved + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_showUnconserved", "showUnconserved", org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + JGroup target = (JGroup) object; + if (!target.hasShowUnconserved()) { return null; } + return (target.getShowUnconserved() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + JGroup target = (JGroup) object; + // if null, use delete method for optional primitives + if (value == null) { + target.deleteShowUnconserved(); + return; + } + target.setShowUnconserved( ((java.lang.Boolean) value).booleanValue()); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _showUnconserved + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + org.exolab.castor.xml.validators.BooleanValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); //-- initialize element descriptors //-- _seqList diff --git a/src/jalview/schemabinding/version2/descriptors/ViewportDescriptor.java b/src/jalview/schemabinding/version2/descriptors/ViewportDescriptor.java index f00cb21..e9b93d4 100644 --- a/src/jalview/schemabinding/version2/descriptors/ViewportDescriptor.java +++ b/src/jalview/schemabinding/version2/descriptors/ViewportDescriptor.java @@ -469,6 +469,47 @@ public class ViewportDescriptor extends org.exolab.castor.xml.util.XMLClassDescr fieldValidator.setValidator(typeValidator); } desc.setValidator(fieldValidator); + //-- _showUnconserved + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_showUnconserved", "showUnconserved", org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Viewport target = (Viewport) object; + if (!target.hasShowUnconserved()) { return null; } + return (target.getShowUnconserved() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Viewport target = (Viewport) object; + // if null, use delete method for optional primitives + if (value == null) { + target.deleteShowUnconserved(); + return; + } + target.setShowUnconserved( ((java.lang.Boolean) value).booleanValue()); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _showUnconserved + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + org.exolab.castor.xml.validators.BooleanValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); //-- _showBoxes desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_showBoxes", "showBoxes", org.exolab.castor.xml.NodeType.Attribute); handler = new org.exolab.castor.xml.XMLFieldHandler() { -- 1.7.10.2