From 0c5212bb1f000b06c01d71e67242efd74cfbc3b9 Mon Sep 17 00:00:00 2001 From: gmungoc Date: Thu, 18 Jun 2015 17:05:17 +0100 Subject: [PATCH] JAL-892 schema changes (rnaViewer) for save Varna to project --- schemas/jalview.xsd | 568 +++++++++-------- src/jalview/schemabinding/version2/.castor.cdr | 4 +- src/jalview/schemabinding/version2/JSeq.java | 162 +++++ src/jalview/schemabinding/version2/RnaViewer.java | 643 ++++++++++++++++++++ .../schemabinding/version2/SecondaryStructure.java | 290 +++++++++ .../version2/descriptors/JSeqDescriptor.java | 42 ++ .../version2/descriptors/RnaViewerDescriptor.java | 535 ++++++++++++++++ .../descriptors/SecondaryStructureDescriptor.java | 311 ++++++++++ 8 files changed, 2285 insertions(+), 270 deletions(-) create mode 100644 src/jalview/schemabinding/version2/RnaViewer.java create mode 100644 src/jalview/schemabinding/version2/SecondaryStructure.java create mode 100644 src/jalview/schemabinding/version2/descriptors/RnaViewerDescriptor.java create mode 100644 src/jalview/schemabinding/version2/descriptors/SecondaryStructureDescriptor.java diff --git a/schemas/jalview.xsd b/schemas/jalview.xsd index eab6500..f60bb6a 100755 --- a/schemas/jalview.xsd +++ b/schemas/jalview.xsd @@ -1,26 +1,26 @@ - - - - - + + + + + @@ -30,28 +30,22 @@ - - + + - + - - - - - + + + + additional @@ -110,9 +104,8 @@ - + Flag @@ -141,9 +134,8 @@ - + Flag @@ -174,9 +166,8 @@ - + Flag @@ -207,8 +198,17 @@ use="optional"> - An identifier for the viewer type, currently either - JMOL or CHIMERA + An + identifier + for + the + viewer + type, + currently + either + JMOL + or + CHIMERA @@ -222,24 +222,82 @@ - + + + + Reference to a viewer showing RNA structure + for this sequence. Schema supports one viewer showing multiple + annotations for multiple sequences, though currently only one + annotation for one sequence (gapped or trimmed) is used + + + + + + + + + + id attribute of Annotation in + vamsasModel for + the secondary structure annotation shown + in the viewer + + + + + + if true the RNA structure is shown with gaps, if false without + + + + + + name of the project jar entry that holds + the VARNA viewer state for the structure + + + + + + + + + + + An id unique to the RNA viewer panel + + + + + + horizontal position of split pane divider + + + + + + Index of the selected structure in the + viewer panel + + + + + - - - - + + + + - + - + @@ -248,150 +306,142 @@ - + - - - - + + + + - - - - - - - + + + + + + + Optional sequence group ID (only - needs to be unique for this + 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 - - - - + + + + + + + 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 + synchronize + between stored and instantiated views @@ -400,24 +450,22 @@ use="optional"> - The viewport id of this viewport's (cdna/protein) coding complement, if any + The viewport id of this viewport's + (cdna/protein) coding complement, if any - + - + - + @@ -427,22 +475,17 @@ - - - - - - + + + + + + Tree ID added for binding tree - visualization settings to vamsas + visualization + settings to vamsas document trees in jalview 2.4.1 @@ -453,29 +496,25 @@ - + - - - - - + + + + + Optional minimum colour - for graduated feature + for graduated + feature colour - + threshold value for @@ -483,8 +522,8 @@ - + threshold type for @@ -492,23 +531,19 @@ - - - - + + + + - + - - + + @@ -521,65 +556,60 @@ - - + + - - - - - - - + + + + + + + - - + + - - - + + + - + + + + base attributes for windows displayed in Jalview + desktop. + + + + + + + + + + + + + + + + - --> - - - - base attributes for windows displayed in Jalview desktop. - - - - - - - - - - - - - - - - - - + diff --git a/src/jalview/schemabinding/version2/.castor.cdr b/src/jalview/schemabinding/version2/.castor.cdr index 65150f6..2b8e4b5 100644 --- a/src/jalview/schemabinding/version2/.castor.cdr +++ b/src/jalview/schemabinding/version2/.castor.cdr @@ -1,4 +1,4 @@ -#Wed Jun 10 11:15:53 BST 2015 +#Wed Jun 17 15:04:02 BST 2015 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 @@ -10,8 +10,10 @@ jalview.schemabinding.version2.OtherData=jalview.schemabinding.version2.descript jalview.schemabinding.version2.Setting=jalview.schemabinding.version2.descriptors.SettingDescriptor jalview.schemabinding.version2.AlcodonFrame=jalview.schemabinding.version2.descriptors.AlcodonFrameDescriptor jalview.schemabinding.version2.AnnotationElement=jalview.schemabinding.version2.descriptors.AnnotationElementDescriptor +jalview.schemabinding.version2.SecondaryStructure=jalview.schemabinding.version2.descriptors.SecondaryStructureDescriptor jalview.schemabinding.version2.SequenceSet=jalview.schemabinding.version2.descriptors.SequenceSetDescriptor jalview.schemabinding.version2.Viewport=jalview.schemabinding.version2.descriptors.ViewportDescriptor +jalview.schemabinding.version2.RnaViewer=jalview.schemabinding.version2.descriptors.RnaViewerDescriptor jalview.schemabinding.version2.MapListType=jalview.schemabinding.version2.descriptors.MapListTypeDescriptor jalview.schemabinding.version2.Property=jalview.schemabinding.version2.descriptors.PropertyDescriptor jalview.schemabinding.version2.UserColourScheme=jalview.schemabinding.version2.descriptors.UserColourSchemeDescriptor diff --git a/src/jalview/schemabinding/version2/JSeq.java b/src/jalview/schemabinding/version2/JSeq.java index d5eda07..193b005 100644 --- a/src/jalview/schemabinding/version2/JSeq.java +++ b/src/jalview/schemabinding/version2/JSeq.java @@ -86,6 +86,17 @@ public class JSeq implements java.io.Serializable { */ private java.util.Vector _hiddenSequencesList; + /** + * Reference to a viewer showing RNA structure + * for this sequence. Schema supports one viewer showing + * multiple + * annotations for multiple sequences, though currently only + * one + * annotation for one sequence (gapped or trimmed) is used + * + */ + private java.util.Vector _rnaViewerList; + //----------------/ //- Constructors -/ @@ -96,6 +107,7 @@ public class JSeq implements java.io.Serializable { this._featuresList = new java.util.Vector(); this._pdbidsList = new java.util.Vector(); this._hiddenSequencesList = new java.util.Vector(); + this._rnaViewerList = new java.util.Vector(); } @@ -188,6 +200,34 @@ public class JSeq implements java.io.Serializable { } /** + * + * + * @param vRnaViewer + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + */ + public void addRnaViewer( + final jalview.schemabinding.version2.RnaViewer vRnaViewer) + throws java.lang.IndexOutOfBoundsException { + this._rnaViewerList.addElement(vRnaViewer); + } + + /** + * + * + * @param index + * @param vRnaViewer + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + */ + public void addRnaViewer( + final int index, + final jalview.schemabinding.version2.RnaViewer vRnaViewer) + throws java.lang.IndexOutOfBoundsException { + this._rnaViewerList.add(index, vRnaViewer); + } + + /** */ public void deleteColour( ) { @@ -248,6 +288,17 @@ public class JSeq implements java.io.Serializable { } /** + * Method enumerateRnaViewer. + * + * @return an Enumeration over all + * jalview.schemabinding.version2.RnaViewer elements + */ + public java.util.Enumeration enumerateRnaViewer( + ) { + return this._rnaViewerList.elements(); + } + + /** * Returns the value of field 'colour'. * * @return the value of field 'Colour'. @@ -424,6 +475,51 @@ public class JSeq implements java.io.Serializable { } /** + * Method getRnaViewer. + * + * @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.RnaViewer at the given index + */ + public jalview.schemabinding.version2.RnaViewer getRnaViewer( + final int index) + throws java.lang.IndexOutOfBoundsException { + // check bounds for index + if (index < 0 || index >= this._rnaViewerList.size()) { + throw new IndexOutOfBoundsException("getRnaViewer: Index value '" + index + "' not in range [0.." + (this._rnaViewerList.size() - 1) + "]"); + } + + return (jalview.schemabinding.version2.RnaViewer) _rnaViewerList.get(index); + } + + /** + * Method getRnaViewer.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.RnaViewer[] getRnaViewer( + ) { + jalview.schemabinding.version2.RnaViewer[] array = new jalview.schemabinding.version2.RnaViewer[0]; + return (jalview.schemabinding.version2.RnaViewer[]) this._rnaViewerList.toArray(array); + } + + /** + * Method getRnaViewerCount. + * + * @return the size of this collection + */ + public int getRnaViewerCount( + ) { + return this._rnaViewerList.size(); + } + + /** * Returns the value of field 'start'. * * @return the value of field 'Start'. @@ -552,6 +648,13 @@ public class JSeq implements java.io.Serializable { } /** + */ + public void removeAllRnaViewer( + ) { + this._rnaViewerList.clear(); + } + + /** * Method removeFeatures. * * @param vFeatures @@ -624,6 +727,30 @@ public class JSeq implements java.io.Serializable { } /** + * Method removeRnaViewer. + * + * @param vRnaViewer + * @return true if the object was removed from the collection. + */ + public boolean removeRnaViewer( + final jalview.schemabinding.version2.RnaViewer vRnaViewer) { + boolean removed = _rnaViewerList.remove(vRnaViewer); + return removed; + } + + /** + * Method removeRnaViewerAt. + * + * @param index + * @return the element removed from the collection + */ + public jalview.schemabinding.version2.RnaViewer removeRnaViewerAt( + final int index) { + java.lang.Object obj = this._rnaViewerList.remove(index); + return (jalview.schemabinding.version2.RnaViewer) obj; + } + + /** * Sets the value of field 'colour'. * * @param colour the value of field 'colour'. @@ -772,6 +899,41 @@ public class JSeq implements java.io.Serializable { } /** + * + * + * @param index + * @param vRnaViewer + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + */ + public void setRnaViewer( + final int index, + final jalview.schemabinding.version2.RnaViewer vRnaViewer) + throws java.lang.IndexOutOfBoundsException { + // check bounds for index + if (index < 0 || index >= this._rnaViewerList.size()) { + throw new IndexOutOfBoundsException("setRnaViewer: Index value '" + index + "' not in range [0.." + (this._rnaViewerList.size() - 1) + "]"); + } + + this._rnaViewerList.set(index, vRnaViewer); + } + + /** + * + * + * @param vRnaViewerArray + */ + public void setRnaViewer( + final jalview.schemabinding.version2.RnaViewer[] vRnaViewerArray) { + //-- copy array + _rnaViewerList.clear(); + + for (int i = 0; i < vRnaViewerArray.length; i++) { + this._rnaViewerList.add(vRnaViewerArray[i]); + } + } + + /** * Sets the value of field 'start'. * * @param start the value of field 'start'. diff --git a/src/jalview/schemabinding/version2/RnaViewer.java b/src/jalview/schemabinding/version2/RnaViewer.java new file mode 100644 index 0000000..96c4195 --- /dev/null +++ b/src/jalview/schemabinding/version2/RnaViewer.java @@ -0,0 +1,643 @@ +/* + * 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; + +/** + * Reference to a viewer showing RNA structure + * for this sequence. Schema supports one viewer showing multiple + * annotations for multiple sequences, though currently only one + * annotation for one sequence (gapped or trimmed) is used + * + * + * @version $Revision$ $Date$ + */ +public class RnaViewer implements java.io.Serializable { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field _title. + */ + private java.lang.String _title; + + /** + * An id unique to the RNA viewer panel + * + */ + private java.lang.String _viewId; + + /** + * horizontal position of split pane divider + * + */ + private int _dividerLocation; + + /** + * keeps track of state for field: _dividerLocation + */ + private boolean _has_dividerLocation; + + /** + * Index of the selected structure in the + * viewer panel + * + */ + private int _selectedRna; + + /** + * keeps track of state for field: _selectedRna + */ + private boolean _has_selectedRna; + + /** + * Field _width. + */ + private int _width; + + /** + * keeps track of state for field: _width + */ + private boolean _has_width; + + /** + * Field _height. + */ + private int _height; + + /** + * keeps track of state for field: _height + */ + private boolean _has_height; + + /** + * Field _xpos. + */ + private int _xpos; + + /** + * keeps track of state for field: _xpos + */ + private boolean _has_xpos; + + /** + * Field _ypos. + */ + private int _ypos; + + /** + * keeps track of state for field: _ypos + */ + private boolean _has_ypos; + + /** + * Field _secondaryStructureList. + */ + private java.util.Vector _secondaryStructureList; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public RnaViewer() { + super(); + this._secondaryStructureList = new java.util.Vector(); + } + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * + * + * @param vSecondaryStructure + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + */ + public void addSecondaryStructure( + final jalview.schemabinding.version2.SecondaryStructure vSecondaryStructure) + throws java.lang.IndexOutOfBoundsException { + this._secondaryStructureList.addElement(vSecondaryStructure); + } + + /** + * + * + * @param index + * @param vSecondaryStructure + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + */ + public void addSecondaryStructure( + final int index, + final jalview.schemabinding.version2.SecondaryStructure vSecondaryStructure) + throws java.lang.IndexOutOfBoundsException { + this._secondaryStructureList.add(index, vSecondaryStructure); + } + + /** + */ + public void deleteDividerLocation( + ) { + this._has_dividerLocation= false; + } + + /** + */ + public void deleteHeight( + ) { + this._has_height= false; + } + + /** + */ + public void deleteSelectedRna( + ) { + this._has_selectedRna= false; + } + + /** + */ + public void deleteWidth( + ) { + this._has_width= false; + } + + /** + */ + public void deleteXpos( + ) { + this._has_xpos= false; + } + + /** + */ + public void deleteYpos( + ) { + this._has_ypos= false; + } + + /** + * Method enumerateSecondaryStructure. + * + * @return an Enumeration over all + * jalview.schemabinding.version2.SecondaryStructure elements + */ + public java.util.Enumeration enumerateSecondaryStructure( + ) { + return this._secondaryStructureList.elements(); + } + + /** + * Returns the value of field 'dividerLocation'. The field + * 'dividerLocation' has the following description: horizontal + * position of split pane divider + * + * + * @return the value of field 'DividerLocation'. + */ + public int getDividerLocation( + ) { + return this._dividerLocation; + } + + /** + * Returns the value of field 'height'. + * + * @return the value of field 'Height'. + */ + public int getHeight( + ) { + return this._height; + } + + /** + * Method getSecondaryStructure. + * + * @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.SecondaryStructure at the + * given index + */ + public jalview.schemabinding.version2.SecondaryStructure getSecondaryStructure( + final int index) + throws java.lang.IndexOutOfBoundsException { + // check bounds for index + if (index < 0 || index >= this._secondaryStructureList.size()) { + throw new IndexOutOfBoundsException("getSecondaryStructure: Index value '" + index + "' not in range [0.." + (this._secondaryStructureList.size() - 1) + "]"); + } + + return (jalview.schemabinding.version2.SecondaryStructure) _secondaryStructureList.get(index); + } + + /** + * Method getSecondaryStructure.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.SecondaryStructure[] getSecondaryStructure( + ) { + jalview.schemabinding.version2.SecondaryStructure[] array = new jalview.schemabinding.version2.SecondaryStructure[0]; + return (jalview.schemabinding.version2.SecondaryStructure[]) this._secondaryStructureList.toArray(array); + } + + /** + * Method getSecondaryStructureCount. + * + * @return the size of this collection + */ + public int getSecondaryStructureCount( + ) { + return this._secondaryStructureList.size(); + } + + /** + * Returns the value of field 'selectedRna'. The field + * 'selectedRna' has the following description: Index of the + * selected structure in the + * viewer panel + * + * + * @return the value of field 'SelectedRna'. + */ + public int getSelectedRna( + ) { + return this._selectedRna; + } + + /** + * Returns the value of field 'title'. + * + * @return the value of field 'Title'. + */ + public java.lang.String getTitle( + ) { + return this._title; + } + + /** + * Returns the value of field 'viewId'. The field 'viewId' has + * the following description: An id unique to the RNA viewer + * panel + * + * + * @return the value of field 'ViewId'. + */ + public java.lang.String getViewId( + ) { + return this._viewId; + } + + /** + * Returns the value of field 'width'. + * + * @return the value of field 'Width'. + */ + public int getWidth( + ) { + return this._width; + } + + /** + * Returns the value of field 'xpos'. + * + * @return the value of field 'Xpos'. + */ + public int getXpos( + ) { + return this._xpos; + } + + /** + * Returns the value of field 'ypos'. + * + * @return the value of field 'Ypos'. + */ + public int getYpos( + ) { + return this._ypos; + } + + /** + * Method hasDividerLocation. + * + * @return true if at least one DividerLocation has been added + */ + public boolean hasDividerLocation( + ) { + return this._has_dividerLocation; + } + + /** + * Method hasHeight. + * + * @return true if at least one Height has been added + */ + public boolean hasHeight( + ) { + return this._has_height; + } + + /** + * Method hasSelectedRna. + * + * @return true if at least one SelectedRna has been added + */ + public boolean hasSelectedRna( + ) { + return this._has_selectedRna; + } + + /** + * Method hasWidth. + * + * @return true if at least one Width has been added + */ + public boolean hasWidth( + ) { + return this._has_width; + } + + /** + * Method hasXpos. + * + * @return true if at least one Xpos has been added + */ + public boolean hasXpos( + ) { + return this._has_xpos; + } + + /** + * Method hasYpos. + * + * @return true if at least one Ypos has been added + */ + public boolean hasYpos( + ) { + return this._has_ypos; + } + + /** + * Method isValid. + * + * @return true if this object is valid according to the schema + */ + public boolean isValid( + ) { + try { + validate(); + } catch (org.exolab.castor.xml.ValidationException vex) { + return false; + } + return true; + } + + /** + * + * + * @param out + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + */ + public void marshal( + final java.io.Writer out) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { + Marshaller.marshal(this, out); + } + + /** + * + * + * @param handler + * @throws java.io.IOException if an IOException occurs during + * marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + */ + public void marshal( + final org.xml.sax.ContentHandler handler) + throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { + Marshaller.marshal(this, handler); + } + + /** + */ + public void removeAllSecondaryStructure( + ) { + this._secondaryStructureList.clear(); + } + + /** + * Method removeSecondaryStructure. + * + * @param vSecondaryStructure + * @return true if the object was removed from the collection. + */ + public boolean removeSecondaryStructure( + final jalview.schemabinding.version2.SecondaryStructure vSecondaryStructure) { + boolean removed = _secondaryStructureList.remove(vSecondaryStructure); + return removed; + } + + /** + * Method removeSecondaryStructureAt. + * + * @param index + * @return the element removed from the collection + */ + public jalview.schemabinding.version2.SecondaryStructure removeSecondaryStructureAt( + final int index) { + java.lang.Object obj = this._secondaryStructureList.remove(index); + return (jalview.schemabinding.version2.SecondaryStructure) obj; + } + + /** + * Sets the value of field 'dividerLocation'. The field + * 'dividerLocation' has the following description: horizontal + * position of split pane divider + * + * + * @param dividerLocation the value of field 'dividerLocation'. + */ + public void setDividerLocation( + final int dividerLocation) { + this._dividerLocation = dividerLocation; + this._has_dividerLocation = true; + } + + /** + * Sets the value of field 'height'. + * + * @param height the value of field 'height'. + */ + public void setHeight( + final int height) { + this._height = height; + this._has_height = true; + } + + /** + * + * + * @param index + * @param vSecondaryStructure + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + */ + public void setSecondaryStructure( + final int index, + final jalview.schemabinding.version2.SecondaryStructure vSecondaryStructure) + throws java.lang.IndexOutOfBoundsException { + // check bounds for index + if (index < 0 || index >= this._secondaryStructureList.size()) { + throw new IndexOutOfBoundsException("setSecondaryStructure: Index value '" + index + "' not in range [0.." + (this._secondaryStructureList.size() - 1) + "]"); + } + + this._secondaryStructureList.set(index, vSecondaryStructure); + } + + /** + * + * + * @param vSecondaryStructureArray + */ + public void setSecondaryStructure( + final jalview.schemabinding.version2.SecondaryStructure[] vSecondaryStructureArray) { + //-- copy array + _secondaryStructureList.clear(); + + for (int i = 0; i < vSecondaryStructureArray.length; i++) { + this._secondaryStructureList.add(vSecondaryStructureArray[i]); + } + } + + /** + * Sets the value of field 'selectedRna'. The field + * 'selectedRna' has the following description: Index of the + * selected structure in the + * viewer panel + * + * + * @param selectedRna the value of field 'selectedRna'. + */ + public void setSelectedRna( + final int selectedRna) { + this._selectedRna = selectedRna; + this._has_selectedRna = true; + } + + /** + * Sets the value of field 'title'. + * + * @param title the value of field 'title'. + */ + public void setTitle( + final java.lang.String title) { + this._title = title; + } + + /** + * Sets the value of field 'viewId'. The field 'viewId' has the + * following description: An id unique to the RNA viewer panel + * + * + * @param viewId the value of field 'viewId'. + */ + public void setViewId( + final java.lang.String viewId) { + this._viewId = viewId; + } + + /** + * Sets the value of field 'width'. + * + * @param width the value of field 'width'. + */ + public void setWidth( + final int width) { + this._width = width; + this._has_width = true; + } + + /** + * Sets the value of field 'xpos'. + * + * @param xpos the value of field 'xpos'. + */ + public void setXpos( + final int xpos) { + this._xpos = xpos; + this._has_xpos = true; + } + + /** + * Sets the value of field 'ypos'. + * + * @param ypos the value of field 'ypos'. + */ + public void setYpos( + final int ypos) { + this._ypos = ypos; + this._has_ypos = 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.RnaViewer + */ + public static jalview.schemabinding.version2.RnaViewer unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { + return (jalview.schemabinding.version2.RnaViewer) Unmarshaller.unmarshal(jalview.schemabinding.version2.RnaViewer.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/SecondaryStructure.java b/src/jalview/schemabinding/version2/SecondaryStructure.java new file mode 100644 index 0000000..d2f97fb --- /dev/null +++ b/src/jalview/schemabinding/version2/SecondaryStructure.java @@ -0,0 +1,290 @@ +/* + * 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 SecondaryStructure. + * + * @version $Revision$ $Date$ + */ +public class SecondaryStructure implements java.io.Serializable { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field _title. + */ + private java.lang.String _title; + + /** + * id attribute of Annotation in + * vamsasModel for + * the secondary structure annotation shown + * in the viewer + * + */ + private java.lang.String _annotationId; + + /** + * if true the RNA structure is shown with gaps, if false + * without + * + */ + private boolean _gapped; + + /** + * keeps track of state for field: _gapped + */ + private boolean _has_gapped; + + /** + * name of the project jar entry that holds + * the VARNA viewer state for the structure + * + */ + private java.lang.String _viewerState; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public SecondaryStructure() { + super(); + } + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + */ + public void deleteGapped( + ) { + this._has_gapped= false; + } + + /** + * Returns the value of field 'annotationId'. The field + * 'annotationId' has the following description: id attribute + * of Annotation in + * vamsasModel for + * the secondary structure annotation shown + * in the viewer + * + * + * @return the value of field 'AnnotationId'. + */ + public java.lang.String getAnnotationId( + ) { + return this._annotationId; + } + + /** + * Returns the value of field 'gapped'. The field 'gapped' has + * the following description: if true the RNA structure is + * shown with gaps, if false without + * + * + * @return the value of field 'Gapped'. + */ + public boolean getGapped( + ) { + return this._gapped; + } + + /** + * Returns the value of field 'title'. + * + * @return the value of field 'Title'. + */ + public java.lang.String getTitle( + ) { + return this._title; + } + + /** + * Returns the value of field 'viewerState'. The field + * 'viewerState' has the following description: name of the + * project jar entry that holds + * the VARNA viewer state for the structure + * + * + * @return the value of field 'ViewerState'. + */ + public java.lang.String getViewerState( + ) { + return this._viewerState; + } + + /** + * Method hasGapped. + * + * @return true if at least one Gapped has been added + */ + public boolean hasGapped( + ) { + return this._has_gapped; + } + + /** + * Returns the value of field 'gapped'. The field 'gapped' has + * the following description: if true the RNA structure is + * shown with gaps, if false without + * + * + * @return the value of field 'Gapped'. + */ + public boolean isGapped( + ) { + return this._gapped; + } + + /** + * 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 'annotationId'. The field + * 'annotationId' has the following description: id attribute + * of Annotation in + * vamsasModel for + * the secondary structure annotation shown + * in the viewer + * + * + * @param annotationId the value of field 'annotationId'. + */ + public void setAnnotationId( + final java.lang.String annotationId) { + this._annotationId = annotationId; + } + + /** + * Sets the value of field 'gapped'. The field 'gapped' has the + * following description: if true the RNA structure is shown + * with gaps, if false without + * + * + * @param gapped the value of field 'gapped'. + */ + public void setGapped( + final boolean gapped) { + this._gapped = gapped; + this._has_gapped = true; + } + + /** + * Sets the value of field 'title'. + * + * @param title the value of field 'title'. + */ + public void setTitle( + final java.lang.String title) { + this._title = title; + } + + /** + * Sets the value of field 'viewerState'. The field + * 'viewerState' has the following description: name of the + * project jar entry that holds + * the VARNA viewer state for the structure + * + * + * @param viewerState the value of field 'viewerState'. + */ + public void setViewerState( + final java.lang.String viewerState) { + this._viewerState = viewerState; + } + + /** + * 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.SecondaryStructure + */ + public static jalview.schemabinding.version2.SecondaryStructure unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { + return (jalview.schemabinding.version2.SecondaryStructure) Unmarshaller.unmarshal(jalview.schemabinding.version2.SecondaryStructure.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/descriptors/JSeqDescriptor.java b/src/jalview/schemabinding/version2/descriptors/JSeqDescriptor.java index ab0eaaf..44c8caf 100644 --- a/src/jalview/schemabinding/version2/descriptors/JSeqDescriptor.java +++ b/src/jalview/schemabinding/version2/descriptors/JSeqDescriptor.java @@ -408,6 +408,48 @@ public class JSeqDescriptor extends org.exolab.castor.xml.util.XMLClassDescripto typeValidator.setMaxInclusive(2147483647); } desc.setValidator(fieldValidator); + //-- _rnaViewerList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(jalview.schemabinding.version2.RnaViewer.class, "_rnaViewerList", "rnaViewer", org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + JSeq target = (JSeq) object; + return target.getRnaViewer(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + JSeq target = (JSeq) object; + target.addRnaViewer( (jalview.schemabinding.version2.RnaViewer) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException { + try { + JSeq target = (JSeq) object; + target.removeAllRnaViewer(); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return new jalview.schemabinding.version2.RnaViewer(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("www.jalview.org"); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + //-- validation code for: _rnaViewerList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { //-- local scope + } + desc.setValidator(fieldValidator); } diff --git a/src/jalview/schemabinding/version2/descriptors/RnaViewerDescriptor.java b/src/jalview/schemabinding/version2/descriptors/RnaViewerDescriptor.java new file mode 100644 index 0000000..fd824a1 --- /dev/null +++ b/src/jalview/schemabinding/version2/descriptors/RnaViewerDescriptor.java @@ -0,0 +1,535 @@ +/* + * 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.RnaViewer; + +/** + * Class RnaViewerDescriptor. + * + * @version $Revision$ $Date$ + */ +public class RnaViewerDescriptor 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 RnaViewerDescriptor() { + super(); + _nsURI = "www.jalview.org"; + _xmlName = "rnaViewer"; + _elementDefinition = true; + + //-- set grouping compositor + setCompositorAsSequence(); + org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; + org.exolab.castor.mapping.FieldHandler handler = null; + org.exolab.castor.xml.FieldValidator fieldValidator = null; + //-- initialize attribute descriptors + + //-- _title + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_title", "title", 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 + { + RnaViewer target = (RnaViewer) object; + return target.getTitle(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + RnaViewer target = (RnaViewer) object; + target.setTitle( (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.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _title + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + org.exolab.castor.xml.validators.StringValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.StringValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setWhiteSpace("preserve"); + } + desc.setValidator(fieldValidator); + //-- _viewId + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_viewId", "viewId", 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 + { + RnaViewer target = (RnaViewer) object; + return target.getViewId(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + RnaViewer target = (RnaViewer) object; + target.setViewId( (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.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _viewId + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + org.exolab.castor.xml.validators.StringValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.StringValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setWhiteSpace("preserve"); + } + desc.setValidator(fieldValidator); + //-- _dividerLocation + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_dividerLocation", "dividerLocation", org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + RnaViewer target = (RnaViewer) object; + if (!target.hasDividerLocation()) { return null; } + return new java.lang.Integer(target.getDividerLocation()); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + RnaViewer target = (RnaViewer) object; + // if null, use delete method for optional primitives + if (value == null) { + target.deleteDividerLocation(); + return; + } + target.setDividerLocation( ((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); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _dividerLocation + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + org.exolab.castor.xml.validators.IntValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IntValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setMinInclusive(-2147483648); + typeValidator.setMaxInclusive(2147483647); + } + desc.setValidator(fieldValidator); + //-- _selectedRna + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_selectedRna", "selectedRna", org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + RnaViewer target = (RnaViewer) object; + if (!target.hasSelectedRna()) { return null; } + return new java.lang.Integer(target.getSelectedRna()); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + RnaViewer target = (RnaViewer) object; + // if null, use delete method for optional primitives + if (value == null) { + target.deleteSelectedRna(); + return; + } + target.setSelectedRna( ((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); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _selectedRna + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + org.exolab.castor.xml.validators.IntValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IntValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setMinInclusive(-2147483648); + typeValidator.setMaxInclusive(2147483647); + } + desc.setValidator(fieldValidator); + //-- _width + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_width", "width", org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + RnaViewer target = (RnaViewer) object; + if (!target.hasWidth()) { return null; } + return new java.lang.Integer(target.getWidth()); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + RnaViewer target = (RnaViewer) object; + // if null, use delete method for optional primitives + if (value == null) { + target.deleteWidth(); + return; + } + target.setWidth( ((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); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _width + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + org.exolab.castor.xml.validators.IntValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IntValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setMinInclusive(-2147483648); + typeValidator.setMaxInclusive(2147483647); + } + desc.setValidator(fieldValidator); + //-- _height + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_height", "height", org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + RnaViewer target = (RnaViewer) object; + if (!target.hasHeight()) { return null; } + return new java.lang.Integer(target.getHeight()); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + RnaViewer target = (RnaViewer) object; + // if null, use delete method for optional primitives + if (value == null) { + target.deleteHeight(); + return; + } + target.setHeight( ((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); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _height + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + org.exolab.castor.xml.validators.IntValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IntValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setMinInclusive(-2147483648); + typeValidator.setMaxInclusive(2147483647); + } + desc.setValidator(fieldValidator); + //-- _xpos + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_xpos", "xpos", org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + RnaViewer target = (RnaViewer) object; + if (!target.hasXpos()) { return null; } + return new java.lang.Integer(target.getXpos()); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + RnaViewer target = (RnaViewer) object; + // if null, use delete method for optional primitives + if (value == null) { + target.deleteXpos(); + return; + } + target.setXpos( ((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); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _xpos + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + org.exolab.castor.xml.validators.IntValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IntValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setMinInclusive(-2147483648); + typeValidator.setMaxInclusive(2147483647); + } + desc.setValidator(fieldValidator); + //-- _ypos + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_ypos", "ypos", org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + RnaViewer target = (RnaViewer) object; + if (!target.hasYpos()) { return null; } + return new java.lang.Integer(target.getYpos()); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + RnaViewer target = (RnaViewer) object; + // if null, use delete method for optional primitives + if (value == null) { + target.deleteYpos(); + return; + } + target.setYpos( ((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); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _ypos + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + org.exolab.castor.xml.validators.IntValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IntValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setMinInclusive(-2147483648); + typeValidator.setMaxInclusive(2147483647); + } + desc.setValidator(fieldValidator); + //-- initialize element descriptors + + //-- _secondaryStructureList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(jalview.schemabinding.version2.SecondaryStructure.class, "_secondaryStructureList", "secondaryStructure", org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + RnaViewer target = (RnaViewer) object; + return target.getSecondaryStructure(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + RnaViewer target = (RnaViewer) object; + target.addSecondaryStructure( (jalview.schemabinding.version2.SecondaryStructure) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException { + try { + RnaViewer target = (RnaViewer) object; + target.removeAllSecondaryStructure(); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return new jalview.schemabinding.version2.SecondaryStructure(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("www.jalview.org"); + desc.setRequired(true); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + //-- validation code for: _secondaryStructureList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + } + desc.setValidator(fieldValidator); + } + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method getAccessMode. + * + * @return the access mode specified for this class. + */ + public org.exolab.castor.mapping.AccessMode getAccessMode( + ) { + return null; + } + + /** + * Method getIdentity. + * + * @return the identity field, null if this class has no + * identity. + */ + public org.exolab.castor.mapping.FieldDescriptor getIdentity( + ) { + return super.getIdentity(); + } + + /** + * Method getJavaClass. + * + * @return the Java class represented by this descriptor. + */ + public java.lang.Class getJavaClass( + ) { + return jalview.schemabinding.version2.RnaViewer.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/SecondaryStructureDescriptor.java b/src/jalview/schemabinding/version2/descriptors/SecondaryStructureDescriptor.java new file mode 100644 index 0000000..bc7e4ac --- /dev/null +++ b/src/jalview/schemabinding/version2/descriptors/SecondaryStructureDescriptor.java @@ -0,0 +1,311 @@ +/* + * 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.SecondaryStructure; + +/** + * Class SecondaryStructureDescriptor. + * + * @version $Revision$ $Date$ + */ +public class SecondaryStructureDescriptor 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 SecondaryStructureDescriptor() { + super(); + _nsURI = "www.jalview.org"; + _xmlName = "secondaryStructure"; + _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 + + //-- _title + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_title", "title", 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 + { + SecondaryStructure target = (SecondaryStructure) object; + return target.getTitle(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + SecondaryStructure target = (SecondaryStructure) object; + target.setTitle( (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.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _title + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + org.exolab.castor.xml.validators.StringValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.StringValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setWhiteSpace("preserve"); + } + desc.setValidator(fieldValidator); + //-- _annotationId + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_annotationId", "annotationId", 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 + { + SecondaryStructure target = (SecondaryStructure) object; + return target.getAnnotationId(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + SecondaryStructure target = (SecondaryStructure) object; + target.setAnnotationId( (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: _annotationId + 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); + //-- _gapped + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_gapped", "gapped", org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + SecondaryStructure target = (SecondaryStructure) object; + if (!target.hasGapped()) { return null; } + return (target.getGapped() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + SecondaryStructure target = (SecondaryStructure) object; + // if null, use delete method for optional primitives + if (value == null) { + target.deleteGapped(); + return; + } + target.setGapped( ((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: _gapped + 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); + //-- _viewerState + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_viewerState", "viewerState", 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 + { + SecondaryStructure target = (SecondaryStructure) object; + return target.getViewerState(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + SecondaryStructure target = (SecondaryStructure) object; + target.setViewerState( (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.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _viewerState + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + org.exolab.castor.xml.validators.StringValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.StringValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setWhiteSpace("preserve"); + } + desc.setValidator(fieldValidator); + //-- 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.SecondaryStructure.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; + } + +} -- 1.7.10.2