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