2 * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3 * Copyright (C) $$Year-Rel$$ The Jalview Authors
5 * This file is part of Jalview.
7 * Jalview is free software: you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation, either version 3
10 * of the License, or (at your option) any later version.
12 * Jalview is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty
14 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
19 * The Jalview Authors are detailed in the 'AUTHORS' file.
21 package jalview.schemabinding.version2;
23 //---------------------------------/
24 //- Imported classes and packages -/
25 //---------------------------------/
27 import org.exolab.castor.xml.Marshaller;
28 import org.exolab.castor.xml.Unmarshaller;
33 * @version $Revision$ $Date$
35 public class Colour implements java.io.Serializable
38 // --------------------------/
39 // - Class/Member Variables -/
40 // --------------------------/
45 private java.lang.String _name;
50 private java.lang.String _RGB;
55 private java.lang.String _minRGB;
58 * loosely specified enumeration: NONE,ABOVE, or BELOW
60 private java.lang.String _threshType;
65 private float _threshold;
68 * keeps track of state for field: _threshold
70 private boolean _has_threshold;
78 * keeps track of state for field: _max
80 private boolean _has_max;
88 * keeps track of state for field: _min
90 private boolean _has_min;
93 * Field _colourByLabel.
95 private boolean _colourByLabel;
98 * keeps track of state for field: _colourByLabel
100 private boolean _has_colourByLabel;
105 private boolean _autoScale;
108 * keeps track of state for field: _autoScale
110 private boolean _has_autoScale;
127 public void deleteAutoScale()
129 this._has_autoScale = false;
134 public void deleteColourByLabel()
136 this._has_colourByLabel = false;
141 public void deleteMax()
143 this._has_max = false;
148 public void deleteMin()
150 this._has_min = false;
155 public void deleteThreshold()
157 this._has_threshold = false;
161 * Returns the value of field 'autoScale'.
163 * @return the value of field 'AutoScale'.
165 public boolean getAutoScale()
167 return this._autoScale;
171 * Returns the value of field 'colourByLabel'.
173 * @return the value of field 'ColourByLabel'.
175 public boolean getColourByLabel()
177 return this._colourByLabel;
181 * Returns the value of field 'max'.
183 * @return the value of field 'Max'.
185 public float getMax()
191 * Returns the value of field 'min'.
193 * @return the value of field 'Min'.
195 public float getMin()
201 * Returns the value of field 'minRGB'.
203 * @return the value of field 'MinRGB'.
205 public java.lang.String getMinRGB()
211 * Returns the value of field 'name'.
213 * @return the value of field 'Name'.
215 public java.lang.String getName()
221 * Returns the value of field 'RGB'.
223 * @return the value of field 'RGB'.
225 public java.lang.String getRGB()
231 * Returns the value of field 'threshType'. The field 'threshType' has the
232 * following description: loosely specified enumeration: NONE,ABOVE, or BELOW
234 * @return the value of field 'ThreshType'.
236 public java.lang.String getThreshType()
238 return this._threshType;
242 * Returns the value of field 'threshold'.
244 * @return the value of field 'Threshold'.
246 public float getThreshold()
248 return this._threshold;
252 * Method hasAutoScale.
254 * @return true if at least one AutoScale has been added
256 public boolean hasAutoScale()
258 return this._has_autoScale;
262 * Method hasColourByLabel.
264 * @return true if at least one ColourByLabel has been added
266 public boolean hasColourByLabel()
268 return this._has_colourByLabel;
274 * @return true if at least one Max has been added
276 public boolean hasMax()
278 return this._has_max;
284 * @return true if at least one Min has been added
286 public boolean hasMin()
288 return this._has_min;
292 * Method hasThreshold.
294 * @return true if at least one Threshold has been added
296 public boolean hasThreshold()
298 return this._has_threshold;
302 * Returns the value of field 'autoScale'.
304 * @return the value of field 'AutoScale'.
306 public boolean isAutoScale()
308 return this._autoScale;
312 * Returns the value of field 'colourByLabel'.
314 * @return the value of field 'ColourByLabel'.
316 public boolean isColourByLabel()
318 return this._colourByLabel;
324 * @return true if this object is valid according to the schema
326 public boolean isValid()
331 } catch (org.exolab.castor.xml.ValidationException vex)
342 * @throws org.exolab.castor.xml.MarshalException
343 * if object is null or if any SAXException is thrown during
345 * @throws org.exolab.castor.xml.ValidationException
346 * if this object is an invalid instance according to the schema
348 public void marshal(final java.io.Writer out)
349 throws org.exolab.castor.xml.MarshalException,
350 org.exolab.castor.xml.ValidationException
352 Marshaller.marshal(this, out);
359 * @throws java.io.IOException
360 * if an IOException occurs during marshaling
361 * @throws org.exolab.castor.xml.ValidationException
362 * if this object is an invalid instance according to the schema
363 * @throws org.exolab.castor.xml.MarshalException
364 * if object is null or if any SAXException is thrown during
367 public void marshal(final org.xml.sax.ContentHandler handler)
368 throws java.io.IOException,
369 org.exolab.castor.xml.MarshalException,
370 org.exolab.castor.xml.ValidationException
372 Marshaller.marshal(this, handler);
376 * Sets the value of field 'autoScale'.
379 * the value of field 'autoScale'.
381 public void setAutoScale(final boolean autoScale)
383 this._autoScale = autoScale;
384 this._has_autoScale = true;
388 * Sets the value of field 'colourByLabel'.
390 * @param colourByLabel
391 * the value of field 'colourByLabel'.
393 public void setColourByLabel(final boolean colourByLabel)
395 this._colourByLabel = colourByLabel;
396 this._has_colourByLabel = true;
400 * Sets the value of field 'max'.
403 * the value of field 'max'.
405 public void setMax(final float max)
408 this._has_max = true;
412 * Sets the value of field 'min'.
415 * the value of field 'min'.
417 public void setMin(final float min)
420 this._has_min = true;
424 * Sets the value of field 'minRGB'.
427 * the value of field 'minRGB'.
429 public void setMinRGB(final java.lang.String minRGB)
431 this._minRGB = minRGB;
435 * Sets the value of field 'name'.
438 * the value of field 'name'.
440 public void setName(final java.lang.String name)
446 * Sets the value of field 'RGB'.
449 * the value of field 'RGB'.
451 public void setRGB(final java.lang.String RGB)
457 * Sets the value of field 'threshType'. The field 'threshType' has the
458 * following description: loosely specified enumeration: NONE,ABOVE, or BELOW
461 * the value of field 'threshType'.
463 public void setThreshType(final java.lang.String threshType)
465 this._threshType = threshType;
469 * Sets the value of field 'threshold'.
472 * the value of field 'threshold'.
474 public void setThreshold(final float threshold)
476 this._threshold = threshold;
477 this._has_threshold = true;
484 * @throws org.exolab.castor.xml.MarshalException
485 * if object is null or if any SAXException is thrown during
487 * @throws org.exolab.castor.xml.ValidationException
488 * if this object is an invalid instance according to the schema
489 * @return the unmarshaled jalview.schemabinding.version2.Colour
491 public static jalview.schemabinding.version2.Colour unmarshal(
492 final java.io.Reader reader)
493 throws org.exolab.castor.xml.MarshalException,
494 org.exolab.castor.xml.ValidationException
496 return (jalview.schemabinding.version2.Colour) Unmarshaller.unmarshal(
497 jalview.schemabinding.version2.Colour.class, reader);
503 * @throws org.exolab.castor.xml.ValidationException
504 * if this object is an invalid instance according to the schema
506 public void validate() throws org.exolab.castor.xml.ValidationException
508 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
509 validator.validate(this);