2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.6)
\r
3 * Copyright (C) 2010 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
\r
5 * This file is part of Jalview.
\r
7 * Jalview is free software: you can redistribute it and/or
\r
8 * modify it under the terms of the GNU General Public License
\r
9 * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
\r
11 * Jalview is distributed in the hope that it will be useful, but
\r
12 * WITHOUT ANY WARRANTY; without even the implied warranty
\r
13 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
\r
14 * PURPOSE. See the GNU General Public License for more details.
\r
16 * You should have received a copy of the GNU General Public License along with Jalview. If not, see <http://www.gnu.org/licenses/>.
\r
18 package jalview.schemabinding.version2;
\r
20 //---------------------------------/
\r
21 //- Imported classes and packages -/
\r
22 //---------------------------------/
\r
24 import org.exolab.castor.xml.Marshaller;
\r
25 import org.exolab.castor.xml.Unmarshaller;
\r
30 * @version $Revision$ $Date$
\r
32 public class Colour implements java.io.Serializable
\r
35 // --------------------------/
\r
36 // - Class/Member Variables -/
\r
37 // --------------------------/
\r
42 private java.lang.String _name;
\r
47 private java.lang.String _RGB;
\r
52 private java.lang.String _minRGB;
\r
55 * loosely specified enumeration: NONE,ABOVE, or BELOW
\r
57 private java.lang.String _threshType;
\r
62 private float _threshold;
\r
65 * keeps track of state for field: _threshold
\r
67 private boolean _has_threshold;
\r
75 * keeps track of state for field: _max
\r
77 private boolean _has_max;
\r
85 * keeps track of state for field: _min
\r
87 private boolean _has_min;
\r
90 * Field _colourByLabel.
\r
92 private boolean _colourByLabel;
\r
95 * keeps track of state for field: _colourByLabel
\r
97 private boolean _has_colourByLabel;
\r
100 * Field _autoScale.
\r
102 private boolean _autoScale;
\r
105 * keeps track of state for field: _autoScale
\r
107 private boolean _has_autoScale;
\r
109 // ----------------/
\r
110 // - Constructors -/
\r
111 // ----------------/
\r
124 public void deleteAutoScale()
\r
126 this._has_autoScale = false;
\r
131 public void deleteColourByLabel()
\r
133 this._has_colourByLabel = false;
\r
138 public void deleteMax()
\r
140 this._has_max = false;
\r
145 public void deleteMin()
\r
147 this._has_min = false;
\r
152 public void deleteThreshold()
\r
154 this._has_threshold = false;
\r
158 * Returns the value of field 'autoScale'.
\r
160 * @return the value of field 'AutoScale'.
\r
162 public boolean getAutoScale()
\r
164 return this._autoScale;
\r
168 * Returns the value of field 'colourByLabel'.
\r
170 * @return the value of field 'ColourByLabel'.
\r
172 public boolean getColourByLabel()
\r
174 return this._colourByLabel;
\r
178 * Returns the value of field 'max'.
\r
180 * @return the value of field 'Max'.
\r
182 public float getMax()
\r
188 * Returns the value of field 'min'.
\r
190 * @return the value of field 'Min'.
\r
192 public float getMin()
\r
198 * Returns the value of field 'minRGB'.
\r
200 * @return the value of field 'MinRGB'.
\r
202 public java.lang.String getMinRGB()
\r
204 return this._minRGB;
\r
208 * Returns the value of field 'name'.
\r
210 * @return the value of field 'Name'.
\r
212 public java.lang.String getName()
\r
218 * Returns the value of field 'RGB'.
\r
220 * @return the value of field 'RGB'.
\r
222 public java.lang.String getRGB()
\r
228 * Returns the value of field 'threshType'. The field 'threshType' has the
\r
229 * following description: loosely specified enumeration: NONE,ABOVE, or BELOW
\r
231 * @return the value of field 'ThreshType'.
\r
233 public java.lang.String getThreshType()
\r
235 return this._threshType;
\r
239 * Returns the value of field 'threshold'.
\r
241 * @return the value of field 'Threshold'.
\r
243 public float getThreshold()
\r
245 return this._threshold;
\r
249 * Method hasAutoScale.
\r
251 * @return true if at least one AutoScale has been added
\r
253 public boolean hasAutoScale()
\r
255 return this._has_autoScale;
\r
259 * Method hasColourByLabel.
\r
261 * @return true if at least one ColourByLabel has been added
\r
263 public boolean hasColourByLabel()
\r
265 return this._has_colourByLabel;
\r
271 * @return true if at least one Max has been added
\r
273 public boolean hasMax()
\r
275 return this._has_max;
\r
281 * @return true if at least one Min has been added
\r
283 public boolean hasMin()
\r
285 return this._has_min;
\r
289 * Method hasThreshold.
\r
291 * @return true if at least one Threshold has been added
\r
293 public boolean hasThreshold()
\r
295 return this._has_threshold;
\r
299 * Returns the value of field 'autoScale'.
\r
301 * @return the value of field 'AutoScale'.
\r
303 public boolean isAutoScale()
\r
305 return this._autoScale;
\r
309 * Returns the value of field 'colourByLabel'.
\r
311 * @return the value of field 'ColourByLabel'.
\r
313 public boolean isColourByLabel()
\r
315 return this._colourByLabel;
\r
321 * @return true if this object is valid according to the schema
\r
323 public boolean isValid()
\r
328 } catch (org.exolab.castor.xml.ValidationException vex)
\r
339 * @throws org.exolab.castor.xml.MarshalException
\r
340 * if object is null or if any SAXException is thrown during
\r
342 * @throws org.exolab.castor.xml.ValidationException
\r
343 * if this object is an invalid instance according to the schema
\r
345 public void marshal(final java.io.Writer out)
\r
346 throws org.exolab.castor.xml.MarshalException,
\r
347 org.exolab.castor.xml.ValidationException
\r
349 Marshaller.marshal(this, out);
\r
356 * @throws java.io.IOException
\r
357 * if an IOException occurs during marshaling
\r
358 * @throws org.exolab.castor.xml.ValidationException
\r
359 * if this object is an invalid instance according to the schema
\r
360 * @throws org.exolab.castor.xml.MarshalException
\r
361 * if object is null or if any SAXException is thrown during
\r
364 public void marshal(final org.xml.sax.ContentHandler handler)
\r
365 throws java.io.IOException,
\r
366 org.exolab.castor.xml.MarshalException,
\r
367 org.exolab.castor.xml.ValidationException
\r
369 Marshaller.marshal(this, handler);
\r
373 * Sets the value of field 'autoScale'.
\r
376 * the value of field 'autoScale'.
\r
378 public void setAutoScale(final boolean autoScale)
\r
380 this._autoScale = autoScale;
\r
381 this._has_autoScale = true;
\r
385 * Sets the value of field 'colourByLabel'.
\r
387 * @param colourByLabel
\r
388 * the value of field 'colourByLabel'.
\r
390 public void setColourByLabel(final boolean colourByLabel)
\r
392 this._colourByLabel = colourByLabel;
\r
393 this._has_colourByLabel = true;
\r
397 * Sets the value of field 'max'.
\r
400 * the value of field 'max'.
\r
402 public void setMax(final float max)
\r
405 this._has_max = true;
\r
409 * Sets the value of field 'min'.
\r
412 * the value of field 'min'.
\r
414 public void setMin(final float min)
\r
417 this._has_min = true;
\r
421 * Sets the value of field 'minRGB'.
\r
424 * the value of field 'minRGB'.
\r
426 public void setMinRGB(final java.lang.String minRGB)
\r
428 this._minRGB = minRGB;
\r
432 * Sets the value of field 'name'.
\r
435 * the value of field 'name'.
\r
437 public void setName(final java.lang.String name)
\r
443 * Sets the value of field 'RGB'.
\r
446 * the value of field 'RGB'.
\r
448 public void setRGB(final java.lang.String RGB)
\r
454 * Sets the value of field 'threshType'. The field 'threshType' has the
\r
455 * following description: loosely specified enumeration: NONE,ABOVE, or BELOW
\r
457 * @param threshType
\r
458 * the value of field 'threshType'.
\r
460 public void setThreshType(final java.lang.String threshType)
\r
462 this._threshType = threshType;
\r
466 * Sets the value of field 'threshold'.
\r
469 * the value of field 'threshold'.
\r
471 public void setThreshold(final float threshold)
\r
473 this._threshold = threshold;
\r
474 this._has_threshold = true;
\r
478 * Method unmarshal.
\r
481 * @throws org.exolab.castor.xml.MarshalException
\r
482 * if object is null or if any SAXException is thrown during
\r
484 * @throws org.exolab.castor.xml.ValidationException
\r
485 * if this object is an invalid instance according to the schema
\r
486 * @return the unmarshaled jalview.schemabinding.version2.Colour
\r
488 public static jalview.schemabinding.version2.Colour unmarshal(
\r
489 final java.io.Reader reader)
\r
490 throws org.exolab.castor.xml.MarshalException,
\r
491 org.exolab.castor.xml.ValidationException
\r
493 return (jalview.schemabinding.version2.Colour) Unmarshaller.unmarshal(
\r
494 jalview.schemabinding.version2.Colour.class, reader);
\r
500 * @throws org.exolab.castor.xml.ValidationException
\r
501 * if this object is an invalid instance according to the schema
\r
503 public void validate() throws org.exolab.castor.xml.ValidationException
\r
505 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
\r
506 validator.validate(this);
\r