From: amwaterhouse Date: Mon, 5 Dec 2005 13:37:38 +0000 (+0000) Subject: Save features X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=206907e81392f14925eec7759d16d6cf07460f49;p=jalview.git Save features --- diff --git a/src/jalview/binding/FeatureSettings.java b/src/jalview/binding/FeatureSettings.java new file mode 100755 index 0000000..2ef3731 --- /dev/null +++ b/src/jalview/binding/FeatureSettings.java @@ -0,0 +1,274 @@ +/* + * This class was automatically generated with + * Castor 0.9.6, using an XML + * Schema. + * $Id$ + */ + +package jalview.binding; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import java.io.IOException; +import java.io.Reader; +import java.io.Serializable; +import java.io.Writer; +import java.util.Enumeration; +import java.util.Vector; +import org.exolab.castor.xml.MarshalException; +import org.exolab.castor.xml.Marshaller; +import org.exolab.castor.xml.Unmarshaller; +import org.exolab.castor.xml.ValidationException; +import org.xml.sax.ContentHandler; + +/** + * Class FeatureSettings. + * + * @version $Revision$ $Date$ + */ +public class FeatureSettings implements java.io.Serializable { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field _settingList + */ + private java.util.Vector _settingList; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public FeatureSettings() { + super(); + _settingList = new Vector(); + } //-- jalview.binding.FeatureSettings() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method addSetting + * + * + * + * @param vSetting + */ + public void addSetting(jalview.binding.Setting vSetting) + throws java.lang.IndexOutOfBoundsException + { + _settingList.addElement(vSetting); + } //-- void addSetting(jalview.binding.Setting) + + /** + * Method addSetting + * + * + * + * @param index + * @param vSetting + */ + public void addSetting(int index, jalview.binding.Setting vSetting) + throws java.lang.IndexOutOfBoundsException + { + _settingList.insertElementAt(vSetting, index); + } //-- void addSetting(int, jalview.binding.Setting) + + /** + * Method enumerateSetting + * + * + * + * @return Enumeration + */ + public java.util.Enumeration enumerateSetting() + { + return _settingList.elements(); + } //-- java.util.Enumeration enumerateSetting() + + /** + * Method getSetting + * + * + * + * @param index + * @return Setting + */ + public jalview.binding.Setting getSetting(int index) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _settingList.size())) { + throw new IndexOutOfBoundsException(); + } + + return (jalview.binding.Setting) _settingList.elementAt(index); + } //-- jalview.binding.Setting getSetting(int) + + /** + * Method getSetting + * + * + * + * @return Setting + */ + public jalview.binding.Setting[] getSetting() + { + int size = _settingList.size(); + jalview.binding.Setting[] mArray = new jalview.binding.Setting[size]; + for (int index = 0; index < size; index++) { + mArray[index] = (jalview.binding.Setting) _settingList.elementAt(index); + } + return mArray; + } //-- jalview.binding.Setting[] getSetting() + + /** + * Method getSettingCount + * + * + * + * @return int + */ + public int getSettingCount() + { + return _settingList.size(); + } //-- int getSettingCount() + + /** + * Method isValid + * + * + * + * @return boolean + */ + public boolean isValid() + { + try { + validate(); + } + catch (org.exolab.castor.xml.ValidationException vex) { + return false; + } + return true; + } //-- boolean isValid() + + /** + * Method marshal + * + * + * + * @param out + */ + public void marshal(java.io.Writer out) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + + Marshaller.marshal(this, out); + } //-- void marshal(java.io.Writer) + + /** + * Method marshal + * + * + * + * @param handler + */ + public void marshal(org.xml.sax.ContentHandler handler) + throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + + Marshaller.marshal(this, handler); + } //-- void marshal(org.xml.sax.ContentHandler) + + /** + * Method removeAllSetting + * + */ + public void removeAllSetting() + { + _settingList.removeAllElements(); + } //-- void removeAllSetting() + + /** + * Method removeSetting + * + * + * + * @param index + * @return Setting + */ + public jalview.binding.Setting removeSetting(int index) + { + java.lang.Object obj = _settingList.elementAt(index); + _settingList.removeElementAt(index); + return (jalview.binding.Setting) obj; + } //-- jalview.binding.Setting removeSetting(int) + + /** + * Method setSetting + * + * + * + * @param index + * @param vSetting + */ + public void setSetting(int index, jalview.binding.Setting vSetting) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _settingList.size())) { + throw new IndexOutOfBoundsException(); + } + _settingList.setElementAt(vSetting, index); + } //-- void setSetting(int, jalview.binding.Setting) + + /** + * Method setSetting + * + * + * + * @param settingArray + */ + public void setSetting(jalview.binding.Setting[] settingArray) + { + //-- copy array + _settingList.removeAllElements(); + for (int i = 0; i < settingArray.length; i++) { + _settingList.addElement(settingArray[i]); + } + } //-- void setSetting(jalview.binding.Setting) + + /** + * Method unmarshal + * + * + * + * @param reader + * @return Object + */ + public static java.lang.Object unmarshal(java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + return (jalview.binding.FeatureSettings) Unmarshaller.unmarshal(jalview.binding.FeatureSettings.class, reader); + } //-- java.lang.Object unmarshal(java.io.Reader) + + /** + * Method validate + * + */ + public void validate() + throws org.exolab.castor.xml.ValidationException + { + org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); + validator.validate(this); + } //-- void validate() + +} diff --git a/src/jalview/binding/JalviewModelSequence.java b/src/jalview/binding/JalviewModelSequence.java index 4ac40d5..cbb50d5 100755 --- a/src/jalview/binding/JalviewModelSequence.java +++ b/src/jalview/binding/JalviewModelSequence.java @@ -60,6 +60,11 @@ public class JalviewModelSequence implements java.io.Serializable { */ private java.util.Vector _treeList; + /** + * Field _featureSettings + */ + private jalview.binding.FeatureSettings _featureSettings; + //----------------/ //- Constructors -/ @@ -275,6 +280,17 @@ public class JalviewModelSequence implements java.io.Serializable { } //-- java.util.Enumeration enumerateViewport() /** + * Returns the value of field 'featureSettings'. + * + * @return FeatureSettings + * @return the value of field 'featureSettings'. + */ + public jalview.binding.FeatureSettings getFeatureSettings() + { + return this._featureSettings; + } //-- jalview.binding.FeatureSettings getFeatureSettings() + + /** * Method getJGroup * * @@ -681,6 +697,16 @@ public class JalviewModelSequence implements java.io.Serializable { } //-- jalview.binding.Viewport removeViewport(int) /** + * Sets the value of field 'featureSettings'. + * + * @param featureSettings the value of field 'featureSettings'. + */ + public void setFeatureSettings(jalview.binding.FeatureSettings featureSettings) + { + this._featureSettings = featureSettings; + } //-- void setFeatureSettings(jalview.binding.FeatureSettings) + + /** * Method setJGroup * * diff --git a/src/jalview/binding/Setting.java b/src/jalview/binding/Setting.java new file mode 100755 index 0000000..7b56676 --- /dev/null +++ b/src/jalview/binding/Setting.java @@ -0,0 +1,253 @@ +/* + * This class was automatically generated with + * Castor 0.9.6, using an XML + * Schema. + * $Id$ + */ + +package jalview.binding; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import java.io.IOException; +import java.io.Reader; +import java.io.Serializable; +import java.io.Writer; +import org.exolab.castor.xml.MarshalException; +import org.exolab.castor.xml.Marshaller; +import org.exolab.castor.xml.Unmarshaller; +import org.exolab.castor.xml.ValidationException; +import org.xml.sax.ContentHandler; + +/** + * Class Setting. + * + * @version $Revision$ $Date$ + */ +public class Setting implements java.io.Serializable { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field _type + */ + private java.lang.String _type; + + /** + * Field _colour + */ + private int _colour; + + /** + * keeps track of state for field: _colour + */ + private boolean _has_colour; + + /** + * Field _display + */ + private boolean _display; + + /** + * keeps track of state for field: _display + */ + private boolean _has_display; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public Setting() { + super(); + } //-- jalview.binding.Setting() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method deleteColour + * + */ + public void deleteColour() + { + this._has_colour= false; + } //-- void deleteColour() + + /** + * Method deleteDisplay + * + */ + public void deleteDisplay() + { + this._has_display= false; + } //-- void deleteDisplay() + + /** + * Returns the value of field 'colour'. + * + * @return int + * @return the value of field 'colour'. + */ + public int getColour() + { + return this._colour; + } //-- int getColour() + + /** + * Returns the value of field 'display'. + * + * @return boolean + * @return the value of field 'display'. + */ + public boolean getDisplay() + { + return this._display; + } //-- boolean getDisplay() + + /** + * Returns the value of field 'type'. + * + * @return String + * @return the value of field 'type'. + */ + public java.lang.String getType() + { + return this._type; + } //-- java.lang.String getType() + + /** + * Method hasColour + * + * + * + * @return boolean + */ + public boolean hasColour() + { + return this._has_colour; + } //-- boolean hasColour() + + /** + * Method hasDisplay + * + * + * + * @return boolean + */ + public boolean hasDisplay() + { + return this._has_display; + } //-- boolean hasDisplay() + + /** + * Method isValid + * + * + * + * @return boolean + */ + public boolean isValid() + { + try { + validate(); + } + catch (org.exolab.castor.xml.ValidationException vex) { + return false; + } + return true; + } //-- boolean isValid() + + /** + * Method marshal + * + * + * + * @param out + */ + public void marshal(java.io.Writer out) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + + Marshaller.marshal(this, out); + } //-- void marshal(java.io.Writer) + + /** + * Method marshal + * + * + * + * @param handler + */ + public void marshal(org.xml.sax.ContentHandler handler) + throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + + Marshaller.marshal(this, handler); + } //-- void marshal(org.xml.sax.ContentHandler) + + /** + * Sets the value of field 'colour'. + * + * @param colour the value of field 'colour'. + */ + public void setColour(int colour) + { + this._colour = colour; + this._has_colour = true; + } //-- void setColour(int) + + /** + * Sets the value of field 'display'. + * + * @param display the value of field 'display'. + */ + public void setDisplay(boolean display) + { + this._display = display; + this._has_display = true; + } //-- void setDisplay(boolean) + + /** + * Sets the value of field 'type'. + * + * @param type the value of field 'type'. + */ + public void setType(java.lang.String type) + { + this._type = type; + } //-- void setType(java.lang.String) + + /** + * Method unmarshal + * + * + * + * @param reader + * @return Object + */ + public static java.lang.Object unmarshal(java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + return (jalview.binding.Setting) Unmarshaller.unmarshal(jalview.binding.Setting.class, reader); + } //-- java.lang.Object unmarshal(java.io.Reader) + + /** + * Method validate + * + */ + public void validate() + throws org.exolab.castor.xml.ValidationException + { + org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); + validator.validate(this); + } //-- void validate() + +}