2 * This class was automatically generated with
\r
3 * <a href="http://www.castor.org">Castor 0.9.6</a>, using an XML
\r
8 package jalview.binding;
\r
10 //---------------------------------/
\r
11 //- Imported classes and packages -/
\r
12 //---------------------------------/
\r
14 import java.io.IOException;
\r
15 import java.io.Reader;
\r
16 import java.io.Serializable;
\r
17 import java.io.Writer;
\r
18 import java.util.Enumeration;
\r
19 import java.util.Vector;
\r
20 import org.exolab.castor.xml.MarshalException;
\r
21 import org.exolab.castor.xml.Marshaller;
\r
22 import org.exolab.castor.xml.Unmarshaller;
\r
23 import org.exolab.castor.xml.ValidationException;
\r
24 import org.xml.sax.ContentHandler;
\r
27 * Class JalviewUserColours.
\r
29 * @version $Revision$ $Date$
\r
31 public class JalviewUserColours implements java.io.Serializable {
\r
34 //--------------------------/
\r
35 //- Class/Member Variables -/
\r
36 //--------------------------/
\r
41 private java.lang.String _schemeName;
\r
46 private java.util.Vector _colourList;
\r
53 public JalviewUserColours() {
\r
55 _colourList = new Vector();
\r
56 } //-- jalview.binding.JalviewUserColours()
\r
70 public void addColour(jalview.binding.Colour vColour)
\r
71 throws java.lang.IndexOutOfBoundsException
\r
73 _colourList.addElement(vColour);
\r
74 } //-- void addColour(jalview.binding.Colour)
\r
84 public void addColour(int index, jalview.binding.Colour vColour)
\r
85 throws java.lang.IndexOutOfBoundsException
\r
87 _colourList.insertElementAt(vColour, index);
\r
88 } //-- void addColour(int, jalview.binding.Colour)
\r
91 * Method enumerateColour
\r
95 * @return Enumeration
\r
97 public java.util.Enumeration enumerateColour()
\r
99 return _colourList.elements();
\r
100 } //-- java.util.Enumeration enumerateColour()
\r
110 public jalview.binding.Colour getColour(int index)
\r
111 throws java.lang.IndexOutOfBoundsException
\r
113 //-- check bounds for index
\r
114 if ((index < 0) || (index > _colourList.size())) {
\r
115 throw new IndexOutOfBoundsException();
\r
118 return (jalview.binding.Colour) _colourList.elementAt(index);
\r
119 } //-- jalview.binding.Colour getColour(int)
\r
128 public jalview.binding.Colour[] getColour()
\r
130 int size = _colourList.size();
\r
131 jalview.binding.Colour[] mArray = new jalview.binding.Colour[size];
\r
132 for (int index = 0; index < size; index++) {
\r
133 mArray[index] = (jalview.binding.Colour) _colourList.elementAt(index);
\r
136 } //-- jalview.binding.Colour[] getColour()
\r
139 * Method getColourCount
\r
145 public int getColourCount()
\r
147 return _colourList.size();
\r
148 } //-- int getColourCount()
\r
151 * Returns the value of field 'schemeName'.
\r
154 * @return the value of field 'schemeName'.
\r
156 public java.lang.String getSchemeName()
\r
158 return this._schemeName;
\r
159 } //-- java.lang.String getSchemeName()
\r
168 public boolean isValid()
\r
173 catch (org.exolab.castor.xml.ValidationException vex) {
\r
177 } //-- boolean isValid()
\r
186 public void marshal(java.io.Writer out)
\r
187 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
\r
190 Marshaller.marshal(this, out);
\r
191 } //-- void marshal(java.io.Writer)
\r
200 public void marshal(org.xml.sax.ContentHandler handler)
\r
201 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
\r
204 Marshaller.marshal(this, handler);
\r
205 } //-- void marshal(org.xml.sax.ContentHandler)
\r
208 * Method removeAllColour
\r
211 public void removeAllColour()
\r
213 _colourList.removeAllElements();
\r
214 } //-- void removeAllColour()
\r
217 * Method removeColour
\r
224 public jalview.binding.Colour removeColour(int index)
\r
226 java.lang.Object obj = _colourList.elementAt(index);
\r
227 _colourList.removeElementAt(index);
\r
228 return (jalview.binding.Colour) obj;
\r
229 } //-- jalview.binding.Colour removeColour(int)
\r
239 public void setColour(int index, jalview.binding.Colour vColour)
\r
240 throws java.lang.IndexOutOfBoundsException
\r
242 //-- check bounds for index
\r
243 if ((index < 0) || (index > _colourList.size())) {
\r
244 throw new IndexOutOfBoundsException();
\r
246 _colourList.setElementAt(vColour, index);
\r
247 } //-- void setColour(int, jalview.binding.Colour)
\r
254 * @param colourArray
\r
256 public void setColour(jalview.binding.Colour[] colourArray)
\r
259 _colourList.removeAllElements();
\r
260 for (int i = 0; i < colourArray.length; i++) {
\r
261 _colourList.addElement(colourArray[i]);
\r
263 } //-- void setColour(jalview.binding.Colour)
\r
266 * Sets the value of field 'schemeName'.
\r
268 * @param schemeName the value of field 'schemeName'.
\r
270 public void setSchemeName(java.lang.String schemeName)
\r
272 this._schemeName = schemeName;
\r
273 } //-- void setSchemeName(java.lang.String)
\r
283 public static java.lang.Object unmarshal(java.io.Reader reader)
\r
284 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
\r
286 return (jalview.binding.JalviewUserColours) Unmarshaller.unmarshal(jalview.binding.JalviewUserColours.class, reader);
\r
287 } //-- java.lang.Object unmarshal(java.io.Reader)
\r
293 public void validate()
\r
294 throws org.exolab.castor.xml.ValidationException
\r
296 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
\r
297 validator.validate(this);
\r
298 } //-- void validate()
\r