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