Jalview 2.6 source licence
[jalview.git] / src / jalview / schemabinding / version2 / AnnotationColours.java
1 /*\r
2  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.6)\r
3  * Copyright (C) 2010 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
4  * \r
5  * This file is part of Jalview.\r
6  * \r
7  * Jalview is free software: you can redistribute it and/or\r
8  * modify it under the terms of the GNU General Public License \r
9  * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.\r
10  * \r
11  * Jalview is distributed in the hope that it will be useful, but \r
12  * WITHOUT ANY WARRANTY; without even the implied warranty \r
13  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR \r
14  * PURPOSE.  See the GNU General Public License for more details.\r
15  * \r
16  * You should have received a copy of the GNU General Public License along with Jalview.  If not, see <http://www.gnu.org/licenses/>.\r
17  */\r
18 package jalview.schemabinding.version2;\r
19 \r
20 //---------------------------------/\r
21 //- Imported classes and packages -/\r
22 //---------------------------------/\r
23 \r
24 import org.exolab.castor.xml.Marshaller;\r
25 import org.exolab.castor.xml.Unmarshaller;\r
26 \r
27 /**\r
28  * Class AnnotationColours.\r
29  * \r
30  * @version $Revision$ $Date$\r
31  */\r
32 public class AnnotationColours implements java.io.Serializable\r
33 {\r
34 \r
35   // --------------------------/\r
36   // - Class/Member Variables -/\r
37   // --------------------------/\r
38 \r
39   /**\r
40    * Field _aboveThreshold.\r
41    */\r
42   private int _aboveThreshold;\r
43 \r
44   /**\r
45    * keeps track of state for field: _aboveThreshold\r
46    */\r
47   private boolean _has_aboveThreshold;\r
48 \r
49   /**\r
50    * Field _annotation.\r
51    */\r
52   private java.lang.String _annotation;\r
53 \r
54   /**\r
55    * Field _minColour.\r
56    */\r
57   private int _minColour;\r
58 \r
59   /**\r
60    * keeps track of state for field: _minColour\r
61    */\r
62   private boolean _has_minColour;\r
63 \r
64   /**\r
65    * Field _maxColour.\r
66    */\r
67   private int _maxColour;\r
68 \r
69   /**\r
70    * keeps track of state for field: _maxColour\r
71    */\r
72   private boolean _has_maxColour;\r
73 \r
74   /**\r
75    * Field _colourScheme.\r
76    */\r
77   private java.lang.String _colourScheme;\r
78 \r
79   /**\r
80    * Field _threshold.\r
81    */\r
82   private float _threshold;\r
83 \r
84   /**\r
85    * keeps track of state for field: _threshold\r
86    */\r
87   private boolean _has_threshold;\r
88 \r
89   // ----------------/\r
90   // - Constructors -/\r
91   // ----------------/\r
92 \r
93   public AnnotationColours()\r
94   {\r
95     super();\r
96   }\r
97 \r
98   // -----------/\r
99   // - Methods -/\r
100   // -----------/\r
101 \r
102   /**\r
103      */\r
104   public void deleteAboveThreshold()\r
105   {\r
106     this._has_aboveThreshold = false;\r
107   }\r
108 \r
109   /**\r
110      */\r
111   public void deleteMaxColour()\r
112   {\r
113     this._has_maxColour = false;\r
114   }\r
115 \r
116   /**\r
117      */\r
118   public void deleteMinColour()\r
119   {\r
120     this._has_minColour = false;\r
121   }\r
122 \r
123   /**\r
124      */\r
125   public void deleteThreshold()\r
126   {\r
127     this._has_threshold = false;\r
128   }\r
129 \r
130   /**\r
131    * Returns the value of field 'aboveThreshold'.\r
132    * \r
133    * @return the value of field 'AboveThreshold'.\r
134    */\r
135   public int getAboveThreshold()\r
136   {\r
137     return this._aboveThreshold;\r
138   }\r
139 \r
140   /**\r
141    * Returns the value of field 'annotation'.\r
142    * \r
143    * @return the value of field 'Annotation'.\r
144    */\r
145   public java.lang.String getAnnotation()\r
146   {\r
147     return this._annotation;\r
148   }\r
149 \r
150   /**\r
151    * Returns the value of field 'colourScheme'.\r
152    * \r
153    * @return the value of field 'ColourScheme'.\r
154    */\r
155   public java.lang.String getColourScheme()\r
156   {\r
157     return this._colourScheme;\r
158   }\r
159 \r
160   /**\r
161    * Returns the value of field 'maxColour'.\r
162    * \r
163    * @return the value of field 'MaxColour'.\r
164    */\r
165   public int getMaxColour()\r
166   {\r
167     return this._maxColour;\r
168   }\r
169 \r
170   /**\r
171    * Returns the value of field 'minColour'.\r
172    * \r
173    * @return the value of field 'MinColour'.\r
174    */\r
175   public int getMinColour()\r
176   {\r
177     return this._minColour;\r
178   }\r
179 \r
180   /**\r
181    * Returns the value of field 'threshold'.\r
182    * \r
183    * @return the value of field 'Threshold'.\r
184    */\r
185   public float getThreshold()\r
186   {\r
187     return this._threshold;\r
188   }\r
189 \r
190   /**\r
191    * Method hasAboveThreshold.\r
192    * \r
193    * @return true if at least one AboveThreshold has been added\r
194    */\r
195   public boolean hasAboveThreshold()\r
196   {\r
197     return this._has_aboveThreshold;\r
198   }\r
199 \r
200   /**\r
201    * Method hasMaxColour.\r
202    * \r
203    * @return true if at least one MaxColour has been added\r
204    */\r
205   public boolean hasMaxColour()\r
206   {\r
207     return this._has_maxColour;\r
208   }\r
209 \r
210   /**\r
211    * Method hasMinColour.\r
212    * \r
213    * @return true if at least one MinColour has been added\r
214    */\r
215   public boolean hasMinColour()\r
216   {\r
217     return this._has_minColour;\r
218   }\r
219 \r
220   /**\r
221    * Method hasThreshold.\r
222    * \r
223    * @return true if at least one Threshold has been added\r
224    */\r
225   public boolean hasThreshold()\r
226   {\r
227     return this._has_threshold;\r
228   }\r
229 \r
230   /**\r
231    * Method isValid.\r
232    * \r
233    * @return true if this object is valid according to the schema\r
234    */\r
235   public boolean isValid()\r
236   {\r
237     try\r
238     {\r
239       validate();\r
240     } catch (org.exolab.castor.xml.ValidationException vex)\r
241     {\r
242       return false;\r
243     }\r
244     return true;\r
245   }\r
246 \r
247   /**\r
248    * \r
249    * \r
250    * @param out\r
251    * @throws org.exolab.castor.xml.MarshalException\r
252    *           if object is null or if any SAXException is thrown during\r
253    *           marshaling\r
254    * @throws org.exolab.castor.xml.ValidationException\r
255    *           if this object is an invalid instance according to the schema\r
256    */\r
257   public void marshal(final java.io.Writer out)\r
258           throws org.exolab.castor.xml.MarshalException,\r
259           org.exolab.castor.xml.ValidationException\r
260   {\r
261     Marshaller.marshal(this, out);\r
262   }\r
263 \r
264   /**\r
265    * \r
266    * \r
267    * @param handler\r
268    * @throws java.io.IOException\r
269    *           if an IOException occurs during marshaling\r
270    * @throws org.exolab.castor.xml.ValidationException\r
271    *           if this object is an invalid instance according to the schema\r
272    * @throws org.exolab.castor.xml.MarshalException\r
273    *           if object is null or if any SAXException is thrown during\r
274    *           marshaling\r
275    */\r
276   public void marshal(final org.xml.sax.ContentHandler handler)\r
277           throws java.io.IOException,\r
278           org.exolab.castor.xml.MarshalException,\r
279           org.exolab.castor.xml.ValidationException\r
280   {\r
281     Marshaller.marshal(this, handler);\r
282   }\r
283 \r
284   /**\r
285    * Sets the value of field 'aboveThreshold'.\r
286    * \r
287    * @param aboveThreshold\r
288    *          the value of field 'aboveThreshold'.\r
289    */\r
290   public void setAboveThreshold(final int aboveThreshold)\r
291   {\r
292     this._aboveThreshold = aboveThreshold;\r
293     this._has_aboveThreshold = true;\r
294   }\r
295 \r
296   /**\r
297    * Sets the value of field 'annotation'.\r
298    * \r
299    * @param annotation\r
300    *          the value of field 'annotation'.\r
301    */\r
302   public void setAnnotation(final java.lang.String annotation)\r
303   {\r
304     this._annotation = annotation;\r
305   }\r
306 \r
307   /**\r
308    * Sets the value of field 'colourScheme'.\r
309    * \r
310    * @param colourScheme\r
311    *          the value of field 'colourScheme'.\r
312    */\r
313   public void setColourScheme(final java.lang.String colourScheme)\r
314   {\r
315     this._colourScheme = colourScheme;\r
316   }\r
317 \r
318   /**\r
319    * Sets the value of field 'maxColour'.\r
320    * \r
321    * @param maxColour\r
322    *          the value of field 'maxColour'.\r
323    */\r
324   public void setMaxColour(final int maxColour)\r
325   {\r
326     this._maxColour = maxColour;\r
327     this._has_maxColour = true;\r
328   }\r
329 \r
330   /**\r
331    * Sets the value of field 'minColour'.\r
332    * \r
333    * @param minColour\r
334    *          the value of field 'minColour'.\r
335    */\r
336   public void setMinColour(final int minColour)\r
337   {\r
338     this._minColour = minColour;\r
339     this._has_minColour = true;\r
340   }\r
341 \r
342   /**\r
343    * Sets the value of field 'threshold'.\r
344    * \r
345    * @param threshold\r
346    *          the value of field 'threshold'.\r
347    */\r
348   public void setThreshold(final float threshold)\r
349   {\r
350     this._threshold = threshold;\r
351     this._has_threshold = true;\r
352   }\r
353 \r
354   /**\r
355    * Method unmarshal.\r
356    * \r
357    * @param reader\r
358    * @throws org.exolab.castor.xml.MarshalException\r
359    *           if object is null or if any SAXException is thrown during\r
360    *           marshaling\r
361    * @throws org.exolab.castor.xml.ValidationException\r
362    *           if this object is an invalid instance according to the schema\r
363    * @return the unmarshaled jalview.schemabinding.version2.AnnotationColours\r
364    */\r
365   public static jalview.schemabinding.version2.AnnotationColours unmarshal(\r
366           final java.io.Reader reader)\r
367           throws org.exolab.castor.xml.MarshalException,\r
368           org.exolab.castor.xml.ValidationException\r
369   {\r
370     return (jalview.schemabinding.version2.AnnotationColours) Unmarshaller\r
371             .unmarshal(\r
372                     jalview.schemabinding.version2.AnnotationColours.class,\r
373                     reader);\r
374   }\r
375 \r
376   /**\r
377    * \r
378    * \r
379    * @throws org.exolab.castor.xml.ValidationException\r
380    *           if this object is an invalid instance according to the schema\r
381    */\r
382   public void validate() throws org.exolab.castor.xml.ValidationException\r
383   {\r
384     org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();\r
385     validator.validate(this);\r
386   }\r
387 \r
388 }\r