2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.0b1)
3 * Copyright (C) 2014 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 of the License, or (at your option) any later version.
11 * Jalview is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty
13 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 * PURPOSE. See the GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License along with Jalview. If not, see <http://www.gnu.org/licenses/>.
17 * The Jalview Authors are detailed in the 'AUTHORS' file.
19 package jalview.binding;
21 //---------------------------------/
22 //- Imported classes and packages -/
23 //---------------------------------/
25 import org.exolab.castor.xml.Marshaller;
26 import org.exolab.castor.xml.Unmarshaller;
31 * @version $Revision$ $Date$
33 public class Colour implements java.io.Serializable
36 // --------------------------/
37 // - Class/Member Variables -/
38 // --------------------------/
43 private java.lang.String _name;
48 private java.lang.String _RGB;
53 private java.lang.String _minRGB;
56 * loosely specified enumeration: NONE,ABOVE, or BELOW
58 private java.lang.String _threshType;
63 private float _threshold;
66 * keeps track of state for field: _threshold
68 private boolean _has_threshold;
76 * keeps track of state for field: _max
78 private boolean _has_max;
86 * keeps track of state for field: _min
88 private boolean _has_min;
91 * Field _colourByLabel.
93 private boolean _colourByLabel;
96 * keeps track of state for field: _colourByLabel
98 private boolean _has_colourByLabel;
103 private boolean _autoScale;
106 * keeps track of state for field: _autoScale
108 private boolean _has_autoScale;
125 public void deleteAutoScale()
127 this._has_autoScale = false;
132 public void deleteColourByLabel()
134 this._has_colourByLabel = false;
139 public void deleteMax()
141 this._has_max = false;
146 public void deleteMin()
148 this._has_min = false;
153 public void deleteThreshold()
155 this._has_threshold = false;
159 * Returns the value of field 'autoScale'.
161 * @return the value of field 'AutoScale'.
163 public boolean getAutoScale()
165 return this._autoScale;
169 * Returns the value of field 'colourByLabel'.
171 * @return the value of field 'ColourByLabel'.
173 public boolean getColourByLabel()
175 return this._colourByLabel;
179 * Returns the value of field 'max'.
181 * @return the value of field 'Max'.
183 public float getMax()
189 * Returns the value of field 'min'.
191 * @return the value of field 'Min'.
193 public float getMin()
199 * Returns the value of field 'minRGB'.
201 * @return the value of field 'MinRGB'.
203 public java.lang.String getMinRGB()
209 * Returns the value of field 'name'.
211 * @return the value of field 'Name'.
213 public java.lang.String getName()
219 * Returns the value of field 'RGB'.
221 * @return the value of field 'RGB'.
223 public java.lang.String getRGB()
229 * Returns the value of field 'threshType'. The field 'threshType' has the
230 * following description: loosely specified enumeration: NONE,ABOVE, or BELOW
232 * @return the value of field 'ThreshType'.
234 public java.lang.String getThreshType()
236 return this._threshType;
240 * Returns the value of field 'threshold'.
242 * @return the value of field 'Threshold'.
244 public float getThreshold()
246 return this._threshold;
250 * Method hasAutoScale.
252 * @return true if at least one AutoScale has been added
254 public boolean hasAutoScale()
256 return this._has_autoScale;
260 * Method hasColourByLabel.
262 * @return true if at least one ColourByLabel has been added
264 public boolean hasColourByLabel()
266 return this._has_colourByLabel;
272 * @return true if at least one Max has been added
274 public boolean hasMax()
276 return this._has_max;
282 * @return true if at least one Min has been added
284 public boolean hasMin()
286 return this._has_min;
290 * Method hasThreshold.
292 * @return true if at least one Threshold has been added
294 public boolean hasThreshold()
296 return this._has_threshold;
300 * Returns the value of field 'autoScale'.
302 * @return the value of field 'AutoScale'.
304 public boolean isAutoScale()
306 return this._autoScale;
310 * Returns the value of field 'colourByLabel'.
312 * @return the value of field 'ColourByLabel'.
314 public boolean isColourByLabel()
316 return this._colourByLabel;
322 * @return true if this object is valid according to the schema
324 public boolean isValid()
329 } catch (org.exolab.castor.xml.ValidationException vex)
340 * @throws org.exolab.castor.xml.MarshalException
341 * if object is null or if any SAXException is thrown during
343 * @throws org.exolab.castor.xml.ValidationException
344 * if this object is an invalid instance according to the schema
346 public void marshal(final java.io.Writer out)
347 throws org.exolab.castor.xml.MarshalException,
348 org.exolab.castor.xml.ValidationException
350 Marshaller.marshal(this, out);
357 * @throws java.io.IOException
358 * if an IOException occurs during marshaling
359 * @throws org.exolab.castor.xml.ValidationException
360 * if this object is an invalid instance according to the schema
361 * @throws org.exolab.castor.xml.MarshalException
362 * if object is null or if any SAXException is thrown during
365 public void marshal(final org.xml.sax.ContentHandler handler)
366 throws java.io.IOException,
367 org.exolab.castor.xml.MarshalException,
368 org.exolab.castor.xml.ValidationException
370 Marshaller.marshal(this, handler);
374 * Sets the value of field 'autoScale'.
377 * the value of field 'autoScale'.
379 public void setAutoScale(final boolean autoScale)
381 this._autoScale = autoScale;
382 this._has_autoScale = true;
386 * Sets the value of field 'colourByLabel'.
388 * @param colourByLabel
389 * the value of field 'colourByLabel'.
391 public void setColourByLabel(final boolean colourByLabel)
393 this._colourByLabel = colourByLabel;
394 this._has_colourByLabel = true;
398 * Sets the value of field 'max'.
401 * the value of field 'max'.
403 public void setMax(final float max)
406 this._has_max = true;
410 * Sets the value of field 'min'.
413 * the value of field 'min'.
415 public void setMin(final float min)
418 this._has_min = true;
422 * Sets the value of field 'minRGB'.
425 * the value of field 'minRGB'.
427 public void setMinRGB(final java.lang.String minRGB)
429 this._minRGB = minRGB;
433 * Sets the value of field 'name'.
436 * the value of field 'name'.
438 public void setName(final java.lang.String name)
444 * Sets the value of field 'RGB'.
447 * the value of field 'RGB'.
449 public void setRGB(final java.lang.String RGB)
455 * Sets the value of field 'threshType'. The field 'threshType' has the
456 * following description: loosely specified enumeration: NONE,ABOVE, or BELOW
459 * the value of field 'threshType'.
461 public void setThreshType(final java.lang.String threshType)
463 this._threshType = threshType;
467 * Sets the value of field 'threshold'.
470 * the value of field 'threshold'.
472 public void setThreshold(final float threshold)
474 this._threshold = threshold;
475 this._has_threshold = true;
482 * @throws org.exolab.castor.xml.MarshalException
483 * if object is null or if any SAXException is thrown during
485 * @throws org.exolab.castor.xml.ValidationException
486 * if this object is an invalid instance according to the schema
487 * @return the unmarshaled jalview.binding.Colour
489 public static jalview.binding.Colour unmarshal(final java.io.Reader reader)
490 throws org.exolab.castor.xml.MarshalException,
491 org.exolab.castor.xml.ValidationException
493 return (jalview.binding.Colour) Unmarshaller.unmarshal(
494 jalview.binding.Colour.class, reader);
500 * @throws org.exolab.castor.xml.ValidationException
501 * if this object is an invalid instance according to the schema
503 public void validate() throws org.exolab.castor.xml.ValidationException
505 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
506 validator.validate(this);