X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fbinding%2FJalviewUserColours.java;h=8df0d448a22418171f6115b7470a7cba5e178a8f;hb=b8d09897dacc7b0ad203982b4578e2c1d8929142;hp=676a62358dc47c9b53aa43d389f357713f9fa214;hpb=c68ce4c63bd79f23b87aac3eb0afa7f6b42a3098;p=jalview.git diff --git a/src/jalview/binding/JalviewUserColours.java b/src/jalview/binding/JalviewUserColours.java index 676a623..8df0d44 100755 --- a/src/jalview/binding/JalviewUserColours.java +++ b/src/jalview/binding/JalviewUserColours.java @@ -1,38 +1,39 @@ /* - * This class was automatically generated with + * This class was automatically generated with * Castor 0.9.6, using an XML * Schema. * $Id$ */ - package jalview.binding; - //---------------------------------/ - //- Imported classes and packages -/ -//---------------------------------/ +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; + +//---------------------------------/ +//- 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 JalviewUserColours. - * + * * @version $Revision$ $Date$ */ -public class JalviewUserColours implements java.io.Serializable { - - - //--------------------------/ - //- Class/Member Variables -/ +public class JalviewUserColours implements java.io.Serializable +{ + //--------------------------/ + //- Class/Member Variables -/ //--------------------------/ /** @@ -40,39 +41,38 @@ public class JalviewUserColours implements java.io.Serializable { */ private java.util.Vector _colourList; - - //----------------/ - //- Constructors -/ //----------------/ - - public JalviewUserColours() { + //- Constructors -/ + //----------------/ + public JalviewUserColours() + { super(); _colourList = new Vector(); - } //-- jalview.binding.JalviewUserColours() + } - - //-----------/ - //- Methods -/ + //-- jalview.binding.JalviewUserColours() //-----------/ /** - * Method addColour - * - * - * - * @param vColour + * DOCUMENT ME! + * + * @param vColour DOCUMENT ME! + * + * @throws java.lang.IndexOutOfBoundsException DOCUMENT ME! */ public void addColour(jalview.binding.Colour vColour) throws java.lang.IndexOutOfBoundsException { _colourList.addElement(vColour); - } //-- void addColour(jalview.binding.Colour) + } + + //-- void addColour(jalview.binding.Colour) /** * Method addColour - * - * - * + * + * + * * @param index * @param vColour */ @@ -80,25 +80,29 @@ public class JalviewUserColours implements java.io.Serializable { throws java.lang.IndexOutOfBoundsException { _colourList.insertElementAt(vColour, index); - } //-- void addColour(int, jalview.binding.Colour) + } + + //-- void addColour(int, jalview.binding.Colour) /** * Method enumerateColour - * - * - * + * + * + * * @return Enumeration */ public java.util.Enumeration enumerateColour() { return _colourList.elements(); - } //-- java.util.Enumeration enumerateColour() + } + + //-- java.util.Enumeration enumerateColour() /** * Method getColour - * - * - * + * + * + * * @param index * @return Colour */ @@ -106,102 +110,123 @@ public class JalviewUserColours implements java.io.Serializable { throws java.lang.IndexOutOfBoundsException { //-- check bounds for index - if ((index < 0) || (index > _colourList.size())) { + if ((index < 0) || (index > _colourList.size())) + { throw new IndexOutOfBoundsException(); } - + return (jalview.binding.Colour) _colourList.elementAt(index); - } //-- jalview.binding.Colour getColour(int) + } + + //-- jalview.binding.Colour getColour(int) /** * Method getColour - * - * - * + * + * + * * @return Colour */ public jalview.binding.Colour[] getColour() { int size = _colourList.size(); jalview.binding.Colour[] mArray = new jalview.binding.Colour[size]; - for (int index = 0; index < size; index++) { + + for (int index = 0; index < size; index++) + { mArray[index] = (jalview.binding.Colour) _colourList.elementAt(index); } + return mArray; - } //-- jalview.binding.Colour[] getColour() + } + + //-- jalview.binding.Colour[] getColour() /** * Method getColourCount - * - * - * + * + * + * * @return int */ public int getColourCount() { return _colourList.size(); - } //-- int getColourCount() + } + + //-- int getColourCount() /** * Method isValid - * - * - * + * + * + * * @return boolean */ public boolean isValid() { - try { + try + { validate(); } - catch (org.exolab.castor.xml.ValidationException vex) { + catch (org.exolab.castor.xml.ValidationException vex) + { return false; } + return true; - } //-- boolean isValid() + } + + //-- boolean isValid() /** * Method marshal - * - * - * + * + * + * * @param out */ public void marshal(java.io.Writer out) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException { - Marshaller.marshal(this, out); - } //-- void marshal(java.io.Writer) + } + + //-- 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 + throws java.io.IOException, org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException { - Marshaller.marshal(this, handler); - } //-- void marshal(org.xml.sax.ContentHandler) + } + + //-- void marshal(org.xml.sax.ContentHandler) /** * Method removeAllColour - * + * */ public void removeAllColour() { _colourList.removeAllElements(); - } //-- void removeAllColour() + } + + //-- void removeAllColour() /** * Method removeColour - * - * - * + * + * + * * @param index * @return Colour */ @@ -209,14 +234,17 @@ public class JalviewUserColours implements java.io.Serializable { { java.lang.Object obj = _colourList.elementAt(index); _colourList.removeElementAt(index); + return (jalview.binding.Colour) obj; - } //-- jalview.binding.Colour removeColour(int) + } + + //-- jalview.binding.Colour removeColour(int) /** * Method setColour - * - * - * + * + * + * * @param index * @param vColour */ @@ -224,51 +252,63 @@ public class JalviewUserColours implements java.io.Serializable { throws java.lang.IndexOutOfBoundsException { //-- check bounds for index - if ((index < 0) || (index > _colourList.size())) { + if ((index < 0) || (index > _colourList.size())) + { throw new IndexOutOfBoundsException(); } + _colourList.setElementAt(vColour, index); - } //-- void setColour(int, jalview.binding.Colour) + } + + //-- void setColour(int, jalview.binding.Colour) /** * Method setColour - * - * - * + * + * + * * @param colourArray */ public void setColour(jalview.binding.Colour[] colourArray) { //-- copy array _colourList.removeAllElements(); - for (int i = 0; i < colourArray.length; i++) { + + for (int i = 0; i < colourArray.length; i++) + { _colourList.addElement(colourArray[i]); } - } //-- void setColour(jalview.binding.Colour) + } + + //-- void setColour(jalview.binding.Colour) /** * 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 + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException { - return (jalview.binding.JalviewUserColours) Unmarshaller.unmarshal(jalview.binding.JalviewUserColours.class, reader); - } //-- java.lang.Object unmarshal(java.io.Reader) + return (jalview.binding.JalviewUserColours) Unmarshaller.unmarshal(jalview.binding.JalviewUserColours.class, + reader); + } + + //-- java.lang.Object unmarshal(java.io.Reader) /** * Method validate - * + * */ - public void validate() - throws org.exolab.castor.xml.ValidationException + 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() + } + //-- void validate() }