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