Merge branch 'Release_2_8_0b1_Branch' into try_r20b1_merge
[jalview.git] / src / jalview / schemabinding / version2 / AnnotationColours.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
20 package jalview.schemabinding.version2;
21
22   //---------------------------------/
23  //- Imported classes and packages -/
24 //---------------------------------/
25
26 import org.exolab.castor.xml.Marshaller;
27 import org.exolab.castor.xml.Unmarshaller;
28
29 /**
30  * Class AnnotationColours.
31  * 
32  * @version $Revision$ $Date$
33  */
34 public class AnnotationColours implements java.io.Serializable {
35
36
37       //--------------------------/
38      //- Class/Member Variables -/
39     //--------------------------/
40
41     /**
42      * Field _aboveThreshold.
43      */
44     private int _aboveThreshold;
45
46     /**
47      * keeps track of state for field: _aboveThreshold
48      */
49     private boolean _has_aboveThreshold;
50
51     /**
52      * Field _annotation.
53      */
54     private java.lang.String _annotation;
55
56     /**
57      * Field _minColour.
58      */
59     private int _minColour;
60
61     /**
62      * keeps track of state for field: _minColour
63      */
64     private boolean _has_minColour;
65
66     /**
67      * Field _maxColour.
68      */
69     private int _maxColour;
70
71     /**
72      * keeps track of state for field: _maxColour
73      */
74     private boolean _has_maxColour;
75
76     /**
77      * Field _colourScheme.
78      */
79     private java.lang.String _colourScheme;
80
81     /**
82      * Field _threshold.
83      */
84     private float _threshold;
85
86     /**
87      * keeps track of state for field: _threshold
88      */
89     private boolean _has_threshold;
90
91     /**
92      * Field _perSequence.
93      */
94     private boolean _perSequence;
95
96     /**
97      * keeps track of state for field: _perSequence
98      */
99     private boolean _has_perSequence;
100
101     /**
102      * Field _predefinedColours.
103      */
104     private boolean _predefinedColours;
105
106     /**
107      * keeps track of state for field: _predefinedColours
108      */
109     private boolean _has_predefinedColours;
110
111
112       //----------------/
113      //- Constructors -/
114     //----------------/
115
116     public AnnotationColours() {
117         super();
118     }
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             validate();
336         } catch (org.exolab.castor.xml.ValidationException vex) {
337             return false;
338         }
339         return true;
340     }
341
342     /**
343      * 
344      * 
345      * @param out
346      * @throws org.exolab.castor.xml.MarshalException if object is
347      * null or if any SAXException is thrown during marshaling
348      * @throws org.exolab.castor.xml.ValidationException if this
349      * object is an invalid instance according to the schema
350      */
351     public void marshal(
352             final java.io.Writer out)
353     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
354         Marshaller.marshal(this, out);
355     }
356
357     /**
358      * 
359      * 
360      * @param handler
361      * @throws java.io.IOException if an IOException occurs during
362      * marshaling
363      * @throws org.exolab.castor.xml.ValidationException if this
364      * object is an invalid instance according to the schema
365      * @throws org.exolab.castor.xml.MarshalException if object is
366      * null or if any SAXException is thrown during marshaling
367      */
368     public void marshal(
369             final org.xml.sax.ContentHandler handler)
370     throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
371         Marshaller.marshal(this, handler);
372     }
373
374     /**
375      * Sets the value of field 'aboveThreshold'.
376      * 
377      * @param aboveThreshold the value of field 'aboveThreshold'.
378      */
379     public void setAboveThreshold(
380             final int aboveThreshold) {
381         this._aboveThreshold = aboveThreshold;
382         this._has_aboveThreshold = true;
383     }
384
385     /**
386      * Sets the value of field 'annotation'.
387      * 
388      * @param annotation the value of field 'annotation'.
389      */
390     public void setAnnotation(
391             final java.lang.String annotation) {
392         this._annotation = annotation;
393     }
394
395     /**
396      * Sets the value of field 'colourScheme'.
397      * 
398      * @param colourScheme the value of field 'colourScheme'.
399      */
400     public void setColourScheme(
401             final java.lang.String colourScheme) {
402         this._colourScheme = colourScheme;
403     }
404
405     /**
406      * Sets the value of field 'maxColour'.
407      * 
408      * @param maxColour the value of field 'maxColour'.
409      */
410     public void setMaxColour(
411             final int maxColour) {
412         this._maxColour = maxColour;
413         this._has_maxColour = true;
414     }
415
416     /**
417      * Sets the value of field 'minColour'.
418      * 
419      * @param minColour the value of field 'minColour'.
420      */
421     public void setMinColour(
422             final int minColour) {
423         this._minColour = minColour;
424         this._has_minColour = true;
425     }
426
427     /**
428      * Sets the value of field 'perSequence'.
429      * 
430      * @param perSequence the value of field 'perSequence'.
431      */
432     public void setPerSequence(
433             final boolean perSequence) {
434         this._perSequence = perSequence;
435         this._has_perSequence = true;
436     }
437
438     /**
439      * Sets the value of field 'predefinedColours'.
440      * 
441      * @param predefinedColours the value of field
442      * 'predefinedColours'.
443      */
444     public void setPredefinedColours(
445             final boolean predefinedColours) {
446         this._predefinedColours = predefinedColours;
447         this._has_predefinedColours = true;
448     }
449
450     /**
451      * Sets the value of field 'threshold'.
452      * 
453      * @param threshold the value of field 'threshold'.
454      */
455     public void setThreshold(
456             final float threshold) {
457         this._threshold = threshold;
458         this._has_threshold = true;
459     }
460
461     /**
462      * Method unmarshal.
463      * 
464      * @param reader
465      * @throws org.exolab.castor.xml.MarshalException if object is
466      * null or if any SAXException is thrown during marshaling
467      * @throws org.exolab.castor.xml.ValidationException if this
468      * object is an invalid instance according to the schema
469      * @return the unmarshaled
470      * jalview.schemabinding.version2.AnnotationColours
471      */
472     public static jalview.schemabinding.version2.AnnotationColours unmarshal(
473             final java.io.Reader reader)
474     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
475         return (jalview.schemabinding.version2.AnnotationColours) Unmarshaller.unmarshal(jalview.schemabinding.version2.AnnotationColours.class, reader);
476     }
477
478     /**
479      * 
480      * 
481      * @throws org.exolab.castor.xml.ValidationException if this
482      * object is an invalid instance according to the schema
483      */
484     public void validate(
485     )
486     throws org.exolab.castor.xml.ValidationException {
487         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
488         validator.validate(this);
489     }
490
491 }