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