6167df874b4d08071e52930af319155f96a14254
[jalview.git] / src / jalview / schemabinding / version2 / AnnotationColourScheme.java
1 /*
2  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2)
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
10  * of the License, or (at your option) any later version.
11  *  
12  * Jalview is distributed in the hope that it will be useful, but 
13  * WITHOUT ANY WARRANTY; without even the implied warranty 
14  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
15  * PURPOSE.  See the GNU General Public License for more details.
16  * 
17  * You should have received a copy of the GNU General Public License
18  * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
19  * The Jalview Authors are detailed in the 'AUTHORS' file.
20  */
21 package jalview.schemabinding.version2;
22
23 //---------------------------------/
24 //- Imported classes and packages -/
25 //---------------------------------/
26
27 import org.exolab.castor.xml.Marshaller;
28 import org.exolab.castor.xml.Unmarshaller;
29
30 /**
31  * Class AnnotationColourScheme.
32  * 
33  * @version $Revision$ $Date$
34  */
35 public class AnnotationColourScheme implements java.io.Serializable
36 {
37
38   // --------------------------/
39   // - Class/Member Variables -/
40   // --------------------------/
41
42   /**
43    * Field _aboveThreshold.
44    */
45   private int _aboveThreshold;
46
47   /**
48    * keeps track of state for field: _aboveThreshold
49    */
50   private boolean _has_aboveThreshold;
51
52   /**
53    * Field _annotation.
54    */
55   private java.lang.String _annotation;
56
57   /**
58    * Field _minColour.
59    */
60   private int _minColour;
61
62   /**
63    * keeps track of state for field: _minColour
64    */
65   private boolean _has_minColour;
66
67   /**
68    * Field _maxColour.
69    */
70   private int _maxColour;
71
72   /**
73    * keeps track of state for field: _maxColour
74    */
75   private boolean _has_maxColour;
76
77   /**
78    * Field _colourScheme.
79    */
80   private java.lang.String _colourScheme;
81
82   /**
83    * Field _threshold.
84    */
85   private float _threshold;
86
87   /**
88    * keeps track of state for field: _threshold
89    */
90   private boolean _has_threshold;
91
92   /**
93    * Field _perSequence.
94    */
95   private boolean _perSequence;
96
97   /**
98    * keeps track of state for field: _perSequence
99    */
100   private boolean _has_perSequence;
101
102   /**
103    * Field _predefinedColours.
104    */
105   private boolean _predefinedColours;
106
107   /**
108    * keeps track of state for field: _predefinedColours
109    */
110   private boolean _has_predefinedColours;
111
112   // ----------------/
113   // - Constructors -/
114   // ----------------/
115
116   public AnnotationColourScheme()
117   {
118     super();
119   }
120
121   // -----------/
122   // - Methods -/
123   // -----------/
124
125   /**
126      */
127   public void deleteAboveThreshold()
128   {
129     this._has_aboveThreshold = false;
130   }
131
132   /**
133      */
134   public void deleteMaxColour()
135   {
136     this._has_maxColour = false;
137   }
138
139   /**
140      */
141   public void deleteMinColour()
142   {
143     this._has_minColour = false;
144   }
145
146   /**
147      */
148   public void deletePerSequence()
149   {
150     this._has_perSequence = false;
151   }
152
153   /**
154      */
155   public void deletePredefinedColours()
156   {
157     this._has_predefinedColours = false;
158   }
159
160   /**
161      */
162   public void deleteThreshold()
163   {
164     this._has_threshold = false;
165   }
166
167   /**
168    * Returns the value of field 'aboveThreshold'.
169    * 
170    * @return the value of field 'AboveThreshold'.
171    */
172   public int getAboveThreshold()
173   {
174     return this._aboveThreshold;
175   }
176
177   /**
178    * Returns the value of field 'annotation'.
179    * 
180    * @return the value of field 'Annotation'.
181    */
182   public java.lang.String getAnnotation()
183   {
184     return this._annotation;
185   }
186
187   /**
188    * Returns the value of field 'colourScheme'.
189    * 
190    * @return the value of field 'ColourScheme'.
191    */
192   public java.lang.String getColourScheme()
193   {
194     return this._colourScheme;
195   }
196
197   /**
198    * Returns the value of field 'maxColour'.
199    * 
200    * @return the value of field 'MaxColour'.
201    */
202   public int getMaxColour()
203   {
204     return this._maxColour;
205   }
206
207   /**
208    * Returns the value of field 'minColour'.
209    * 
210    * @return the value of field 'MinColour'.
211    */
212   public int getMinColour()
213   {
214     return this._minColour;
215   }
216
217   /**
218    * Returns the value of field 'perSequence'.
219    * 
220    * @return the value of field 'PerSequence'.
221    */
222   public boolean getPerSequence()
223   {
224     return this._perSequence;
225   }
226
227   /**
228    * Returns the value of field 'predefinedColours'.
229    * 
230    * @return the value of field 'PredefinedColours'.
231    */
232   public boolean getPredefinedColours()
233   {
234     return this._predefinedColours;
235   }
236
237   /**
238    * Returns the value of field 'threshold'.
239    * 
240    * @return the value of field 'Threshold'.
241    */
242   public float getThreshold()
243   {
244     return this._threshold;
245   }
246
247   /**
248    * Method hasAboveThreshold.
249    * 
250    * @return true if at least one AboveThreshold has been added
251    */
252   public boolean hasAboveThreshold()
253   {
254     return this._has_aboveThreshold;
255   }
256
257   /**
258    * Method hasMaxColour.
259    * 
260    * @return true if at least one MaxColour has been added
261    */
262   public boolean hasMaxColour()
263   {
264     return this._has_maxColour;
265   }
266
267   /**
268    * Method hasMinColour.
269    * 
270    * @return true if at least one MinColour has been added
271    */
272   public boolean hasMinColour()
273   {
274     return this._has_minColour;
275   }
276
277   /**
278    * Method hasPerSequence.
279    * 
280    * @return true if at least one PerSequence has been added
281    */
282   public boolean hasPerSequence()
283   {
284     return this._has_perSequence;
285   }
286
287   /**
288    * Method hasPredefinedColours.
289    * 
290    * @return true if at least one PredefinedColours has been added
291    */
292   public boolean hasPredefinedColours()
293   {
294     return this._has_predefinedColours;
295   }
296
297   /**
298    * Method hasThreshold.
299    * 
300    * @return true if at least one Threshold has been added
301    */
302   public boolean hasThreshold()
303   {
304     return this._has_threshold;
305   }
306
307   /**
308    * Returns the value of field 'perSequence'.
309    * 
310    * @return the value of field 'PerSequence'.
311    */
312   public boolean isPerSequence()
313   {
314     return this._perSequence;
315   }
316
317   /**
318    * Returns the value of field 'predefinedColours'.
319    * 
320    * @return the value of field 'PredefinedColours'.
321    */
322   public boolean isPredefinedColours()
323   {
324     return this._predefinedColours;
325   }
326
327   /**
328    * Method isValid.
329    * 
330    * @return true if this object is valid according to the schema
331    */
332   public boolean isValid()
333   {
334     try
335     {
336       validate();
337     } catch (org.exolab.castor.xml.ValidationException vex)
338     {
339       return false;
340     }
341     return true;
342   }
343
344   /**
345    * 
346    * 
347    * @param out
348    * @throws org.exolab.castor.xml.MarshalException
349    *           if object is null or if any SAXException is thrown during
350    *           marshaling
351    * @throws org.exolab.castor.xml.ValidationException
352    *           if this object is an invalid instance according to the schema
353    */
354   public void marshal(final java.io.Writer out)
355           throws org.exolab.castor.xml.MarshalException,
356           org.exolab.castor.xml.ValidationException
357   {
358     Marshaller.marshal(this, out);
359   }
360
361   /**
362    * 
363    * 
364    * @param handler
365    * @throws java.io.IOException
366    *           if an IOException occurs during marshaling
367    * @throws org.exolab.castor.xml.ValidationException
368    *           if this object is an invalid instance according to the schema
369    * @throws org.exolab.castor.xml.MarshalException
370    *           if object is null or if any SAXException is thrown during
371    *           marshaling
372    */
373   public void marshal(final org.xml.sax.ContentHandler handler)
374           throws java.io.IOException,
375           org.exolab.castor.xml.MarshalException,
376           org.exolab.castor.xml.ValidationException
377   {
378     Marshaller.marshal(this, handler);
379   }
380
381   /**
382    * Sets the value of field 'aboveThreshold'.
383    * 
384    * @param aboveThreshold
385    *          the value of field 'aboveThreshold'.
386    */
387   public void setAboveThreshold(final int aboveThreshold)
388   {
389     this._aboveThreshold = aboveThreshold;
390     this._has_aboveThreshold = true;
391   }
392
393   /**
394    * Sets the value of field 'annotation'.
395    * 
396    * @param annotation
397    *          the value of field 'annotation'.
398    */
399   public void setAnnotation(final java.lang.String annotation)
400   {
401     this._annotation = annotation;
402   }
403
404   /**
405    * Sets the value of field 'colourScheme'.
406    * 
407    * @param colourScheme
408    *          the value of field 'colourScheme'.
409    */
410   public void setColourScheme(final java.lang.String colourScheme)
411   {
412     this._colourScheme = colourScheme;
413   }
414
415   /**
416    * Sets the value of field 'maxColour'.
417    * 
418    * @param maxColour
419    *          the value of field 'maxColour'.
420    */
421   public void setMaxColour(final int maxColour)
422   {
423     this._maxColour = maxColour;
424     this._has_maxColour = true;
425   }
426
427   /**
428    * Sets the value of field 'minColour'.
429    * 
430    * @param minColour
431    *          the value of field 'minColour'.
432    */
433   public void setMinColour(final int minColour)
434   {
435     this._minColour = minColour;
436     this._has_minColour = true;
437   }
438
439   /**
440    * Sets the value of field 'perSequence'.
441    * 
442    * @param perSequence
443    *          the value of field 'perSequence'.
444    */
445   public void setPerSequence(final boolean perSequence)
446   {
447     this._perSequence = perSequence;
448     this._has_perSequence = true;
449   }
450
451   /**
452    * Sets the value of field 'predefinedColours'.
453    * 
454    * @param predefinedColours
455    *          the value of field 'predefinedColours'.
456    */
457   public void setPredefinedColours(final boolean predefinedColours)
458   {
459     this._predefinedColours = predefinedColours;
460     this._has_predefinedColours = true;
461   }
462
463   /**
464    * Sets the value of field 'threshold'.
465    * 
466    * @param threshold
467    *          the value of field 'threshold'.
468    */
469   public void setThreshold(final float threshold)
470   {
471     this._threshold = threshold;
472     this._has_threshold = true;
473   }
474
475   /**
476    * Method unmarshal.
477    * 
478    * @param reader
479    * @throws org.exolab.castor.xml.MarshalException
480    *           if object is null or if any SAXException is thrown during
481    *           marshaling
482    * @throws org.exolab.castor.xml.ValidationException
483    *           if this object is an invalid instance according to the schema
484    * @return the unmarshaled
485    *         jalview.schemabinding.version2.AnnotationColourScheme
486    */
487   public static jalview.schemabinding.version2.AnnotationColourScheme unmarshal(
488           final java.io.Reader reader)
489           throws org.exolab.castor.xml.MarshalException,
490           org.exolab.castor.xml.ValidationException
491   {
492     return (jalview.schemabinding.version2.AnnotationColourScheme) Unmarshaller
493             .unmarshal(
494                     jalview.schemabinding.version2.AnnotationColourScheme.class,
495                     reader);
496   }
497
498   /**
499    * 
500    * 
501    * @throws org.exolab.castor.xml.ValidationException
502    *           if this object is an invalid instance according to the schema
503    */
504   public void validate() throws org.exolab.castor.xml.ValidationException
505   {
506     org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
507     validator.validate(this);
508   }
509
510 }