2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8)
3 * Copyright (C) 2012 J Procter, AM Waterhouse, LM Lui, J Engelhardt, G Barton, M Clamp, S Searle
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/>.
18 package jalview.schemabinding.version2;
20 //---------------------------------/
21 //- Imported classes and packages -/
22 //---------------------------------/
24 import org.exolab.castor.xml.Marshaller;
25 import org.exolab.castor.xml.Unmarshaller;
30 * @version $Revision$ $Date$
32 public class Colour implements java.io.Serializable
35 // --------------------------/
36 // - Class/Member Variables -/
37 // --------------------------/
42 private java.lang.String _name;
47 private java.lang.String _RGB;
52 private java.lang.String _minRGB;
55 * loosely specified enumeration: NONE,ABOVE, or BELOW
57 private java.lang.String _threshType;
62 private float _threshold;
65 * keeps track of state for field: _threshold
67 private boolean _has_threshold;
75 * keeps track of state for field: _max
77 private boolean _has_max;
85 * keeps track of state for field: _min
87 private boolean _has_min;
90 * Field _colourByLabel.
92 private boolean _colourByLabel;
95 * keeps track of state for field: _colourByLabel
97 private boolean _has_colourByLabel;
102 private boolean _autoScale;
105 * keeps track of state for field: _autoScale
107 private boolean _has_autoScale;
124 public void deleteAutoScale()
126 this._has_autoScale = false;
131 public void deleteColourByLabel()
133 this._has_colourByLabel = false;
138 public void deleteMax()
140 this._has_max = false;
145 public void deleteMin()
147 this._has_min = false;
152 public void deleteThreshold()
154 this._has_threshold = false;
158 * Returns the value of field 'autoScale'.
160 * @return the value of field 'AutoScale'.
162 public boolean getAutoScale()
164 return this._autoScale;
168 * Returns the value of field 'colourByLabel'.
170 * @return the value of field 'ColourByLabel'.
172 public boolean getColourByLabel()
174 return this._colourByLabel;
178 * Returns the value of field 'max'.
180 * @return the value of field 'Max'.
182 public float getMax()
188 * Returns the value of field 'min'.
190 * @return the value of field 'Min'.
192 public float getMin()
198 * Returns the value of field 'minRGB'.
200 * @return the value of field 'MinRGB'.
202 public java.lang.String getMinRGB()
208 * Returns the value of field 'name'.
210 * @return the value of field 'Name'.
212 public java.lang.String getName()
218 * Returns the value of field 'RGB'.
220 * @return the value of field 'RGB'.
222 public java.lang.String getRGB()
228 * Returns the value of field 'threshType'. The field 'threshType' has the
229 * following description: loosely specified enumeration: NONE,ABOVE, or BELOW
231 * @return the value of field 'ThreshType'.
233 public java.lang.String getThreshType()
235 return this._threshType;
239 * Returns the value of field 'threshold'.
241 * @return the value of field 'Threshold'.
243 public float getThreshold()
245 return this._threshold;
249 * Method hasAutoScale.
251 * @return true if at least one AutoScale has been added
253 public boolean hasAutoScale()
255 return this._has_autoScale;
259 * Method hasColourByLabel.
261 * @return true if at least one ColourByLabel has been added
263 public boolean hasColourByLabel()
265 return this._has_colourByLabel;
271 * @return true if at least one Max has been added
273 public boolean hasMax()
275 return this._has_max;
281 * @return true if at least one Min has been added
283 public boolean hasMin()
285 return this._has_min;
289 * Method hasThreshold.
291 * @return true if at least one Threshold has been added
293 public boolean hasThreshold()
295 return this._has_threshold;
299 * Returns the value of field 'autoScale'.
301 * @return the value of field 'AutoScale'.
303 public boolean isAutoScale()
305 return this._autoScale;
309 * Returns the value of field 'colourByLabel'.
311 * @return the value of field 'ColourByLabel'.
313 public boolean isColourByLabel()
315 return this._colourByLabel;
321 * @return true if this object is valid according to the schema
323 public boolean isValid()
328 } catch (org.exolab.castor.xml.ValidationException vex)
339 * @throws org.exolab.castor.xml.MarshalException
340 * if object is null or if any SAXException is thrown during
342 * @throws org.exolab.castor.xml.ValidationException
343 * if this object is an invalid instance according to the schema
345 public void marshal(final java.io.Writer out)
346 throws org.exolab.castor.xml.MarshalException,
347 org.exolab.castor.xml.ValidationException
349 Marshaller.marshal(this, out);
356 * @throws java.io.IOException
357 * if an IOException occurs during marshaling
358 * @throws org.exolab.castor.xml.ValidationException
359 * if this object is an invalid instance according to the schema
360 * @throws org.exolab.castor.xml.MarshalException
361 * if object is null or if any SAXException is thrown during
364 public void marshal(final org.xml.sax.ContentHandler handler)
365 throws java.io.IOException,
366 org.exolab.castor.xml.MarshalException,
367 org.exolab.castor.xml.ValidationException
369 Marshaller.marshal(this, handler);
373 * Sets the value of field 'autoScale'.
376 * the value of field 'autoScale'.
378 public void setAutoScale(final boolean autoScale)
380 this._autoScale = autoScale;
381 this._has_autoScale = true;
385 * Sets the value of field 'colourByLabel'.
387 * @param colourByLabel
388 * the value of field 'colourByLabel'.
390 public void setColourByLabel(final boolean colourByLabel)
392 this._colourByLabel = colourByLabel;
393 this._has_colourByLabel = true;
397 * Sets the value of field 'max'.
400 * the value of field 'max'.
402 public void setMax(final float max)
405 this._has_max = true;
409 * Sets the value of field 'min'.
412 * the value of field 'min'.
414 public void setMin(final float min)
417 this._has_min = true;
421 * Sets the value of field 'minRGB'.
424 * the value of field 'minRGB'.
426 public void setMinRGB(final java.lang.String minRGB)
428 this._minRGB = minRGB;
432 * Sets the value of field 'name'.
435 * the value of field 'name'.
437 public void setName(final java.lang.String name)
443 * Sets the value of field 'RGB'.
446 * the value of field 'RGB'.
448 public void setRGB(final java.lang.String RGB)
454 * Sets the value of field 'threshType'. The field 'threshType' has the
455 * following description: loosely specified enumeration: NONE,ABOVE, or BELOW
458 * the value of field 'threshType'.
460 public void setThreshType(final java.lang.String threshType)
462 this._threshType = threshType;
466 * Sets the value of field 'threshold'.
469 * the value of field 'threshold'.
471 public void setThreshold(final float threshold)
473 this._threshold = threshold;
474 this._has_threshold = true;
481 * @throws org.exolab.castor.xml.MarshalException
482 * if object is null or if any SAXException is thrown during
484 * @throws org.exolab.castor.xml.ValidationException
485 * if this object is an invalid instance according to the schema
486 * @return the unmarshaled jalview.schemabinding.version2.Colour
488 public static jalview.schemabinding.version2.Colour unmarshal(
489 final java.io.Reader reader)
490 throws org.exolab.castor.xml.MarshalException,
491 org.exolab.castor.xml.ValidationException
493 return (jalview.schemabinding.version2.Colour) Unmarshaller.unmarshal(
494 jalview.schemabinding.version2.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);