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