From a2094092396efa4d6736b11f3b1e1415098c3d12 Mon Sep 17 00:00:00 2001 From: jprocter Date: Fri, 6 Jul 2012 18:25:54 +0100 Subject: [PATCH] JAL-976 - add support for storing service parameter sets in project --- schemas/jalview.xsd | 583 ++++++++++++++------ src/jalview/schemabinding/version2/.castor.cdr | 12 +- .../schemabinding/version2/CalcIdParam.java | 283 ++++++++++ src/jalview/schemabinding/version2/Viewport.java | 184 +++++- .../descriptors/CalcIdParamDescriptor.java | 279 ++++++++++ .../version2/descriptors/ViewportDescriptor.java | 59 +- 6 files changed, 1196 insertions(+), 204 deletions(-) create mode 100644 src/jalview/schemabinding/version2/CalcIdParam.java create mode 100644 src/jalview/schemabinding/version2/descriptors/CalcIdParamDescriptor.java diff --git a/schemas/jalview.xsd b/schemas/jalview.xsd index cc8b1e9..e1fbb67 100755 --- a/schemas/jalview.xsd +++ b/schemas/jalview.xsd @@ -16,60 +16,195 @@ * * You should have received a copy of the GNU General Public License along with Jalview. If not, see . --> - + + - - - + + + - - + + - + - + - - - - + + + + - additional identifier which properly disambiguates - the structure view from any other view with the same attributes. This is not an ID, - because it is possible to have many references to the same physical structure view - from different sequences in an alignment. A structureState element citing the same - viewId will appear for each instance. + + additional + identifier + which + properly + disambiguates + the + structure + view + from + any + other + view + with + the + same + attributes. + This + is + not + an + ID, + because + it + is + possible + to + have + many + references + to + the + same + physical + structure + view + from + different + sequences + in + an + alignment. + A + structureState + element + citing + the + same + viewId + will + appear + for + each + instance. + - - - - Flag set if the alignment panel containing this JSeq should be included in those used to perform a structure superposition (since Jalview 2.7). - - + + + + Flag + set + if + the + alignment + panel + containing + this + JSeq + should + be + included + in + those + used + to + perform + a + structure + superposition + (since + Jalview + 2.7). + + - - - - Flag set if the alignment panel containing this JSeq should be included in those used to colour its associated sequences in this structureState(since Jalview 2.7). - - + + + + Flag + set + if + the + alignment + panel + containing + this + JSeq + should + be + included + in + those + used + to + colour + its + associated + sequences + in + this + structureState(since + Jalview + 2.7). + + + + + + + Flag + set + if + the + structure + display + is + coloured + by + the + Jmol + state, + rather + than + by + one + or + more + linked + alignment + views. + + - - - Flag set if the structure display is coloured by the Jmol state, rather than by one or more linked alignment views. - - + - + @@ -77,169 +212,295 @@ - + - - - - - + + + + + - + - + - - - - - - - - - - - - - - - - - - - - Optional sequence group ID (only needs to be unique for this alignment) - - + + + + + + + + + + + + + + + + + + + + + Optional sequence group ID (only + needs to be unique for this + alignment) + + + - + - - - - - - + + + + + + - + - - + + + + + + + + + handle for the calculation which uses this parameter set + + + should the calculation be performed immediately after loading in order to refresh results + + + should the calculation be automatically performed on edits + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - unique id used by jalview to synchronize between stored and instantiated views + unique id used by jalview to + synchronize between stored and + instantiated views - + - + - + - + - + - - - - - - - - - - - - - - - Tree ID added for binding tree visualization settings to vamsas document trees in jalview 2.4.1 - - - + + + + + + + + + + + + + + + + + Tree ID added for binding tree + visualization settings to vamsas + document trees in jalview 2.4.1 + + + + + - + - - - - - - Optional minimum colour for graduated feature colour - - - threshold value for graduated feature colour - - - threshold type for graduated feature colour - - - - - - + + + + + + + + Optional minimum colour + for graduated feature + colour + + + + + + + threshold value for + graduated feature colour + + + + + + + threshold type for + graduated feature colour + + + + + + + + - + - - + + diff --git a/src/jalview/schemabinding/version2/.castor.cdr b/src/jalview/schemabinding/version2/.castor.cdr index 33cd4bf..16a24f5 100644 --- a/src/jalview/schemabinding/version2/.castor.cdr +++ b/src/jalview/schemabinding/version2/.castor.cdr @@ -1,7 +1,8 @@ -#Thu May 24 20:06:46 BST 2012 +#Fri Jul 06 18:02:04 BST 2012 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 +jalview.schemabinding.version2.CalcIdParam=jalview.schemabinding.version2.descriptors.CalcIdParamDescriptor jalview.schemabinding.version2.Tree=jalview.schemabinding.version2.descriptors.TreeDescriptor jalview.schemabinding.version2.JalviewModel=jalview.schemabinding.version2.descriptors.JalviewModelDescriptor jalview.schemabinding.version2.SequenceType=jalview.schemabinding.version2.descriptors.SequenceTypeDescriptor @@ -17,6 +18,7 @@ jalview.schemabinding.version2.UserColourScheme=jalview.schemabinding.version2.d jalview.schemabinding.version2.DBRef=jalview.schemabinding.version2.descriptors.DBRefDescriptor jalview.schemabinding.version2.AlcodMap=jalview.schemabinding.version2.descriptors.AlcodMapDescriptor jalview.schemabinding.version2.Annotation=jalview.schemabinding.version2.descriptors.AnnotationDescriptor +jalview.schemabinding.version2.Wsparameters=jalview.schemabinding.version2.descriptors.WsparametersDescriptor jalview.schemabinding.version2.JSeq=jalview.schemabinding.version2.descriptors.JSeqDescriptor jalview.schemabinding.version2.Sequence=jalview.schemabinding.version2.descriptors.SequenceDescriptor jalview.schemabinding.version2.WebServiceParameterSet=jalview.schemabinding.version2.descriptors.WebServiceParameterSetDescriptor @@ -32,14 +34,14 @@ jalview.schemabinding.version2.UserColours=jalview.schemabinding.version2.descri jalview.schemabinding.version2.Colour=jalview.schemabinding.version2.descriptors.ColourDescriptor jalview.schemabinding.version2.MapListFrom=jalview.schemabinding.version2.descriptors.MapListFromDescriptor 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.FeatureSettings=jalview.schemabinding.version2.descriptors.FeatureSettingsDescriptor 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/CalcIdParam.java b/src/jalview/schemabinding/version2/CalcIdParam.java new file mode 100644 index 0000000..9fc3384 --- /dev/null +++ b/src/jalview/schemabinding/version2/CalcIdParam.java @@ -0,0 +1,283 @@ +/* + * This class was automatically generated with + * Castor 1.1, using an XML + * Schema. + * $Id$ + */ + +package jalview.schemabinding.version2; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import org.exolab.castor.xml.Marshaller; +import org.exolab.castor.xml.Unmarshaller; + +/** + * Class CalcIdParam. + * + * @version $Revision$ $Date$ + */ +public class CalcIdParam extends WebServiceParameterSet +implements java.io.Serializable +{ + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * handle for the calculation which uses this parameter set + */ + private java.lang.String _calcId; + + /** + * should the calculation be performed immediately after + * loading in order to refresh results + */ + private boolean _needsUpdate = false; + + /** + * keeps track of state for field: _needsUpdate + */ + private boolean _has_needsUpdate; + + /** + * should the calculation be automatically performed on edits + */ + private boolean _autoUpdate; + + /** + * keeps track of state for field: _autoUpdate + */ + private boolean _has_autoUpdate; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public CalcIdParam() { + super(); + } + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + */ + public void deleteAutoUpdate( + ) { + this._has_autoUpdate= false; + } + + /** + */ + public void deleteNeedsUpdate( + ) { + this._has_needsUpdate= false; + } + + /** + * Returns the value of field 'autoUpdate'. The field + * 'autoUpdate' has the following description: should the + * calculation be automatically performed on edits + * + * @return the value of field 'AutoUpdate'. + */ + public boolean getAutoUpdate( + ) { + return this._autoUpdate; + } + + /** + * Returns the value of field 'calcId'. The field 'calcId' has + * the following description: handle for the calculation which + * uses this parameter set + * + * @return the value of field 'CalcId'. + */ + public java.lang.String getCalcId( + ) { + return this._calcId; + } + + /** + * Returns the value of field 'needsUpdate'. The field + * 'needsUpdate' has the following description: should the + * calculation be performed immediately after loading in order + * to refresh results + * + * @return the value of field 'NeedsUpdate'. + */ + public boolean getNeedsUpdate( + ) { + return this._needsUpdate; + } + + /** + * Method hasAutoUpdate. + * + * @return true if at least one AutoUpdate has been added + */ + public boolean hasAutoUpdate( + ) { + return this._has_autoUpdate; + } + + /** + * Method hasNeedsUpdate. + * + * @return true if at least one NeedsUpdate has been added + */ + public boolean hasNeedsUpdate( + ) { + return this._has_needsUpdate; + } + + /** + * Returns the value of field 'autoUpdate'. The field + * 'autoUpdate' has the following description: should the + * calculation be automatically performed on edits + * + * @return the value of field 'AutoUpdate'. + */ + public boolean isAutoUpdate( + ) { + return this._autoUpdate; + } + + /** + * Returns the value of field 'needsUpdate'. The field + * 'needsUpdate' has the following description: should the + * calculation be performed immediately after loading in order + * to refresh results + * + * @return the value of field 'NeedsUpdate'. + */ + public boolean isNeedsUpdate( + ) { + return this._needsUpdate; + } + + /** + * Method isValid. + * + * @return true if this object is valid according to the schema + */ + public boolean isValid( + ) { + try { + validate(); + } catch (org.exolab.castor.xml.ValidationException vex) { + return false; + } + return true; + } + + /** + * + * + * @param out + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + */ + public void marshal( + final java.io.Writer out) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { + Marshaller.marshal(this, out); + } + + /** + * + * + * @param handler + * @throws java.io.IOException if an IOException occurs during + * marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + */ + public void marshal( + final org.xml.sax.ContentHandler handler) + throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { + Marshaller.marshal(this, handler); + } + + /** + * Sets the value of field 'autoUpdate'. The field 'autoUpdate' + * has the following description: should the calculation be + * automatically performed on edits + * + * @param autoUpdate the value of field 'autoUpdate'. + */ + public void setAutoUpdate( + final boolean autoUpdate) { + this._autoUpdate = autoUpdate; + this._has_autoUpdate = true; + } + + /** + * Sets the value of field 'calcId'. The field 'calcId' has the + * following description: handle for the calculation which uses + * this parameter set + * + * @param calcId the value of field 'calcId'. + */ + public void setCalcId( + final java.lang.String calcId) { + this._calcId = calcId; + } + + /** + * Sets the value of field 'needsUpdate'. The field + * 'needsUpdate' has the following description: should the + * calculation be performed immediately after loading in order + * to refresh results + * + * @param needsUpdate the value of field 'needsUpdate'. + */ + public void setNeedsUpdate( + final boolean needsUpdate) { + this._needsUpdate = needsUpdate; + this._has_needsUpdate = true; + } + + /** + * Method unmarshal. + * + * @param reader + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + * @return the unmarshaled + * jalview.schemabinding.version2.CalcIdParam + */ + public static jalview.schemabinding.version2.CalcIdParam unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { + return (jalview.schemabinding.version2.CalcIdParam) Unmarshaller.unmarshal(jalview.schemabinding.version2.CalcIdParam.class, reader); + } + + /** + * + * + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + */ + public void validate( + ) + throws org.exolab.castor.xml.ValidationException { + org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); + validator.validate(this); + } + +} diff --git a/src/jalview/schemabinding/version2/Viewport.java b/src/jalview/schemabinding/version2/Viewport.java index 948d7d0..000844e 100644 --- a/src/jalview/schemabinding/version2/Viewport.java +++ b/src/jalview/schemabinding/version2/Viewport.java @@ -1,20 +1,3 @@ -/******************************************************************************* - * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7) - * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle - * - * This file is part of Jalview. - * - * Jalview is free software: you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - * - * Jalview is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with Jalview. If not, see . - *******************************************************************************/ /* * This class was automatically generated with * Castor 1.1, using an XML @@ -389,8 +372,9 @@ public class Viewport implements java.io.Serializable { private boolean _has_textColThreshold; /** - * unique id used by jalview to synchronize between stored and - * instantiated views + * unique id used by jalview to + * synchronize between stored and + * instantiated views * */ private java.lang.String _id; @@ -445,6 +429,11 @@ public class Viewport implements java.io.Serializable { */ private java.util.Vector _hiddenColumnsList; + /** + * Field _calcIdParamList. + */ + private java.util.Vector _calcIdParamList; + //----------------/ //- Constructors -/ @@ -453,6 +442,7 @@ public class Viewport implements java.io.Serializable { public Viewport() { super(); this._hiddenColumnsList = new java.util.Vector(); + this._calcIdParamList = new java.util.Vector(); } @@ -463,6 +453,34 @@ public class Viewport implements java.io.Serializable { /** * * + * @param vCalcIdParam + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + */ + public void addCalcIdParam( + final jalview.schemabinding.version2.CalcIdParam vCalcIdParam) + throws java.lang.IndexOutOfBoundsException { + this._calcIdParamList.addElement(vCalcIdParam); + } + + /** + * + * + * @param index + * @param vCalcIdParam + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + */ + public void addCalcIdParam( + final int index, + final jalview.schemabinding.version2.CalcIdParam vCalcIdParam) + throws java.lang.IndexOutOfBoundsException { + this._calcIdParamList.add(index, vCalcIdParam); + } + + /** + * + * * @param vHiddenColumns * @throws java.lang.IndexOutOfBoundsException if the index * given is outside the bounds of the collection @@ -741,6 +759,17 @@ public class Viewport implements java.io.Serializable { } /** + * Method enumerateCalcIdParam. + * + * @return an Enumeration over all + * jalview.schemabinding.version2.CalcIdParam elements + */ + public java.util.Enumeration enumerateCalcIdParam( + ) { + return this._calcIdParamList.elements(); + } + + /** * Method enumerateHiddenColumns. * * @return an Enumeration over all @@ -772,6 +801,51 @@ public class Viewport implements java.io.Serializable { } /** + * Method getCalcIdParam. + * + * @param index + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + * @return the value of the + * jalview.schemabinding.version2.CalcIdParam at the given index + */ + public jalview.schemabinding.version2.CalcIdParam getCalcIdParam( + final int index) + throws java.lang.IndexOutOfBoundsException { + // check bounds for index + if (index < 0 || index >= this._calcIdParamList.size()) { + throw new IndexOutOfBoundsException("getCalcIdParam: Index value '" + index + "' not in range [0.." + (this._calcIdParamList.size() - 1) + "]"); + } + + return (jalview.schemabinding.version2.CalcIdParam) _calcIdParamList.get(index); + } + + /** + * Method getCalcIdParam.Returns the contents of the collection + * in an Array.

Note: Just in case the collection contents + * are changing in another thread, we pass a 0-length Array of + * the correct type into the API call. This way we know + * that the Array returned is of exactly the correct length. + * + * @return this collection as an Array + */ + public jalview.schemabinding.version2.CalcIdParam[] getCalcIdParam( + ) { + jalview.schemabinding.version2.CalcIdParam[] array = new jalview.schemabinding.version2.CalcIdParam[0]; + return (jalview.schemabinding.version2.CalcIdParam[]) this._calcIdParamList.toArray(array); + } + + /** + * Method getCalcIdParamCount. + * + * @return the size of this collection + */ + public int getCalcIdParamCount( + ) { + return this._calcIdParamList.size(); + } + + /** * Returns the value of field 'centreColumnLabels'. * * @return the value of field 'CentreColumnLabels'. @@ -921,7 +995,8 @@ public class Viewport implements java.io.Serializable { /** * Returns the value of field 'id'. The field 'id' has the * following description: unique id used by jalview to - * synchronize between stored and instantiated views + * synchronize between stored and + * instantiated views * * * @return the value of field 'Id'. @@ -1876,12 +1951,43 @@ public class Viewport implements java.io.Serializable { /** */ + public void removeAllCalcIdParam( + ) { + this._calcIdParamList.clear(); + } + + /** + */ public void removeAllHiddenColumns( ) { this._hiddenColumnsList.clear(); } /** + * Method removeCalcIdParam. + * + * @param vCalcIdParam + * @return true if the object was removed from the collection. + */ + public boolean removeCalcIdParam( + final jalview.schemabinding.version2.CalcIdParam vCalcIdParam) { + boolean removed = _calcIdParamList.remove(vCalcIdParam); + return removed; + } + + /** + * Method removeCalcIdParamAt. + * + * @param index + * @return the element removed from the collection + */ + public jalview.schemabinding.version2.CalcIdParam removeCalcIdParamAt( + final int index) { + java.lang.Object obj = this._calcIdParamList.remove(index); + return (jalview.schemabinding.version2.CalcIdParam) obj; + } + + /** * Method removeHiddenColumns. * * @param vHiddenColumns @@ -1927,6 +2033,41 @@ public class Viewport implements java.io.Serializable { } /** + * + * + * @param index + * @param vCalcIdParam + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + */ + public void setCalcIdParam( + final int index, + final jalview.schemabinding.version2.CalcIdParam vCalcIdParam) + throws java.lang.IndexOutOfBoundsException { + // check bounds for index + if (index < 0 || index >= this._calcIdParamList.size()) { + throw new IndexOutOfBoundsException("setCalcIdParam: Index value '" + index + "' not in range [0.." + (this._calcIdParamList.size() - 1) + "]"); + } + + this._calcIdParamList.set(index, vCalcIdParam); + } + + /** + * + * + * @param vCalcIdParamArray + */ + public void setCalcIdParam( + final jalview.schemabinding.version2.CalcIdParam[] vCalcIdParamArray) { + //-- copy array + _calcIdParamList.clear(); + + for (int i = 0; i < vCalcIdParamArray.length; i++) { + this._calcIdParamList.add(vCalcIdParamArray[i]); + } + } + + /** * Sets the value of field 'centreColumnLabels'. * * @param centreColumnLabels the value of field @@ -2075,7 +2216,8 @@ public class Viewport implements java.io.Serializable { /** * Sets the value of field 'id'. The field 'id' has the * following description: unique id used by jalview to - * synchronize between stored and instantiated views + * synchronize between stored and + * instantiated views * * * @param id the value of field 'id'. diff --git a/src/jalview/schemabinding/version2/descriptors/CalcIdParamDescriptor.java b/src/jalview/schemabinding/version2/descriptors/CalcIdParamDescriptor.java new file mode 100644 index 0000000..46e867c --- /dev/null +++ b/src/jalview/schemabinding/version2/descriptors/CalcIdParamDescriptor.java @@ -0,0 +1,279 @@ +/* + * This class was automatically generated with + * Castor 1.1, using an XML + * Schema. + * $Id$ + */ + +package jalview.schemabinding.version2.descriptors; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import jalview.schemabinding.version2.CalcIdParam; + +/** + * Class CalcIdParamDescriptor. + * + * @version $Revision$ $Date$ + */ +public class CalcIdParamDescriptor extends jalview.schemabinding.version2.descriptors.WebServiceParameterSetDescriptor { + + + //--------------------------/ + //- 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 CalcIdParamDescriptor() { + super(); + setExtendsWithoutFlatten(new jalview.schemabinding.version2.descriptors.WebServiceParameterSetDescriptor()); + _nsURI = "www.jalview.org"; + _xmlName = "calcIdParam"; + _elementDefinition = true; + org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; + org.exolab.castor.mapping.FieldHandler handler = null; + org.exolab.castor.xml.FieldValidator fieldValidator = null; + //-- initialize attribute descriptors + + //-- _calcId + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_calcId", "calcId", 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 + { + CalcIdParam target = (CalcIdParam) object; + return target.getCalcId(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + CalcIdParam target = (CalcIdParam) object; + target.setCalcId( (java.lang.String) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return null; + } + }; + desc.setHandler(handler); + desc.setRequired(true); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _calcId + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + org.exolab.castor.xml.validators.StringValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.StringValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setWhiteSpace("preserve"); + } + desc.setValidator(fieldValidator); + //-- _needsUpdate + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_needsUpdate", "needsUpdate", org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + CalcIdParam target = (CalcIdParam) object; + if (!target.hasNeedsUpdate()) { return null; } + return (target.getNeedsUpdate() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + CalcIdParam target = (CalcIdParam) object; + // if null, use delete method for optional primitives + if (value == null) { + target.deleteNeedsUpdate(); + return; + } + target.setNeedsUpdate( ((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: _needsUpdate + 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); + //-- _autoUpdate + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_autoUpdate", "autoUpdate", org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + CalcIdParam target = (CalcIdParam) object; + if (!target.hasAutoUpdate()) { return null; } + return (target.getAutoUpdate() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + CalcIdParam target = (CalcIdParam) object; + // ignore null values for non optional primitives + if (value == null) { return; } + + target.setAutoUpdate( ((java.lang.Boolean) value).booleanValue()); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return null; + } + }; + desc.setHandler(handler); + desc.setRequired(true); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _autoUpdate + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + org.exolab.castor.xml.validators.BooleanValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- initialize element descriptors + + } + + + //-----------/ + //- 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.CalcIdParam.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; + } + +} diff --git a/src/jalview/schemabinding/version2/descriptors/ViewportDescriptor.java b/src/jalview/schemabinding/version2/descriptors/ViewportDescriptor.java index c4fc82d..7d067fa 100644 --- a/src/jalview/schemabinding/version2/descriptors/ViewportDescriptor.java +++ b/src/jalview/schemabinding/version2/descriptors/ViewportDescriptor.java @@ -1,20 +1,3 @@ -/******************************************************************************* - * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7) - * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle - * - * This file is part of Jalview. - * - * Jalview is free software: you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - * - * Jalview is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with Jalview. If not, see . - *******************************************************************************/ /* * This class was automatically generated with * Castor 1.1, using an XML @@ -1880,6 +1863,48 @@ public class ViewportDescriptor extends org.exolab.castor.xml.util.XMLClassDescr { //-- local scope } desc.setValidator(fieldValidator); + //-- _calcIdParamList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(jalview.schemabinding.version2.CalcIdParam.class, "_calcIdParamList", "calcIdParam", 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.getCalcIdParam(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Viewport target = (Viewport) object; + target.addCalcIdParam( (jalview.schemabinding.version2.CalcIdParam) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException { + try { + Viewport target = (Viewport) object; + target.removeAllCalcIdParam(); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return new jalview.schemabinding.version2.CalcIdParam(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("www.jalview.org"); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + //-- validation code for: _calcIdParamList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { //-- local scope + } + desc.setValidator(fieldValidator); } -- 1.7.10.2