2 * This class was automatically generated with
3 * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
8 package jalview.schemabinding.version2;
10 //---------------------------------/
11 //- Imported classes and packages -/
12 //---------------------------------/
14 import org.exolab.castor.xml.Marshaller;
15 import org.exolab.castor.xml.Unmarshaller;
20 * @version $Revision$ $Date$
22 public class Colour implements java.io.Serializable
25 // --------------------------/
26 // - Class/Member Variables -/
27 // --------------------------/
30 * Single letter residue code for an alignment colour scheme, or feature type
31 * for a feature colour scheme
33 private java.lang.String _name;
38 private java.lang.String _RGB;
43 private java.lang.String _minRGB;
46 * Field _noValueColour.
48 private jalview.schemabinding.version2.types.NoValueColour _noValueColour = jalview.schemabinding.version2.types.NoValueColour
54 private jalview.schemabinding.version2.types.ColourThreshTypeType _threshType;
59 private float _threshold;
62 * keeps track of state for field: _threshold
64 private boolean _has_threshold;
72 * keeps track of state for field: _max
74 private boolean _has_max;
82 * keeps track of state for field: _min
84 private boolean _has_min;
87 * Field _colourByLabel.
89 private boolean _colourByLabel;
92 * keeps track of state for field: _colourByLabel
94 private boolean _has_colourByLabel;
99 private boolean _autoScale;
102 * keeps track of state for field: _autoScale
104 private boolean _has_autoScale;
107 * name of feature attribute to colour by, or attribute and sub-attribute
109 private java.util.Vector _attributeNameList;
118 setNoValueColour(jalview.schemabinding.version2.types.NoValueColour
120 this._attributeNameList = new java.util.Vector();
130 * @param vAttributeName
131 * @throws java.lang.IndexOutOfBoundsException
132 * if the index given is outside the bounds of the collection
134 public void addAttributeName(final java.lang.String vAttributeName)
135 throws java.lang.IndexOutOfBoundsException
137 // check for the maximum size
138 if (this._attributeNameList.size() >= 2)
140 throw new IndexOutOfBoundsException(
141 "addAttributeName has a maximum of 2");
144 this._attributeNameList.addElement(vAttributeName);
151 * @param vAttributeName
152 * @throws java.lang.IndexOutOfBoundsException
153 * if the index given is outside the bounds of the collection
155 public void addAttributeName(final int index,
156 final java.lang.String vAttributeName)
157 throws java.lang.IndexOutOfBoundsException
159 // check for the maximum size
160 if (this._attributeNameList.size() >= 2)
162 throw new IndexOutOfBoundsException(
163 "addAttributeName has a maximum of 2");
166 this._attributeNameList.add(index, vAttributeName);
171 public void deleteAutoScale()
173 this._has_autoScale = false;
178 public void deleteColourByLabel()
180 this._has_colourByLabel = false;
185 public void deleteMax()
187 this._has_max = false;
192 public void deleteMin()
194 this._has_min = false;
199 public void deleteThreshold()
201 this._has_threshold = false;
205 * Method enumerateAttributeName.
207 * @return an Enumeration over all java.lang.String elements
209 public java.util.Enumeration enumerateAttributeName()
211 return this._attributeNameList.elements();
215 * Method getAttributeName.
218 * @throws java.lang.IndexOutOfBoundsException
219 * if the index given is outside the bounds of the collection
220 * @return the value of the java.lang.String at the given index
222 public java.lang.String getAttributeName(final int index)
223 throws java.lang.IndexOutOfBoundsException
225 // check bounds for index
226 if (index < 0 || index >= this._attributeNameList.size())
228 throw new IndexOutOfBoundsException("getAttributeName: Index value '"
229 + index + "' not in range [0.."
230 + (this._attributeNameList.size() - 1) + "]");
233 return (java.lang.String) _attributeNameList.get(index);
237 * Method getAttributeName.Returns the contents of the collection in an Array.
239 * Note: Just in case the collection contents are changing in another thread,
240 * we pass a 0-length Array of the correct type into the API call. This way we
241 * <i>know</i> that the Array returned is of exactly the correct length.
243 * @return this collection as an Array
245 public java.lang.String[] getAttributeName()
247 java.lang.String[] array = new java.lang.String[0];
248 return (java.lang.String[]) this._attributeNameList.toArray(array);
252 * Method getAttributeNameCount.
254 * @return the size of this collection
256 public int getAttributeNameCount()
258 return this._attributeNameList.size();
262 * Returns the value of field 'autoScale'.
264 * @return the value of field 'AutoScale'.
266 public boolean getAutoScale()
268 return this._autoScale;
272 * Returns the value of field 'colourByLabel'.
274 * @return the value of field 'ColourByLabel'.
276 public boolean getColourByLabel()
278 return this._colourByLabel;
282 * Returns the value of field 'max'.
284 * @return the value of field 'Max'.
286 public float getMax()
292 * Returns the value of field 'min'.
294 * @return the value of field 'Min'.
296 public float getMin()
302 * Returns the value of field 'minRGB'.
304 * @return the value of field 'MinRGB'.
306 public java.lang.String getMinRGB()
312 * Returns the value of field 'name'. The field 'name' has the following
313 * description: Single letter residue code for an alignment colour scheme, or
314 * feature type for a feature colour scheme
316 * @return the value of field 'Name'.
318 public java.lang.String getName()
324 * Returns the value of field 'noValueColour'.
326 * @return the value of field 'NoValueColour'.
328 public jalview.schemabinding.version2.types.NoValueColour getNoValueColour()
330 return this._noValueColour;
334 * Returns the value of field 'RGB'.
336 * @return the value of field 'RGB'.
338 public java.lang.String getRGB()
344 * Returns the value of field 'threshType'.
346 * @return the value of field 'ThreshType'.
348 public jalview.schemabinding.version2.types.ColourThreshTypeType getThreshType()
350 return this._threshType;
354 * Returns the value of field 'threshold'.
356 * @return the value of field 'Threshold'.
358 public float getThreshold()
360 return this._threshold;
364 * Method hasAutoScale.
366 * @return true if at least one AutoScale has been added
368 public boolean hasAutoScale()
370 return this._has_autoScale;
374 * Method hasColourByLabel.
376 * @return true if at least one ColourByLabel has been added
378 public boolean hasColourByLabel()
380 return this._has_colourByLabel;
386 * @return true if at least one Max has been added
388 public boolean hasMax()
390 return this._has_max;
396 * @return true if at least one Min has been added
398 public boolean hasMin()
400 return this._has_min;
404 * Method hasThreshold.
406 * @return true if at least one Threshold has been added
408 public boolean hasThreshold()
410 return this._has_threshold;
414 * Returns the value of field 'autoScale'.
416 * @return the value of field 'AutoScale'.
418 public boolean isAutoScale()
420 return this._autoScale;
424 * Returns the value of field 'colourByLabel'.
426 * @return the value of field 'ColourByLabel'.
428 public boolean isColourByLabel()
430 return this._colourByLabel;
436 * @return true if this object is valid according to the schema
438 public boolean isValid()
443 } catch (org.exolab.castor.xml.ValidationException vex)
454 * @throws org.exolab.castor.xml.MarshalException
455 * if object is null or if any SAXException is thrown during
457 * @throws org.exolab.castor.xml.ValidationException
458 * if this object is an invalid instance according to the schema
460 public void marshal(final java.io.Writer out)
461 throws org.exolab.castor.xml.MarshalException,
462 org.exolab.castor.xml.ValidationException
464 Marshaller.marshal(this, out);
471 * @throws java.io.IOException
472 * if an IOException occurs during marshaling
473 * @throws org.exolab.castor.xml.ValidationException
474 * if this object is an invalid instance according to the schema
475 * @throws org.exolab.castor.xml.MarshalException
476 * if object is null or if any SAXException is thrown during
479 public void marshal(final org.xml.sax.ContentHandler handler)
480 throws java.io.IOException,
481 org.exolab.castor.xml.MarshalException,
482 org.exolab.castor.xml.ValidationException
484 Marshaller.marshal(this, handler);
489 public void removeAllAttributeName()
491 this._attributeNameList.clear();
495 * Method removeAttributeName.
497 * @param vAttributeName
498 * @return true if the object was removed from the collection.
500 public boolean removeAttributeName(final java.lang.String vAttributeName)
502 boolean removed = _attributeNameList.remove(vAttributeName);
507 * Method removeAttributeNameAt.
510 * @return the element removed from the collection
512 public java.lang.String removeAttributeNameAt(final int index)
514 java.lang.Object obj = this._attributeNameList.remove(index);
515 return (java.lang.String) obj;
522 * @param vAttributeName
523 * @throws java.lang.IndexOutOfBoundsException
524 * if the index given is outside the bounds of the collection
526 public void setAttributeName(final int index,
527 final java.lang.String vAttributeName)
528 throws java.lang.IndexOutOfBoundsException
530 // check bounds for index
531 if (index < 0 || index >= this._attributeNameList.size())
533 throw new IndexOutOfBoundsException("setAttributeName: Index value '"
534 + index + "' not in range [0.."
535 + (this._attributeNameList.size() - 1) + "]");
538 this._attributeNameList.set(index, vAttributeName);
544 * @param vAttributeNameArray
546 public void setAttributeName(final java.lang.String[] vAttributeNameArray)
549 _attributeNameList.clear();
551 for (int i = 0; i < vAttributeNameArray.length; i++)
553 this._attributeNameList.add(vAttributeNameArray[i]);
558 * Sets the value of field 'autoScale'.
561 * the value of field 'autoScale'.
563 public void setAutoScale(final boolean autoScale)
565 this._autoScale = autoScale;
566 this._has_autoScale = true;
570 * Sets the value of field 'colourByLabel'.
572 * @param colourByLabel
573 * the value of field 'colourByLabel'.
575 public void setColourByLabel(final boolean colourByLabel)
577 this._colourByLabel = colourByLabel;
578 this._has_colourByLabel = true;
582 * Sets the value of field 'max'.
585 * the value of field 'max'.
587 public void setMax(final float max)
590 this._has_max = true;
594 * Sets the value of field 'min'.
597 * the value of field 'min'.
599 public void setMin(final float min)
602 this._has_min = true;
606 * Sets the value of field 'minRGB'.
609 * the value of field 'minRGB'.
611 public void setMinRGB(final java.lang.String minRGB)
613 this._minRGB = minRGB;
617 * Sets the value of field 'name'. The field 'name' has the following
618 * description: Single letter residue code for an alignment colour scheme, or
619 * feature type for a feature colour scheme
622 * the value of field 'name'.
624 public void setName(final java.lang.String name)
630 * Sets the value of field 'noValueColour'.
632 * @param noValueColour
633 * the value of field 'noValueColour'.
635 public void setNoValueColour(
636 final jalview.schemabinding.version2.types.NoValueColour noValueColour)
638 this._noValueColour = noValueColour;
642 * Sets the value of field 'RGB'.
645 * the value of field 'RGB'.
647 public void setRGB(final java.lang.String RGB)
653 * Sets the value of field 'threshType'.
656 * the value of field 'threshType'.
658 public void setThreshType(
659 final jalview.schemabinding.version2.types.ColourThreshTypeType threshType)
661 this._threshType = threshType;
665 * Sets the value of field 'threshold'.
668 * the value of field 'threshold'.
670 public void setThreshold(final float threshold)
672 this._threshold = threshold;
673 this._has_threshold = true;
680 * @throws org.exolab.castor.xml.MarshalException
681 * if object is null or if any SAXException is thrown during
683 * @throws org.exolab.castor.xml.ValidationException
684 * if this object is an invalid instance according to the schema
685 * @return the unmarshaled jalview.schemabinding.version2.Colour
687 public static jalview.schemabinding.version2.Colour unmarshal(
688 final java.io.Reader reader)
689 throws org.exolab.castor.xml.MarshalException,
690 org.exolab.castor.xml.ValidationException
692 return (jalview.schemabinding.version2.Colour) Unmarshaller
693 .unmarshal(jalview.schemabinding.version2.Colour.class, reader);
699 * @throws org.exolab.castor.xml.ValidationException
700 * if this object is an invalid instance according to the schema
702 public void validate() throws org.exolab.castor.xml.ValidationException
704 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
705 validator.validate(this);