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 * Colour if no attribute or score value
48 private jalview.schemabinding.version2.types.ColourNoValueColourType _noValueColour = jalview.schemabinding.version2.types.ColourNoValueColourType
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;
119 jalview.schemabinding.version2.types.ColourNoValueColourType
121 this._attributeNameList = new java.util.Vector();
131 * @param vAttributeName
132 * @throws java.lang.IndexOutOfBoundsException
133 * if the index given is outside the bounds of the collection
135 public void addAttributeName(final java.lang.String vAttributeName)
136 throws java.lang.IndexOutOfBoundsException
138 // check for the maximum size
139 if (this._attributeNameList.size() >= 2)
141 throw new IndexOutOfBoundsException(
142 "addAttributeName has a maximum of 2");
145 this._attributeNameList.addElement(vAttributeName);
152 * @param vAttributeName
153 * @throws java.lang.IndexOutOfBoundsException
154 * if the index given is outside the bounds of the collection
156 public void addAttributeName(final int index,
157 final java.lang.String vAttributeName)
158 throws java.lang.IndexOutOfBoundsException
160 // check for the maximum size
161 if (this._attributeNameList.size() >= 2)
163 throw new IndexOutOfBoundsException(
164 "addAttributeName has a maximum of 2");
167 this._attributeNameList.add(index, vAttributeName);
172 public void deleteAutoScale()
174 this._has_autoScale = false;
179 public void deleteColourByLabel()
181 this._has_colourByLabel = false;
186 public void deleteMax()
188 this._has_max = false;
193 public void deleteMin()
195 this._has_min = false;
200 public void deleteThreshold()
202 this._has_threshold = false;
206 * Method enumerateAttributeName.
208 * @return an Enumeration over all java.lang.String elements
210 public java.util.Enumeration enumerateAttributeName()
212 return this._attributeNameList.elements();
216 * Method getAttributeName.
219 * @throws java.lang.IndexOutOfBoundsException
220 * if the index given is outside the bounds of the collection
221 * @return the value of the java.lang.String at the given index
223 public java.lang.String getAttributeName(final int index)
224 throws java.lang.IndexOutOfBoundsException
226 // check bounds for index
227 if (index < 0 || index >= this._attributeNameList.size())
229 throw new IndexOutOfBoundsException("getAttributeName: Index value '"
230 + index + "' not in range [0.."
231 + (this._attributeNameList.size() - 1) + "]");
234 return (java.lang.String) _attributeNameList.get(index);
238 * Method getAttributeName.Returns the contents of the collection in an Array.
240 * Note: Just in case the collection contents are changing in another thread,
241 * we pass a 0-length Array of the correct type into the API call. This way we
242 * <i>know</i> that the Array returned is of exactly the correct length.
244 * @return this collection as an Array
246 public java.lang.String[] getAttributeName()
248 java.lang.String[] array = new java.lang.String[0];
249 return (java.lang.String[]) this._attributeNameList.toArray(array);
253 * Method getAttributeNameCount.
255 * @return the size of this collection
257 public int getAttributeNameCount()
259 return this._attributeNameList.size();
263 * Returns the value of field 'autoScale'.
265 * @return the value of field 'AutoScale'.
267 public boolean getAutoScale()
269 return this._autoScale;
273 * Returns the value of field 'colourByLabel'.
275 * @return the value of field 'ColourByLabel'.
277 public boolean getColourByLabel()
279 return this._colourByLabel;
283 * Returns the value of field 'max'.
285 * @return the value of field 'Max'.
287 public float getMax()
293 * Returns the value of field 'min'.
295 * @return the value of field 'Min'.
297 public float getMin()
303 * Returns the value of field 'minRGB'.
305 * @return the value of field 'MinRGB'.
307 public java.lang.String getMinRGB()
313 * Returns the value of field 'name'. The field 'name' has the following
314 * description: Single letter residue code for an alignment colour scheme, or
315 * feature type for a feature colour scheme
317 * @return the value of field 'Name'.
319 public java.lang.String getName()
325 * Returns the value of field 'noValueColour'. The field 'noValueColour' has
326 * the following description: Colour if no attribute or score value
328 * @return the value of field 'NoValueColour'.
330 public jalview.schemabinding.version2.types.ColourNoValueColourType getNoValueColour()
332 return this._noValueColour;
336 * Returns the value of field 'RGB'.
338 * @return the value of field 'RGB'.
340 public java.lang.String getRGB()
346 * Returns the value of field 'threshType'.
348 * @return the value of field 'ThreshType'.
350 public jalview.schemabinding.version2.types.ColourThreshTypeType getThreshType()
352 return this._threshType;
356 * Returns the value of field 'threshold'.
358 * @return the value of field 'Threshold'.
360 public float getThreshold()
362 return this._threshold;
366 * Method hasAutoScale.
368 * @return true if at least one AutoScale has been added
370 public boolean hasAutoScale()
372 return this._has_autoScale;
376 * Method hasColourByLabel.
378 * @return true if at least one ColourByLabel has been added
380 public boolean hasColourByLabel()
382 return this._has_colourByLabel;
388 * @return true if at least one Max has been added
390 public boolean hasMax()
392 return this._has_max;
398 * @return true if at least one Min has been added
400 public boolean hasMin()
402 return this._has_min;
406 * Method hasThreshold.
408 * @return true if at least one Threshold has been added
410 public boolean hasThreshold()
412 return this._has_threshold;
416 * Returns the value of field 'autoScale'.
418 * @return the value of field 'AutoScale'.
420 public boolean isAutoScale()
422 return this._autoScale;
426 * Returns the value of field 'colourByLabel'.
428 * @return the value of field 'ColourByLabel'.
430 public boolean isColourByLabel()
432 return this._colourByLabel;
438 * @return true if this object is valid according to the schema
440 public boolean isValid()
445 } catch (org.exolab.castor.xml.ValidationException vex)
456 * @throws org.exolab.castor.xml.MarshalException
457 * if object is null or if any SAXException is thrown during
459 * @throws org.exolab.castor.xml.ValidationException
460 * if this object is an invalid instance according to the schema
462 public void marshal(final java.io.Writer out)
463 throws org.exolab.castor.xml.MarshalException,
464 org.exolab.castor.xml.ValidationException
466 Marshaller.marshal(this, out);
473 * @throws java.io.IOException
474 * if an IOException occurs during marshaling
475 * @throws org.exolab.castor.xml.ValidationException
476 * if this object is an invalid instance according to the schema
477 * @throws org.exolab.castor.xml.MarshalException
478 * if object is null or if any SAXException is thrown during
481 public void marshal(final org.xml.sax.ContentHandler handler)
482 throws java.io.IOException,
483 org.exolab.castor.xml.MarshalException,
484 org.exolab.castor.xml.ValidationException
486 Marshaller.marshal(this, handler);
491 public void removeAllAttributeName()
493 this._attributeNameList.clear();
497 * Method removeAttributeName.
499 * @param vAttributeName
500 * @return true if the object was removed from the collection.
502 public boolean removeAttributeName(final java.lang.String vAttributeName)
504 boolean removed = _attributeNameList.remove(vAttributeName);
509 * Method removeAttributeNameAt.
512 * @return the element removed from the collection
514 public java.lang.String removeAttributeNameAt(final int index)
516 java.lang.Object obj = this._attributeNameList.remove(index);
517 return (java.lang.String) obj;
524 * @param vAttributeName
525 * @throws java.lang.IndexOutOfBoundsException
526 * if the index given is outside the bounds of the collection
528 public void setAttributeName(final int index,
529 final java.lang.String vAttributeName)
530 throws java.lang.IndexOutOfBoundsException
532 // check bounds for index
533 if (index < 0 || index >= this._attributeNameList.size())
535 throw new IndexOutOfBoundsException("setAttributeName: Index value '"
536 + index + "' not in range [0.."
537 + (this._attributeNameList.size() - 1) + "]");
540 this._attributeNameList.set(index, vAttributeName);
546 * @param vAttributeNameArray
548 public void setAttributeName(final java.lang.String[] vAttributeNameArray)
551 _attributeNameList.clear();
553 for (int i = 0; i < vAttributeNameArray.length; i++)
555 this._attributeNameList.add(vAttributeNameArray[i]);
560 * Sets the value of field 'autoScale'.
563 * the value of field 'autoScale'.
565 public void setAutoScale(final boolean autoScale)
567 this._autoScale = autoScale;
568 this._has_autoScale = true;
572 * Sets the value of field 'colourByLabel'.
574 * @param colourByLabel
575 * the value of field 'colourByLabel'.
577 public void setColourByLabel(final boolean colourByLabel)
579 this._colourByLabel = colourByLabel;
580 this._has_colourByLabel = true;
584 * Sets the value of field 'max'.
587 * the value of field 'max'.
589 public void setMax(final float max)
592 this._has_max = true;
596 * Sets the value of field 'min'.
599 * the value of field 'min'.
601 public void setMin(final float min)
604 this._has_min = true;
608 * Sets the value of field 'minRGB'.
611 * the value of field 'minRGB'.
613 public void setMinRGB(final java.lang.String minRGB)
615 this._minRGB = minRGB;
619 * Sets the value of field 'name'. The field 'name' has the following
620 * description: Single letter residue code for an alignment colour scheme, or
621 * feature type for a feature colour scheme
624 * the value of field 'name'.
626 public void setName(final java.lang.String name)
632 * Sets the value of field 'noValueColour'. The field 'noValueColour' has the
633 * following description: Colour if no attribute or score value
635 * @param noValueColour
636 * the value of field 'noValueColour'.
638 public void setNoValueColour(
639 final jalview.schemabinding.version2.types.ColourNoValueColourType noValueColour)
641 this._noValueColour = noValueColour;
645 * Sets the value of field 'RGB'.
648 * the value of field 'RGB'.
650 public void setRGB(final java.lang.String RGB)
656 * Sets the value of field 'threshType'.
659 * the value of field 'threshType'.
661 public void setThreshType(
662 final jalview.schemabinding.version2.types.ColourThreshTypeType threshType)
664 this._threshType = threshType;
668 * Sets the value of field 'threshold'.
671 * the value of field 'threshold'.
673 public void setThreshold(final float threshold)
675 this._threshold = threshold;
676 this._has_threshold = true;
683 * @throws org.exolab.castor.xml.MarshalException
684 * if object is null or if any SAXException is thrown during
686 * @throws org.exolab.castor.xml.ValidationException
687 * if this object is an invalid instance according to the schema
688 * @return the unmarshaled jalview.schemabinding.version2.Colour
690 public static jalview.schemabinding.version2.Colour unmarshal(
691 final java.io.Reader reader)
692 throws org.exolab.castor.xml.MarshalException,
693 org.exolab.castor.xml.ValidationException
695 return (jalview.schemabinding.version2.Colour) Unmarshaller
696 .unmarshal(jalview.schemabinding.version2.Colour.class, reader);
702 * @throws org.exolab.castor.xml.ValidationException
703 * if this object is an invalid instance according to the schema
705 public void validate() throws org.exolab.castor.xml.ValidationException
707 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
708 validator.validate(this);