2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.4.1)
3 * Copyright (C) 2009 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
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;
126 public void deleteAutoScale(
128 this._has_autoScale= false;
133 public void deleteColourByLabel(
135 this._has_colourByLabel= false;
140 public void deleteMax(
142 this._has_max= false;
147 public void deleteMin(
149 this._has_min= false;
154 public void deleteThreshold(
156 this._has_threshold= false;
160 * Returns the value of field 'autoScale'.
162 * @return the value of field 'AutoScale'.
164 public boolean getAutoScale(
166 return this._autoScale;
170 * Returns the value of field 'colourByLabel'.
172 * @return the value of field 'ColourByLabel'.
174 public boolean getColourByLabel(
176 return this._colourByLabel;
180 * Returns the value of field 'max'.
182 * @return the value of field 'Max'.
190 * Returns the value of field 'min'.
192 * @return the value of field 'Min'.
200 * Returns the value of field 'minRGB'.
202 * @return the value of field 'MinRGB'.
204 public java.lang.String getMinRGB(
210 * Returns the value of field 'name'.
212 * @return the value of field 'Name'.
214 public java.lang.String getName(
220 * Returns the value of field 'RGB'.
222 * @return the value of field 'RGB'.
224 public java.lang.String getRGB(
230 * Returns the value of field 'threshType'. The field
231 * 'threshType' has the following description: loosely
232 * 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(
330 } catch (org.exolab.castor.xml.ValidationException vex) {
340 * @throws org.exolab.castor.xml.MarshalException if object is
341 * null or if any SAXException is thrown during marshaling
342 * @throws org.exolab.castor.xml.ValidationException if this
343 * object is an invalid instance according to the schema
346 final java.io.Writer out)
347 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
348 Marshaller.marshal(this, out);
355 * @throws java.io.IOException if an IOException occurs during
357 * @throws org.exolab.castor.xml.ValidationException if this
358 * object is an invalid instance according to the schema
359 * @throws org.exolab.castor.xml.MarshalException if object is
360 * null or if any SAXException is thrown during marshaling
363 final org.xml.sax.ContentHandler handler)
364 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
365 Marshaller.marshal(this, handler);
369 * Sets the value of field 'autoScale'.
371 * @param autoScale the value of field 'autoScale'.
373 public void setAutoScale(
374 final boolean autoScale) {
375 this._autoScale = autoScale;
376 this._has_autoScale = true;
380 * Sets the value of field 'colourByLabel'.
382 * @param colourByLabel the value of field 'colourByLabel'.
384 public void setColourByLabel(
385 final boolean colourByLabel) {
386 this._colourByLabel = colourByLabel;
387 this._has_colourByLabel = true;
391 * Sets the value of field 'max'.
393 * @param max the value of field 'max'.
398 this._has_max = true;
402 * Sets the value of field 'min'.
404 * @param min the value of field 'min'.
409 this._has_min = true;
413 * Sets the value of field 'minRGB'.
415 * @param minRGB the value of field 'minRGB'.
417 public void setMinRGB(
418 final java.lang.String minRGB) {
419 this._minRGB = minRGB;
423 * Sets the value of field 'name'.
425 * @param name the value of field 'name'.
428 final java.lang.String name) {
433 * Sets the value of field 'RGB'.
435 * @param RGB the value of field 'RGB'.
438 final java.lang.String RGB) {
443 * Sets the value of field 'threshType'. The field 'threshType'
444 * has the following description: loosely specified
445 * enumeration: NONE,ABOVE, or BELOW
447 * @param threshType the value of field 'threshType'.
449 public void setThreshType(
450 final java.lang.String threshType) {
451 this._threshType = threshType;
455 * Sets the value of field 'threshold'.
457 * @param threshold the value of field 'threshold'.
459 public void setThreshold(
460 final float threshold) {
461 this._threshold = threshold;
462 this._has_threshold = true;
469 * @throws org.exolab.castor.xml.MarshalException if object is
470 * null or if any SAXException is thrown during marshaling
471 * @throws org.exolab.castor.xml.ValidationException if this
472 * object is an invalid instance according to the schema
473 * @return the unmarshaled jalview.binding.Colour
475 public static jalview.binding.Colour unmarshal(
476 final java.io.Reader reader)
477 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
478 return (jalview.binding.Colour) Unmarshaller.unmarshal(jalview.binding.Colour.class, reader);
484 * @throws org.exolab.castor.xml.ValidationException if this
485 * object is an invalid instance according to the schema
487 public void validate(
489 throws org.exolab.castor.xml.ValidationException {
490 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
491 validator.validate(this);