extend XML model for graduated feature colours, group associated manual/auto annotati...
[jalview.git] / src / jalview / schemabinding / version2 / Setting.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 Setting.\r
30  * \r
31  * @version $Revision$ $Date$\r
32  */\r
33 public class Setting implements java.io.Serializable {\r
34 \r
35 \r
36       //--------------------------/\r
37      //- Class/Member Variables -/\r
38     //--------------------------/\r
39 \r
40     /**\r
41      * Field _type.\r
42      */\r
43     private java.lang.String _type;\r
44 \r
45     /**\r
46      * Field _colour.\r
47      */\r
48     private int _colour;\r
49 \r
50     /**\r
51      * keeps track of state for field: _colour\r
52      */\r
53     private boolean _has_colour;\r
54 \r
55     /**\r
56      * Field _display.\r
57      */\r
58     private boolean _display;\r
59 \r
60     /**\r
61      * keeps track of state for field: _display\r
62      */\r
63     private boolean _has_display;\r
64 \r
65     /**\r
66      * Field _order.\r
67      */\r
68     private float _order;\r
69 \r
70     /**\r
71      * keeps track of state for field: _order\r
72      */\r
73     private boolean _has_order;\r
74 \r
75     /**\r
76      * Optional minimum colour for graduated feature colour\r
77      */\r
78     private int _mincolour;\r
79 \r
80     /**\r
81      * keeps track of state for field: _mincolour\r
82      */\r
83     private boolean _has_mincolour;\r
84 \r
85     /**\r
86      * threshold value for graduated feature colour\r
87      */\r
88     private float _threshold;\r
89 \r
90     /**\r
91      * keeps track of state for field: _threshold\r
92      */\r
93     private boolean _has_threshold;\r
94 \r
95     /**\r
96      * threshold type for graduated feature colour\r
97      */\r
98     private int _threshstate;\r
99 \r
100     /**\r
101      * keeps track of state for field: _threshstate\r
102      */\r
103     private boolean _has_threshstate;\r
104 \r
105     /**\r
106      * Field _max.\r
107      */\r
108     private float _max;\r
109 \r
110     /**\r
111      * keeps track of state for field: _max\r
112      */\r
113     private boolean _has_max;\r
114 \r
115     /**\r
116      * Field _min.\r
117      */\r
118     private float _min;\r
119 \r
120     /**\r
121      * keeps track of state for field: _min\r
122      */\r
123     private boolean _has_min;\r
124 \r
125     /**\r
126      * Field _colourByLabel.\r
127      */\r
128     private boolean _colourByLabel;\r
129 \r
130     /**\r
131      * keeps track of state for field: _colourByLabel\r
132      */\r
133     private boolean _has_colourByLabel;\r
134 \r
135     /**\r
136      * Field _autoScale.\r
137      */\r
138     private boolean _autoScale;\r
139 \r
140     /**\r
141      * keeps track of state for field: _autoScale\r
142      */\r
143     private boolean _has_autoScale;\r
144 \r
145 \r
146       //----------------/\r
147      //- Constructors -/\r
148     //----------------/\r
149 \r
150     public Setting() {\r
151         super();\r
152     }\r
153 \r
154 \r
155       //-----------/\r
156      //- Methods -/\r
157     //-----------/\r
158 \r
159     /**\r
160      */\r
161     public void deleteAutoScale(\r
162     ) {\r
163         this._has_autoScale= false;\r
164     }\r
165 \r
166     /**\r
167      */\r
168     public void deleteColour(\r
169     ) {\r
170         this._has_colour= false;\r
171     }\r
172 \r
173     /**\r
174      */\r
175     public void deleteColourByLabel(\r
176     ) {\r
177         this._has_colourByLabel= false;\r
178     }\r
179 \r
180     /**\r
181      */\r
182     public void deleteDisplay(\r
183     ) {\r
184         this._has_display= false;\r
185     }\r
186 \r
187     /**\r
188      */\r
189     public void deleteMax(\r
190     ) {\r
191         this._has_max= false;\r
192     }\r
193 \r
194     /**\r
195      */\r
196     public void deleteMin(\r
197     ) {\r
198         this._has_min= false;\r
199     }\r
200 \r
201     /**\r
202      */\r
203     public void deleteMincolour(\r
204     ) {\r
205         this._has_mincolour= false;\r
206     }\r
207 \r
208     /**\r
209      */\r
210     public void deleteOrder(\r
211     ) {\r
212         this._has_order= false;\r
213     }\r
214 \r
215     /**\r
216      */\r
217     public void deleteThreshold(\r
218     ) {\r
219         this._has_threshold= false;\r
220     }\r
221 \r
222     /**\r
223      */\r
224     public void deleteThreshstate(\r
225     ) {\r
226         this._has_threshstate= false;\r
227     }\r
228 \r
229     /**\r
230      * Returns the value of field 'autoScale'.\r
231      * \r
232      * @return the value of field 'AutoScale'.\r
233      */\r
234     public boolean getAutoScale(\r
235     ) {\r
236         return this._autoScale;\r
237     }\r
238 \r
239     /**\r
240      * Returns the value of field 'colour'.\r
241      * \r
242      * @return the value of field 'Colour'.\r
243      */\r
244     public int getColour(\r
245     ) {\r
246         return this._colour;\r
247     }\r
248 \r
249     /**\r
250      * Returns the value of field 'colourByLabel'.\r
251      * \r
252      * @return the value of field 'ColourByLabel'.\r
253      */\r
254     public boolean getColourByLabel(\r
255     ) {\r
256         return this._colourByLabel;\r
257     }\r
258 \r
259     /**\r
260      * Returns the value of field 'display'.\r
261      * \r
262      * @return the value of field 'Display'.\r
263      */\r
264     public boolean getDisplay(\r
265     ) {\r
266         return this._display;\r
267     }\r
268 \r
269     /**\r
270      * Returns the value of field 'max'.\r
271      * \r
272      * @return the value of field 'Max'.\r
273      */\r
274     public float getMax(\r
275     ) {\r
276         return this._max;\r
277     }\r
278 \r
279     /**\r
280      * Returns the value of field 'min'.\r
281      * \r
282      * @return the value of field 'Min'.\r
283      */\r
284     public float getMin(\r
285     ) {\r
286         return this._min;\r
287     }\r
288 \r
289     /**\r
290      * Returns the value of field 'mincolour'. The field\r
291      * 'mincolour' has the following description: Optional minimum\r
292      * colour for graduated feature colour\r
293      * \r
294      * @return the value of field 'Mincolour'.\r
295      */\r
296     public int getMincolour(\r
297     ) {\r
298         return this._mincolour;\r
299     }\r
300 \r
301     /**\r
302      * Returns the value of field 'order'.\r
303      * \r
304      * @return the value of field 'Order'.\r
305      */\r
306     public float getOrder(\r
307     ) {\r
308         return this._order;\r
309     }\r
310 \r
311     /**\r
312      * Returns the value of field 'threshold'. The field\r
313      * 'threshold' has the following description: threshold value\r
314      * for graduated feature colour\r
315      * \r
316      * @return the value of field 'Threshold'.\r
317      */\r
318     public float getThreshold(\r
319     ) {\r
320         return this._threshold;\r
321     }\r
322 \r
323     /**\r
324      * Returns the value of field 'threshstate'. The field\r
325      * 'threshstate' has the following description: threshold type\r
326      * for graduated feature colour\r
327      * \r
328      * @return the value of field 'Threshstate'.\r
329      */\r
330     public int getThreshstate(\r
331     ) {\r
332         return this._threshstate;\r
333     }\r
334 \r
335     /**\r
336      * Returns the value of field 'type'.\r
337      * \r
338      * @return the value of field 'Type'.\r
339      */\r
340     public java.lang.String getType(\r
341     ) {\r
342         return this._type;\r
343     }\r
344 \r
345     /**\r
346      * Method hasAutoScale.\r
347      * \r
348      * @return true if at least one AutoScale has been added\r
349      */\r
350     public boolean hasAutoScale(\r
351     ) {\r
352         return this._has_autoScale;\r
353     }\r
354 \r
355     /**\r
356      * Method hasColour.\r
357      * \r
358      * @return true if at least one Colour has been added\r
359      */\r
360     public boolean hasColour(\r
361     ) {\r
362         return this._has_colour;\r
363     }\r
364 \r
365     /**\r
366      * Method hasColourByLabel.\r
367      * \r
368      * @return true if at least one ColourByLabel has been added\r
369      */\r
370     public boolean hasColourByLabel(\r
371     ) {\r
372         return this._has_colourByLabel;\r
373     }\r
374 \r
375     /**\r
376      * Method hasDisplay.\r
377      * \r
378      * @return true if at least one Display has been added\r
379      */\r
380     public boolean hasDisplay(\r
381     ) {\r
382         return this._has_display;\r
383     }\r
384 \r
385     /**\r
386      * Method hasMax.\r
387      * \r
388      * @return true if at least one Max has been added\r
389      */\r
390     public boolean hasMax(\r
391     ) {\r
392         return this._has_max;\r
393     }\r
394 \r
395     /**\r
396      * Method hasMin.\r
397      * \r
398      * @return true if at least one Min has been added\r
399      */\r
400     public boolean hasMin(\r
401     ) {\r
402         return this._has_min;\r
403     }\r
404 \r
405     /**\r
406      * Method hasMincolour.\r
407      * \r
408      * @return true if at least one Mincolour has been added\r
409      */\r
410     public boolean hasMincolour(\r
411     ) {\r
412         return this._has_mincolour;\r
413     }\r
414 \r
415     /**\r
416      * Method hasOrder.\r
417      * \r
418      * @return true if at least one Order has been added\r
419      */\r
420     public boolean hasOrder(\r
421     ) {\r
422         return this._has_order;\r
423     }\r
424 \r
425     /**\r
426      * Method hasThreshold.\r
427      * \r
428      * @return true if at least one Threshold has been added\r
429      */\r
430     public boolean hasThreshold(\r
431     ) {\r
432         return this._has_threshold;\r
433     }\r
434 \r
435     /**\r
436      * Method hasThreshstate.\r
437      * \r
438      * @return true if at least one Threshstate has been added\r
439      */\r
440     public boolean hasThreshstate(\r
441     ) {\r
442         return this._has_threshstate;\r
443     }\r
444 \r
445     /**\r
446      * Returns the value of field 'autoScale'.\r
447      * \r
448      * @return the value of field 'AutoScale'.\r
449      */\r
450     public boolean isAutoScale(\r
451     ) {\r
452         return this._autoScale;\r
453     }\r
454 \r
455     /**\r
456      * Returns the value of field 'colourByLabel'.\r
457      * \r
458      * @return the value of field 'ColourByLabel'.\r
459      */\r
460     public boolean isColourByLabel(\r
461     ) {\r
462         return this._colourByLabel;\r
463     }\r
464 \r
465     /**\r
466      * Returns the value of field 'display'.\r
467      * \r
468      * @return the value of field 'Display'.\r
469      */\r
470     public boolean isDisplay(\r
471     ) {\r
472         return this._display;\r
473     }\r
474 \r
475     /**\r
476      * Method isValid.\r
477      * \r
478      * @return true if this object is valid according to the schema\r
479      */\r
480     public boolean isValid(\r
481     ) {\r
482         try {\r
483             validate();\r
484         } catch (org.exolab.castor.xml.ValidationException vex) {\r
485             return false;\r
486         }\r
487         return true;\r
488     }\r
489 \r
490     /**\r
491      * \r
492      * \r
493      * @param out\r
494      * @throws org.exolab.castor.xml.MarshalException if object is\r
495      * null or if any SAXException is thrown during marshaling\r
496      * @throws org.exolab.castor.xml.ValidationException if this\r
497      * object is an invalid instance according to the schema\r
498      */\r
499     public void marshal(\r
500             final java.io.Writer out)\r
501     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {\r
502         Marshaller.marshal(this, out);\r
503     }\r
504 \r
505     /**\r
506      * \r
507      * \r
508      * @param handler\r
509      * @throws java.io.IOException if an IOException occurs during\r
510      * marshaling\r
511      * @throws org.exolab.castor.xml.ValidationException if this\r
512      * object is an invalid instance according to the schema\r
513      * @throws org.exolab.castor.xml.MarshalException if object is\r
514      * null or if any SAXException is thrown during marshaling\r
515      */\r
516     public void marshal(\r
517             final org.xml.sax.ContentHandler handler)\r
518     throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {\r
519         Marshaller.marshal(this, handler);\r
520     }\r
521 \r
522     /**\r
523      * Sets the value of field 'autoScale'.\r
524      * \r
525      * @param autoScale the value of field 'autoScale'.\r
526      */\r
527     public void setAutoScale(\r
528             final boolean autoScale) {\r
529         this._autoScale = autoScale;\r
530         this._has_autoScale = true;\r
531     }\r
532 \r
533     /**\r
534      * Sets the value of field 'colour'.\r
535      * \r
536      * @param colour the value of field 'colour'.\r
537      */\r
538     public void setColour(\r
539             final int colour) {\r
540         this._colour = colour;\r
541         this._has_colour = true;\r
542     }\r
543 \r
544     /**\r
545      * Sets the value of field 'colourByLabel'.\r
546      * \r
547      * @param colourByLabel the value of field 'colourByLabel'.\r
548      */\r
549     public void setColourByLabel(\r
550             final boolean colourByLabel) {\r
551         this._colourByLabel = colourByLabel;\r
552         this._has_colourByLabel = true;\r
553     }\r
554 \r
555     /**\r
556      * Sets the value of field 'display'.\r
557      * \r
558      * @param display the value of field 'display'.\r
559      */\r
560     public void setDisplay(\r
561             final boolean display) {\r
562         this._display = display;\r
563         this._has_display = true;\r
564     }\r
565 \r
566     /**\r
567      * Sets the value of field 'max'.\r
568      * \r
569      * @param max the value of field 'max'.\r
570      */\r
571     public void setMax(\r
572             final float max) {\r
573         this._max = max;\r
574         this._has_max = true;\r
575     }\r
576 \r
577     /**\r
578      * Sets the value of field 'min'.\r
579      * \r
580      * @param min the value of field 'min'.\r
581      */\r
582     public void setMin(\r
583             final float min) {\r
584         this._min = min;\r
585         this._has_min = true;\r
586     }\r
587 \r
588     /**\r
589      * Sets the value of field 'mincolour'. The field 'mincolour'\r
590      * has the following description: Optional minimum colour for\r
591      * graduated feature colour\r
592      * \r
593      * @param mincolour the value of field 'mincolour'.\r
594      */\r
595     public void setMincolour(\r
596             final int mincolour) {\r
597         this._mincolour = mincolour;\r
598         this._has_mincolour = true;\r
599     }\r
600 \r
601     /**\r
602      * Sets the value of field 'order'.\r
603      * \r
604      * @param order the value of field 'order'.\r
605      */\r
606     public void setOrder(\r
607             final float order) {\r
608         this._order = order;\r
609         this._has_order = true;\r
610     }\r
611 \r
612     /**\r
613      * Sets the value of field 'threshold'. The field 'threshold'\r
614      * has the following description: threshold value for graduated\r
615      * feature colour\r
616      * \r
617      * @param threshold the value of field 'threshold'.\r
618      */\r
619     public void setThreshold(\r
620             final float threshold) {\r
621         this._threshold = threshold;\r
622         this._has_threshold = true;\r
623     }\r
624 \r
625     /**\r
626      * Sets the value of field 'threshstate'. The field\r
627      * 'threshstate' has the following description: threshold type\r
628      * for graduated feature colour\r
629      * \r
630      * @param threshstate the value of field 'threshstate'.\r
631      */\r
632     public void setThreshstate(\r
633             final int threshstate) {\r
634         this._threshstate = threshstate;\r
635         this._has_threshstate = true;\r
636     }\r
637 \r
638     /**\r
639      * Sets the value of field 'type'.\r
640      * \r
641      * @param type the value of field 'type'.\r
642      */\r
643     public void setType(\r
644             final java.lang.String type) {\r
645         this._type = type;\r
646     }\r
647 \r
648     /**\r
649      * Method unmarshal.\r
650      * \r
651      * @param reader\r
652      * @throws org.exolab.castor.xml.MarshalException if object is\r
653      * null or if any SAXException is thrown during marshaling\r
654      * @throws org.exolab.castor.xml.ValidationException if this\r
655      * object is an invalid instance according to the schema\r
656      * @return the unmarshaled jalview.schemabinding.version2.Settin\r
657      */\r
658     public static jalview.schemabinding.version2.Setting unmarshal(\r
659             final java.io.Reader reader)\r
660     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {\r
661         return (jalview.schemabinding.version2.Setting) Unmarshaller.unmarshal(jalview.schemabinding.version2.Setting.class, reader);\r
662     }\r
663 \r
664     /**\r
665      * \r
666      * \r
667      * @throws org.exolab.castor.xml.ValidationException if this\r
668      * object is an invalid instance according to the schema\r
669      */\r
670     public void validate(\r
671     )\r
672     throws org.exolab.castor.xml.ValidationException {\r
673         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();\r
674         validator.validate(this);\r
675     }\r
676 \r
677 }\r