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