JAL-1432 updated copyright notices
[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 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 AnnotationColours.
30  * 
31  * @version $Revision$ $Date$
32  */
33 public class AnnotationColours implements java.io.Serializable
34 {
35
36   // --------------------------/
37   // - Class/Member Variables -/
38   // --------------------------/
39
40   /**
41    * Field _aboveThreshold.
42    */
43   private int _aboveThreshold;
44
45   /**
46    * keeps track of state for field: _aboveThreshold
47    */
48   private boolean _has_aboveThreshold;
49
50   /**
51    * Field _annotation.
52    */
53   private java.lang.String _annotation;
54
55   /**
56    * Field _minColour.
57    */
58   private int _minColour;
59
60   /**
61    * keeps track of state for field: _minColour
62    */
63   private boolean _has_minColour;
64
65   /**
66    * Field _maxColour.
67    */
68   private int _maxColour;
69
70   /**
71    * keeps track of state for field: _maxColour
72    */
73   private boolean _has_maxColour;
74
75   /**
76    * Field _colourScheme.
77    */
78   private java.lang.String _colourScheme;
79
80   /**
81    * Field _threshold.
82    */
83   private float _threshold;
84
85   /**
86    * keeps track of state for field: _threshold
87    */
88   private boolean _has_threshold;
89
90   // ----------------/
91   // - Constructors -/
92   // ----------------/
93
94   public AnnotationColours()
95   {
96     super();
97   }
98
99   // -----------/
100   // - Methods -/
101   // -----------/
102
103   /**
104      */
105   public void deleteAboveThreshold()
106   {
107     this._has_aboveThreshold = false;
108   }
109
110   /**
111      */
112   public void deleteMaxColour()
113   {
114     this._has_maxColour = false;
115   }
116
117   /**
118      */
119   public void deleteMinColour()
120   {
121     this._has_minColour = false;
122   }
123
124   /**
125      */
126   public void deleteThreshold()
127   {
128     this._has_threshold = false;
129   }
130
131   /**
132    * Returns the value of field 'aboveThreshold'.
133    * 
134    * @return the value of field 'AboveThreshold'.
135    */
136   public int getAboveThreshold()
137   {
138     return this._aboveThreshold;
139   }
140
141   /**
142    * Returns the value of field 'annotation'.
143    * 
144    * @return the value of field 'Annotation'.
145    */
146   public java.lang.String getAnnotation()
147   {
148     return this._annotation;
149   }
150
151   /**
152    * Returns the value of field 'colourScheme'.
153    * 
154    * @return the value of field 'ColourScheme'.
155    */
156   public java.lang.String getColourScheme()
157   {
158     return this._colourScheme;
159   }
160
161   /**
162    * Returns the value of field 'maxColour'.
163    * 
164    * @return the value of field 'MaxColour'.
165    */
166   public int getMaxColour()
167   {
168     return this._maxColour;
169   }
170
171   /**
172    * Returns the value of field 'minColour'.
173    * 
174    * @return the value of field 'MinColour'.
175    */
176   public int getMinColour()
177   {
178     return this._minColour;
179   }
180
181   /**
182    * Returns the value of field 'threshold'.
183    * 
184    * @return the value of field 'Threshold'.
185    */
186   public float getThreshold()
187   {
188     return this._threshold;
189   }
190
191   /**
192    * Method hasAboveThreshold.
193    * 
194    * @return true if at least one AboveThreshold has been added
195    */
196   public boolean hasAboveThreshold()
197   {
198     return this._has_aboveThreshold;
199   }
200
201   /**
202    * Method hasMaxColour.
203    * 
204    * @return true if at least one MaxColour has been added
205    */
206   public boolean hasMaxColour()
207   {
208     return this._has_maxColour;
209   }
210
211   /**
212    * Method hasMinColour.
213    * 
214    * @return true if at least one MinColour has been added
215    */
216   public boolean hasMinColour()
217   {
218     return this._has_minColour;
219   }
220
221   /**
222    * Method hasThreshold.
223    * 
224    * @return true if at least one Threshold has been added
225    */
226   public boolean hasThreshold()
227   {
228     return this._has_threshold;
229   }
230
231   /**
232    * Method isValid.
233    * 
234    * @return true if this object is valid according to the schema
235    */
236   public boolean isValid()
237   {
238     try
239     {
240       validate();
241     } catch (org.exolab.castor.xml.ValidationException vex)
242     {
243       return false;
244     }
245     return true;
246   }
247
248   /**
249    * 
250    * 
251    * @param out
252    * @throws org.exolab.castor.xml.MarshalException
253    *           if object is null or if any SAXException is thrown during
254    *           marshaling
255    * @throws org.exolab.castor.xml.ValidationException
256    *           if this object is an invalid instance according to the schema
257    */
258   public void marshal(final java.io.Writer out)
259           throws org.exolab.castor.xml.MarshalException,
260           org.exolab.castor.xml.ValidationException
261   {
262     Marshaller.marshal(this, out);
263   }
264
265   /**
266    * 
267    * 
268    * @param handler
269    * @throws java.io.IOException
270    *           if an IOException occurs during marshaling
271    * @throws org.exolab.castor.xml.ValidationException
272    *           if this object is an invalid instance according to the schema
273    * @throws org.exolab.castor.xml.MarshalException
274    *           if object is null or if any SAXException is thrown during
275    *           marshaling
276    */
277   public void marshal(final org.xml.sax.ContentHandler handler)
278           throws java.io.IOException,
279           org.exolab.castor.xml.MarshalException,
280           org.exolab.castor.xml.ValidationException
281   {
282     Marshaller.marshal(this, handler);
283   }
284
285   /**
286    * Sets the value of field 'aboveThreshold'.
287    * 
288    * @param aboveThreshold
289    *          the value of field 'aboveThreshold'.
290    */
291   public void setAboveThreshold(final int aboveThreshold)
292   {
293     this._aboveThreshold = aboveThreshold;
294     this._has_aboveThreshold = true;
295   }
296
297   /**
298    * Sets the value of field 'annotation'.
299    * 
300    * @param annotation
301    *          the value of field 'annotation'.
302    */
303   public void setAnnotation(final java.lang.String annotation)
304   {
305     this._annotation = annotation;
306   }
307
308   /**
309    * Sets the value of field 'colourScheme'.
310    * 
311    * @param colourScheme
312    *          the value of field 'colourScheme'.
313    */
314   public void setColourScheme(final java.lang.String colourScheme)
315   {
316     this._colourScheme = colourScheme;
317   }
318
319   /**
320    * Sets the value of field 'maxColour'.
321    * 
322    * @param maxColour
323    *          the value of field 'maxColour'.
324    */
325   public void setMaxColour(final int maxColour)
326   {
327     this._maxColour = maxColour;
328     this._has_maxColour = true;
329   }
330
331   /**
332    * Sets the value of field 'minColour'.
333    * 
334    * @param minColour
335    *          the value of field 'minColour'.
336    */
337   public void setMinColour(final int minColour)
338   {
339     this._minColour = minColour;
340     this._has_minColour = true;
341   }
342
343   /**
344    * Sets the value of field 'threshold'.
345    * 
346    * @param threshold
347    *          the value of field 'threshold'.
348    */
349   public void setThreshold(final float threshold)
350   {
351     this._threshold = threshold;
352     this._has_threshold = true;
353   }
354
355   /**
356    * Method unmarshal.
357    * 
358    * @param reader
359    * @throws org.exolab.castor.xml.MarshalException
360    *           if object is null or if any SAXException is thrown during
361    *           marshaling
362    * @throws org.exolab.castor.xml.ValidationException
363    *           if this object is an invalid instance according to the schema
364    * @return the unmarshaled jalview.schemabinding.version2.AnnotationColours
365    */
366   public static jalview.schemabinding.version2.AnnotationColours unmarshal(
367           final java.io.Reader reader)
368           throws org.exolab.castor.xml.MarshalException,
369           org.exolab.castor.xml.ValidationException
370   {
371     return (jalview.schemabinding.version2.AnnotationColours) Unmarshaller
372             .unmarshal(
373                     jalview.schemabinding.version2.AnnotationColours.class,
374                     reader);
375   }
376
377   /**
378    * 
379    * 
380    * @throws org.exolab.castor.xml.ValidationException
381    *           if this object is an invalid instance according to the schema
382    */
383   public void validate() throws org.exolab.castor.xml.ValidationException
384   {
385     org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
386     validator.validate(this);
387   }
388
389 }