c7184116982078e7a9c9951e17d739d5af8a7e6c
[jalview.git] / src / jalview / schemabinding / version2 / Colour.java
1 /*
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
4  * 
5  * This file is part of Jalview.
6  * 
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.
10  *  
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.
15  * 
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  */
18 package jalview.schemabinding.version2;
19
20 //---------------------------------/
21 //- Imported classes and packages -/
22 //---------------------------------/
23
24 import org.exolab.castor.xml.Marshaller;
25 import org.exolab.castor.xml.Unmarshaller;
26
27 /**
28  * Class Colour.
29  * 
30  * @version $Revision$ $Date$
31  */
32 public class Colour implements java.io.Serializable
33 {
34
35   // --------------------------/
36   // - Class/Member Variables -/
37   // --------------------------/
38
39   /**
40    * Field _name.
41    */
42   private java.lang.String _name;
43
44   /**
45    * Field _RGB.
46    */
47   private java.lang.String _RGB;
48
49   /**
50    * Field _minRGB.
51    */
52   private java.lang.String _minRGB;
53
54   /**
55    * loosely specified enumeration: NONE,ABOVE, or BELOW
56    */
57   private java.lang.String _threshType;
58
59   /**
60    * Field _threshold.
61    */
62   private float _threshold;
63
64   /**
65    * keeps track of state for field: _threshold
66    */
67   private boolean _has_threshold;
68
69   /**
70    * Field _max.
71    */
72   private float _max;
73
74   /**
75    * keeps track of state for field: _max
76    */
77   private boolean _has_max;
78
79   /**
80    * Field _min.
81    */
82   private float _min;
83
84   /**
85    * keeps track of state for field: _min
86    */
87   private boolean _has_min;
88
89   /**
90    * Field _colourByLabel.
91    */
92   private boolean _colourByLabel;
93
94   /**
95    * keeps track of state for field: _colourByLabel
96    */
97   private boolean _has_colourByLabel;
98
99   /**
100    * Field _autoScale.
101    */
102   private boolean _autoScale;
103
104   /**
105    * keeps track of state for field: _autoScale
106    */
107   private boolean _has_autoScale;
108
109   // ----------------/
110   // - Constructors -/
111   // ----------------/
112
113   public Colour()
114   {
115     super();
116   }
117
118   // -----------/
119   // - Methods -/
120   // -----------/
121
122   /**
123      */
124   public void deleteAutoScale()
125   {
126     this._has_autoScale = false;
127   }
128
129   /**
130      */
131   public void deleteColourByLabel()
132   {
133     this._has_colourByLabel = false;
134   }
135
136   /**
137      */
138   public void deleteMax()
139   {
140     this._has_max = false;
141   }
142
143   /**
144      */
145   public void deleteMin()
146   {
147     this._has_min = false;
148   }
149
150   /**
151      */
152   public void deleteThreshold()
153   {
154     this._has_threshold = false;
155   }
156
157   /**
158    * Returns the value of field 'autoScale'.
159    * 
160    * @return the value of field 'AutoScale'.
161    */
162   public boolean getAutoScale()
163   {
164     return this._autoScale;
165   }
166
167   /**
168    * Returns the value of field 'colourByLabel'.
169    * 
170    * @return the value of field 'ColourByLabel'.
171    */
172   public boolean getColourByLabel()
173   {
174     return this._colourByLabel;
175   }
176
177   /**
178    * Returns the value of field 'max'.
179    * 
180    * @return the value of field 'Max'.
181    */
182   public float getMax()
183   {
184     return this._max;
185   }
186
187   /**
188    * Returns the value of field 'min'.
189    * 
190    * @return the value of field 'Min'.
191    */
192   public float getMin()
193   {
194     return this._min;
195   }
196
197   /**
198    * Returns the value of field 'minRGB'.
199    * 
200    * @return the value of field 'MinRGB'.
201    */
202   public java.lang.String getMinRGB()
203   {
204     return this._minRGB;
205   }
206
207   /**
208    * Returns the value of field 'name'.
209    * 
210    * @return the value of field 'Name'.
211    */
212   public java.lang.String getName()
213   {
214     return this._name;
215   }
216
217   /**
218    * Returns the value of field 'RGB'.
219    * 
220    * @return the value of field 'RGB'.
221    */
222   public java.lang.String getRGB()
223   {
224     return this._RGB;
225   }
226
227   /**
228    * Returns the value of field 'threshType'. The field 'threshType' has the
229    * following description: loosely specified enumeration: NONE,ABOVE, or BELOW
230    * 
231    * @return the value of field 'ThreshType'.
232    */
233   public java.lang.String getThreshType()
234   {
235     return this._threshType;
236   }
237
238   /**
239    * Returns the value of field 'threshold'.
240    * 
241    * @return the value of field 'Threshold'.
242    */
243   public float getThreshold()
244   {
245     return this._threshold;
246   }
247
248   /**
249    * Method hasAutoScale.
250    * 
251    * @return true if at least one AutoScale has been added
252    */
253   public boolean hasAutoScale()
254   {
255     return this._has_autoScale;
256   }
257
258   /**
259    * Method hasColourByLabel.
260    * 
261    * @return true if at least one ColourByLabel has been added
262    */
263   public boolean hasColourByLabel()
264   {
265     return this._has_colourByLabel;
266   }
267
268   /**
269    * Method hasMax.
270    * 
271    * @return true if at least one Max has been added
272    */
273   public boolean hasMax()
274   {
275     return this._has_max;
276   }
277
278   /**
279    * Method hasMin.
280    * 
281    * @return true if at least one Min has been added
282    */
283   public boolean hasMin()
284   {
285     return this._has_min;
286   }
287
288   /**
289    * Method hasThreshold.
290    * 
291    * @return true if at least one Threshold has been added
292    */
293   public boolean hasThreshold()
294   {
295     return this._has_threshold;
296   }
297
298   /**
299    * Returns the value of field 'autoScale'.
300    * 
301    * @return the value of field 'AutoScale'.
302    */
303   public boolean isAutoScale()
304   {
305     return this._autoScale;
306   }
307
308   /**
309    * Returns the value of field 'colourByLabel'.
310    * 
311    * @return the value of field 'ColourByLabel'.
312    */
313   public boolean isColourByLabel()
314   {
315     return this._colourByLabel;
316   }
317
318   /**
319    * Method isValid.
320    * 
321    * @return true if this object is valid according to the schema
322    */
323   public boolean isValid()
324   {
325     try
326     {
327       validate();
328     } catch (org.exolab.castor.xml.ValidationException vex)
329     {
330       return false;
331     }
332     return true;
333   }
334
335   /**
336    * 
337    * 
338    * @param out
339    * @throws org.exolab.castor.xml.MarshalException
340    *           if object is null or if any SAXException is thrown during
341    *           marshaling
342    * @throws org.exolab.castor.xml.ValidationException
343    *           if this object is an invalid instance according to the schema
344    */
345   public void marshal(final java.io.Writer out)
346           throws org.exolab.castor.xml.MarshalException,
347           org.exolab.castor.xml.ValidationException
348   {
349     Marshaller.marshal(this, out);
350   }
351
352   /**
353    * 
354    * 
355    * @param handler
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
362    *           marshaling
363    */
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
368   {
369     Marshaller.marshal(this, handler);
370   }
371
372   /**
373    * Sets the value of field 'autoScale'.
374    * 
375    * @param autoScale
376    *          the value of field 'autoScale'.
377    */
378   public void setAutoScale(final boolean autoScale)
379   {
380     this._autoScale = autoScale;
381     this._has_autoScale = true;
382   }
383
384   /**
385    * Sets the value of field 'colourByLabel'.
386    * 
387    * @param colourByLabel
388    *          the value of field 'colourByLabel'.
389    */
390   public void setColourByLabel(final boolean colourByLabel)
391   {
392     this._colourByLabel = colourByLabel;
393     this._has_colourByLabel = true;
394   }
395
396   /**
397    * Sets the value of field 'max'.
398    * 
399    * @param max
400    *          the value of field 'max'.
401    */
402   public void setMax(final float max)
403   {
404     this._max = max;
405     this._has_max = true;
406   }
407
408   /**
409    * Sets the value of field 'min'.
410    * 
411    * @param min
412    *          the value of field 'min'.
413    */
414   public void setMin(final float min)
415   {
416     this._min = min;
417     this._has_min = true;
418   }
419
420   /**
421    * Sets the value of field 'minRGB'.
422    * 
423    * @param minRGB
424    *          the value of field 'minRGB'.
425    */
426   public void setMinRGB(final java.lang.String minRGB)
427   {
428     this._minRGB = minRGB;
429   }
430
431   /**
432    * Sets the value of field 'name'.
433    * 
434    * @param name
435    *          the value of field 'name'.
436    */
437   public void setName(final java.lang.String name)
438   {
439     this._name = name;
440   }
441
442   /**
443    * Sets the value of field 'RGB'.
444    * 
445    * @param RGB
446    *          the value of field 'RGB'.
447    */
448   public void setRGB(final java.lang.String RGB)
449   {
450     this._RGB = RGB;
451   }
452
453   /**
454    * Sets the value of field 'threshType'. The field 'threshType' has the
455    * following description: loosely specified enumeration: NONE,ABOVE, or BELOW
456    * 
457    * @param threshType
458    *          the value of field 'threshType'.
459    */
460   public void setThreshType(final java.lang.String threshType)
461   {
462     this._threshType = threshType;
463   }
464
465   /**
466    * Sets the value of field 'threshold'.
467    * 
468    * @param threshold
469    *          the value of field 'threshold'.
470    */
471   public void setThreshold(final float threshold)
472   {
473     this._threshold = threshold;
474     this._has_threshold = true;
475   }
476
477   /**
478    * Method unmarshal.
479    * 
480    * @param reader
481    * @throws org.exolab.castor.xml.MarshalException
482    *           if object is null or if any SAXException is thrown during
483    *           marshaling
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
487    */
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
492   {
493     return (jalview.schemabinding.version2.Colour) Unmarshaller.unmarshal(
494             jalview.schemabinding.version2.Colour.class, reader);
495   }
496
497   /**
498    * 
499    * 
500    * @throws org.exolab.castor.xml.ValidationException
501    *           if this object is an invalid instance according to the schema
502    */
503   public void validate() throws org.exolab.castor.xml.ValidationException
504   {
505     org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
506     validator.validate(this);
507   }
508
509 }