2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.4.1)
\r
3 * Copyright (C) 2009 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
\r
5 * This program is free software; you can redistribute it and/or
\r
6 * modify it under the terms of the GNU General Public License
\r
7 * as published by the Free Software Foundation; either version 2
\r
8 * of the License, or (at your option) any later version.
\r
10 * This program is distributed in the hope that it will be useful,
\r
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
13 * GNU General Public License for more details.
\r
15 * You should have received a copy of the GNU General Public License
\r
16 * along with this program; if not, write to the Free Software
\r
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
\r
19 package jalview.schemabinding.version2;
\r
21 //---------------------------------/
\r
22 //- Imported classes and packages -/
\r
23 //---------------------------------/
\r
25 import org.exolab.castor.xml.Marshaller;
\r
26 import org.exolab.castor.xml.Unmarshaller;
\r
31 * @version $Revision$ $Date$
\r
33 public class Colour implements java.io.Serializable {
\r
36 //--------------------------/
\r
37 //- Class/Member Variables -/
\r
38 //--------------------------/
\r
43 private java.lang.String _name;
\r
48 private java.lang.String _RGB;
\r
53 private java.lang.String _minRGB;
\r
56 * loosely specified enumeration: NONE,ABOVE, or BELOW
\r
58 private java.lang.String _threshType;
\r
63 private float _threshold;
\r
66 * keeps track of state for field: _threshold
\r
68 private boolean _has_threshold;
\r
76 * keeps track of state for field: _max
\r
78 private boolean _has_max;
\r
86 * keeps track of state for field: _min
\r
88 private boolean _has_min;
\r
91 * Field _colourByLabel.
\r
93 private boolean _colourByLabel;
\r
96 * keeps track of state for field: _colourByLabel
\r
98 private boolean _has_colourByLabel;
\r
101 * Field _autoScale.
\r
103 private boolean _autoScale;
\r
106 * keeps track of state for field: _autoScale
\r
108 private boolean _has_autoScale;
\r
111 //----------------/
\r
112 //- Constructors -/
\r
113 //----------------/
\r
126 public void deleteAutoScale(
\r
128 this._has_autoScale= false;
\r
133 public void deleteColourByLabel(
\r
135 this._has_colourByLabel= false;
\r
140 public void deleteMax(
\r
142 this._has_max= false;
\r
147 public void deleteMin(
\r
149 this._has_min= false;
\r
154 public void deleteThreshold(
\r
156 this._has_threshold= false;
\r
160 * Returns the value of field 'autoScale'.
\r
162 * @return the value of field 'AutoScale'.
\r
164 public boolean getAutoScale(
\r
166 return this._autoScale;
\r
170 * Returns the value of field 'colourByLabel'.
\r
172 * @return the value of field 'ColourByLabel'.
\r
174 public boolean getColourByLabel(
\r
176 return this._colourByLabel;
\r
180 * Returns the value of field 'max'.
\r
182 * @return the value of field 'Max'.
\r
184 public float getMax(
\r
190 * Returns the value of field 'min'.
\r
192 * @return the value of field 'Min'.
\r
194 public float getMin(
\r
200 * Returns the value of field 'minRGB'.
\r
202 * @return the value of field 'MinRGB'.
\r
204 public java.lang.String getMinRGB(
\r
206 return this._minRGB;
\r
210 * Returns the value of field 'name'.
\r
212 * @return the value of field 'Name'.
\r
214 public java.lang.String getName(
\r
220 * Returns the value of field 'RGB'.
\r
222 * @return the value of field 'RGB'.
\r
224 public java.lang.String getRGB(
\r
230 * Returns the value of field 'threshType'. The field
\r
231 * 'threshType' has the following description: loosely
\r
232 * specified enumeration: NONE,ABOVE, or BELOW
\r
234 * @return the value of field 'ThreshType'.
\r
236 public java.lang.String getThreshType(
\r
238 return this._threshType;
\r
242 * Returns the value of field 'threshold'.
\r
244 * @return the value of field 'Threshold'.
\r
246 public float getThreshold(
\r
248 return this._threshold;
\r
252 * Method hasAutoScale.
\r
254 * @return true if at least one AutoScale has been added
\r
256 public boolean hasAutoScale(
\r
258 return this._has_autoScale;
\r
262 * Method hasColourByLabel.
\r
264 * @return true if at least one ColourByLabel has been added
\r
266 public boolean hasColourByLabel(
\r
268 return this._has_colourByLabel;
\r
274 * @return true if at least one Max has been added
\r
276 public boolean hasMax(
\r
278 return this._has_max;
\r
284 * @return true if at least one Min has been added
\r
286 public boolean hasMin(
\r
288 return this._has_min;
\r
292 * Method hasThreshold.
\r
294 * @return true if at least one Threshold has been added
\r
296 public boolean hasThreshold(
\r
298 return this._has_threshold;
\r
302 * Returns the value of field 'autoScale'.
\r
304 * @return the value of field 'AutoScale'.
\r
306 public boolean isAutoScale(
\r
308 return this._autoScale;
\r
312 * Returns the value of field 'colourByLabel'.
\r
314 * @return the value of field 'ColourByLabel'.
\r
316 public boolean isColourByLabel(
\r
318 return this._colourByLabel;
\r
324 * @return true if this object is valid according to the schema
\r
326 public boolean isValid(
\r
330 } catch (org.exolab.castor.xml.ValidationException vex) {
\r
340 * @throws org.exolab.castor.xml.MarshalException if object is
\r
341 * null or if any SAXException is thrown during marshaling
\r
342 * @throws org.exolab.castor.xml.ValidationException if this
\r
343 * object is an invalid instance according to the schema
\r
345 public void marshal(
\r
346 final java.io.Writer out)
\r
347 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
348 Marshaller.marshal(this, out);
\r
355 * @throws java.io.IOException if an IOException occurs during
\r
357 * @throws org.exolab.castor.xml.ValidationException if this
\r
358 * object is an invalid instance according to the schema
\r
359 * @throws org.exolab.castor.xml.MarshalException if object is
\r
360 * null or if any SAXException is thrown during marshaling
\r
362 public void marshal(
\r
363 final org.xml.sax.ContentHandler handler)
\r
364 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
365 Marshaller.marshal(this, handler);
\r
369 * Sets the value of field 'autoScale'.
\r
371 * @param autoScale the value of field 'autoScale'.
\r
373 public void setAutoScale(
\r
374 final boolean autoScale) {
\r
375 this._autoScale = autoScale;
\r
376 this._has_autoScale = true;
\r
380 * Sets the value of field 'colourByLabel'.
\r
382 * @param colourByLabel the value of field 'colourByLabel'.
\r
384 public void setColourByLabel(
\r
385 final boolean colourByLabel) {
\r
386 this._colourByLabel = colourByLabel;
\r
387 this._has_colourByLabel = true;
\r
391 * Sets the value of field 'max'.
\r
393 * @param max the value of field 'max'.
\r
395 public void setMax(
\r
398 this._has_max = true;
\r
402 * Sets the value of field 'min'.
\r
404 * @param min the value of field 'min'.
\r
406 public void setMin(
\r
409 this._has_min = true;
\r
413 * Sets the value of field 'minRGB'.
\r
415 * @param minRGB the value of field 'minRGB'.
\r
417 public void setMinRGB(
\r
418 final java.lang.String minRGB) {
\r
419 this._minRGB = minRGB;
\r
423 * Sets the value of field 'name'.
\r
425 * @param name the value of field 'name'.
\r
427 public void setName(
\r
428 final java.lang.String name) {
\r
433 * Sets the value of field 'RGB'.
\r
435 * @param RGB the value of field 'RGB'.
\r
437 public void setRGB(
\r
438 final java.lang.String RGB) {
\r
443 * Sets the value of field 'threshType'. The field 'threshType'
\r
444 * has the following description: loosely specified
\r
445 * enumeration: NONE,ABOVE, or BELOW
\r
447 * @param threshType the value of field 'threshType'.
\r
449 public void setThreshType(
\r
450 final java.lang.String threshType) {
\r
451 this._threshType = threshType;
\r
455 * Sets the value of field 'threshold'.
\r
457 * @param threshold the value of field 'threshold'.
\r
459 public void setThreshold(
\r
460 final float threshold) {
\r
461 this._threshold = threshold;
\r
462 this._has_threshold = true;
\r
466 * Method unmarshal.
\r
469 * @throws org.exolab.castor.xml.MarshalException if object is
\r
470 * null or if any SAXException is thrown during marshaling
\r
471 * @throws org.exolab.castor.xml.ValidationException if this
\r
472 * object is an invalid instance according to the schema
\r
473 * @return the unmarshaled jalview.schemabinding.version2.Colour
\r
475 public static jalview.schemabinding.version2.Colour unmarshal(
\r
476 final java.io.Reader reader)
\r
477 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
478 return (jalview.schemabinding.version2.Colour) Unmarshaller.unmarshal(jalview.schemabinding.version2.Colour.class, reader);
\r
484 * @throws org.exolab.castor.xml.ValidationException if this
\r
485 * object is an invalid instance according to the schema
\r
487 public void validate(
\r
489 throws org.exolab.castor.xml.ValidationException {
\r
490 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
\r
491 validator.validate(this);
\r