apply gpl development license
[jalview.git] / src / jalview / schemabinding / version2 / Setting.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 Setting.\r
30  * \r
31  * @version $Revision$ $Date$\r
32  */\r
33 public class Setting implements java.io.Serializable {\r
34 \r
35 \r
36       //--------------------------/\r
37      //- Class/Member Variables -/\r
38     //--------------------------/\r
39 \r
40     /**\r
41      * Field _type.\r
42      */\r
43     private java.lang.String _type;\r
44 \r
45     /**\r
46      * Field _colour.\r
47      */\r
48     private int _colour;\r
49 \r
50     /**\r
51      * keeps track of state for field: _colour\r
52      */\r
53     private boolean _has_colour;\r
54 \r
55     /**\r
56      * Field _display.\r
57      */\r
58     private boolean _display;\r
59 \r
60     /**\r
61      * keeps track of state for field: _display\r
62      */\r
63     private boolean _has_display;\r
64 \r
65     /**\r
66      * Field _order.\r
67      */\r
68     private float _order;\r
69 \r
70     /**\r
71      * keeps track of state for field: _order\r
72      */\r
73     private boolean _has_order;\r
74 \r
75     /**\r
76      * Optional minimum colour for graduated feature colour\r
77      */\r
78     private int _mincolour;\r
79 \r
80     /**\r
81      * keeps track of state for field: _mincolour\r
82      */\r
83     private boolean _has_mincolour;\r
84 \r
85     /**\r
86      * threshold value for graduated feature colour\r
87      */\r
88     private float _threshold;\r
89 \r
90     /**\r
91      * keeps track of state for field: _threshold\r
92      */\r
93     private boolean _has_threshold;\r
94 \r
95     /**\r
96      * threshold type for graduated feature colour\r
97      */\r
98     private int _threshstate;\r
99 \r
100     /**\r
101      * keeps track of state for field: _threshstate\r
102      */\r
103     private boolean _has_threshstate;\r
104 \r
105 \r
106       //----------------/\r
107      //- Constructors -/\r
108     //----------------/\r
109 \r
110     public Setting() {\r
111         super();\r
112     }\r
113 \r
114 \r
115       //-----------/\r
116      //- Methods -/\r
117     //-----------/\r
118 \r
119     /**\r
120      */\r
121     public void deleteColour(\r
122     ) {\r
123         this._has_colour= false;\r
124     }\r
125 \r
126     /**\r
127      */\r
128     public void deleteDisplay(\r
129     ) {\r
130         this._has_display= false;\r
131     }\r
132 \r
133     /**\r
134      */\r
135     public void deleteMincolour(\r
136     ) {\r
137         this._has_mincolour= false;\r
138     }\r
139 \r
140     /**\r
141      */\r
142     public void deleteOrder(\r
143     ) {\r
144         this._has_order= false;\r
145     }\r
146 \r
147     /**\r
148      */\r
149     public void deleteThreshold(\r
150     ) {\r
151         this._has_threshold= false;\r
152     }\r
153 \r
154     /**\r
155      */\r
156     public void deleteThreshstate(\r
157     ) {\r
158         this._has_threshstate= false;\r
159     }\r
160 \r
161     /**\r
162      * Returns the value of field 'colour'.\r
163      * \r
164      * @return the value of field 'Colour'.\r
165      */\r
166     public int getColour(\r
167     ) {\r
168         return this._colour;\r
169     }\r
170 \r
171     /**\r
172      * Returns the value of field 'display'.\r
173      * \r
174      * @return the value of field 'Display'.\r
175      */\r
176     public boolean getDisplay(\r
177     ) {\r
178         return this._display;\r
179     }\r
180 \r
181     /**\r
182      * Returns the value of field 'mincolour'. The field\r
183      * 'mincolour' has the following description: Optional minimum\r
184      * colour for graduated feature colour\r
185      * \r
186      * @return the value of field 'Mincolour'.\r
187      */\r
188     public int getMincolour(\r
189     ) {\r
190         return this._mincolour;\r
191     }\r
192 \r
193     /**\r
194      * Returns the value of field 'order'.\r
195      * \r
196      * @return the value of field 'Order'.\r
197      */\r
198     public float getOrder(\r
199     ) {\r
200         return this._order;\r
201     }\r
202 \r
203     /**\r
204      * Returns the value of field 'threshold'. The field\r
205      * 'threshold' has the following description: threshold value\r
206      * for graduated feature colour\r
207      * \r
208      * @return the value of field 'Threshold'.\r
209      */\r
210     public float getThreshold(\r
211     ) {\r
212         return this._threshold;\r
213     }\r
214 \r
215     /**\r
216      * Returns the value of field 'threshstate'. The field\r
217      * 'threshstate' has the following description: threshold type\r
218      * for graduated feature colour\r
219      * \r
220      * @return the value of field 'Threshstate'.\r
221      */\r
222     public int getThreshstate(\r
223     ) {\r
224         return this._threshstate;\r
225     }\r
226 \r
227     /**\r
228      * Returns the value of field 'type'.\r
229      * \r
230      * @return the value of field 'Type'.\r
231      */\r
232     public java.lang.String getType(\r
233     ) {\r
234         return this._type;\r
235     }\r
236 \r
237     /**\r
238      * Method hasColour.\r
239      * \r
240      * @return true if at least one Colour has been added\r
241      */\r
242     public boolean hasColour(\r
243     ) {\r
244         return this._has_colour;\r
245     }\r
246 \r
247     /**\r
248      * Method hasDisplay.\r
249      * \r
250      * @return true if at least one Display has been added\r
251      */\r
252     public boolean hasDisplay(\r
253     ) {\r
254         return this._has_display;\r
255     }\r
256 \r
257     /**\r
258      * Method hasMincolour.\r
259      * \r
260      * @return true if at least one Mincolour has been added\r
261      */\r
262     public boolean hasMincolour(\r
263     ) {\r
264         return this._has_mincolour;\r
265     }\r
266 \r
267     /**\r
268      * Method hasOrder.\r
269      * \r
270      * @return true if at least one Order has been added\r
271      */\r
272     public boolean hasOrder(\r
273     ) {\r
274         return this._has_order;\r
275     }\r
276 \r
277     /**\r
278      * Method hasThreshold.\r
279      * \r
280      * @return true if at least one Threshold has been added\r
281      */\r
282     public boolean hasThreshold(\r
283     ) {\r
284         return this._has_threshold;\r
285     }\r
286 \r
287     /**\r
288      * Method hasThreshstate.\r
289      * \r
290      * @return true if at least one Threshstate has been added\r
291      */\r
292     public boolean hasThreshstate(\r
293     ) {\r
294         return this._has_threshstate;\r
295     }\r
296 \r
297     /**\r
298      * Returns the value of field 'display'.\r
299      * \r
300      * @return the value of field 'Display'.\r
301      */\r
302     public boolean isDisplay(\r
303     ) {\r
304         return this._display;\r
305     }\r
306 \r
307     /**\r
308      * Method isValid.\r
309      * \r
310      * @return true if this object is valid according to the schema\r
311      */\r
312     public boolean isValid(\r
313     ) {\r
314         try {\r
315             validate();\r
316         } catch (org.exolab.castor.xml.ValidationException vex) {\r
317             return false;\r
318         }\r
319         return true;\r
320     }\r
321 \r
322     /**\r
323      * \r
324      * \r
325      * @param out\r
326      * @throws org.exolab.castor.xml.MarshalException if object is\r
327      * null or if any SAXException is thrown during marshaling\r
328      * @throws org.exolab.castor.xml.ValidationException if this\r
329      * object is an invalid instance according to the schema\r
330      */\r
331     public void marshal(\r
332             final java.io.Writer out)\r
333     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {\r
334         Marshaller.marshal(this, out);\r
335     }\r
336 \r
337     /**\r
338      * \r
339      * \r
340      * @param handler\r
341      * @throws java.io.IOException if an IOException occurs during\r
342      * marshaling\r
343      * @throws org.exolab.castor.xml.ValidationException if this\r
344      * object is an invalid instance according to the schema\r
345      * @throws org.exolab.castor.xml.MarshalException if object is\r
346      * null or if any SAXException is thrown during marshaling\r
347      */\r
348     public void marshal(\r
349             final org.xml.sax.ContentHandler handler)\r
350     throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {\r
351         Marshaller.marshal(this, handler);\r
352     }\r
353 \r
354     /**\r
355      * Sets the value of field 'colour'.\r
356      * \r
357      * @param colour the value of field 'colour'.\r
358      */\r
359     public void setColour(\r
360             final int colour) {\r
361         this._colour = colour;\r
362         this._has_colour = true;\r
363     }\r
364 \r
365     /**\r
366      * Sets the value of field 'display'.\r
367      * \r
368      * @param display the value of field 'display'.\r
369      */\r
370     public void setDisplay(\r
371             final boolean display) {\r
372         this._display = display;\r
373         this._has_display = true;\r
374     }\r
375 \r
376     /**\r
377      * Sets the value of field 'mincolour'. The field 'mincolour'\r
378      * has the following description: Optional minimum colour for\r
379      * graduated feature colour\r
380      * \r
381      * @param mincolour the value of field 'mincolour'.\r
382      */\r
383     public void setMincolour(\r
384             final int mincolour) {\r
385         this._mincolour = mincolour;\r
386         this._has_mincolour = true;\r
387     }\r
388 \r
389     /**\r
390      * Sets the value of field 'order'.\r
391      * \r
392      * @param order the value of field 'order'.\r
393      */\r
394     public void setOrder(\r
395             final float order) {\r
396         this._order = order;\r
397         this._has_order = true;\r
398     }\r
399 \r
400     /**\r
401      * Sets the value of field 'threshold'. The field 'threshold'\r
402      * has the following description: threshold value for graduated\r
403      * feature colour\r
404      * \r
405      * @param threshold the value of field 'threshold'.\r
406      */\r
407     public void setThreshold(\r
408             final float threshold) {\r
409         this._threshold = threshold;\r
410         this._has_threshold = true;\r
411     }\r
412 \r
413     /**\r
414      * Sets the value of field 'threshstate'. The field\r
415      * 'threshstate' has the following description: threshold type\r
416      * for graduated feature colour\r
417      * \r
418      * @param threshstate the value of field 'threshstate'.\r
419      */\r
420     public void setThreshstate(\r
421             final int threshstate) {\r
422         this._threshstate = threshstate;\r
423         this._has_threshstate = true;\r
424     }\r
425 \r
426     /**\r
427      * Sets the value of field 'type'.\r
428      * \r
429      * @param type the value of field 'type'.\r
430      */\r
431     public void setType(\r
432             final java.lang.String type) {\r
433         this._type = type;\r
434     }\r
435 \r
436     /**\r
437      * Method unmarshal.\r
438      * \r
439      * @param reader\r
440      * @throws org.exolab.castor.xml.MarshalException if object is\r
441      * null or if any SAXException is thrown during marshaling\r
442      * @throws org.exolab.castor.xml.ValidationException if this\r
443      * object is an invalid instance according to the schema\r
444      * @return the unmarshaled jalview.schemabinding.version2.Settin\r
445      */\r
446     public static jalview.schemabinding.version2.Setting unmarshal(\r
447             final java.io.Reader reader)\r
448     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {\r
449         return (jalview.schemabinding.version2.Setting) Unmarshaller.unmarshal(jalview.schemabinding.version2.Setting.class, reader);\r
450     }\r
451 \r
452     /**\r
453      * \r
454      * \r
455      * @throws org.exolab.castor.xml.ValidationException if this\r
456      * object is an invalid instance according to the schema\r
457      */\r
458     public void validate(\r
459     )\r
460     throws org.exolab.castor.xml.ValidationException {\r
461         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();\r
462         validator.validate(this);\r
463     }\r
464 \r
465 }\r