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