2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.4.1)
\r
3 * Copyright (C) 2009 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
\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
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
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
19 package jalview.schemabinding.version2;
\r
21 //---------------------------------/
\r
22 //- Imported classes and packages -/
\r
23 //---------------------------------/
\r
25 import org.exolab.castor.xml.Marshaller;
\r
26 import org.exolab.castor.xml.Unmarshaller;
\r
29 * Class AnnotationColours.
\r
31 * @version $Revision$ $Date$
\r
33 public class AnnotationColours implements java.io.Serializable {
\r
36 //--------------------------/
\r
37 //- Class/Member Variables -/
\r
38 //--------------------------/
\r
41 * Field _aboveThreshold.
\r
43 private int _aboveThreshold;
\r
46 * keeps track of state for field: _aboveThreshold
\r
48 private boolean _has_aboveThreshold;
\r
51 * Field _annotation.
\r
53 private java.lang.String _annotation;
\r
58 private int _minColour;
\r
61 * keeps track of state for field: _minColour
\r
63 private boolean _has_minColour;
\r
68 private int _maxColour;
\r
71 * keeps track of state for field: _maxColour
\r
73 private boolean _has_maxColour;
\r
76 * Field _colourScheme.
\r
78 private java.lang.String _colourScheme;
\r
83 private float _threshold;
\r
86 * keeps track of state for field: _threshold
\r
88 private boolean _has_threshold;
\r
95 public AnnotationColours() {
\r
106 public void deleteAboveThreshold(
\r
108 this._has_aboveThreshold= false;
\r
113 public void deleteMaxColour(
\r
115 this._has_maxColour= false;
\r
120 public void deleteMinColour(
\r
122 this._has_minColour= false;
\r
127 public void deleteThreshold(
\r
129 this._has_threshold= false;
\r
133 * Returns the value of field 'aboveThreshold'.
\r
135 * @return the value of field 'AboveThreshold'.
\r
137 public int getAboveThreshold(
\r
139 return this._aboveThreshold;
\r
143 * Returns the value of field 'annotation'.
\r
145 * @return the value of field 'Annotation'.
\r
147 public java.lang.String getAnnotation(
\r
149 return this._annotation;
\r
153 * Returns the value of field 'colourScheme'.
\r
155 * @return the value of field 'ColourScheme'.
\r
157 public java.lang.String getColourScheme(
\r
159 return this._colourScheme;
\r
163 * Returns the value of field 'maxColour'.
\r
165 * @return the value of field 'MaxColour'.
\r
167 public int getMaxColour(
\r
169 return this._maxColour;
\r
173 * Returns the value of field 'minColour'.
\r
175 * @return the value of field 'MinColour'.
\r
177 public int getMinColour(
\r
179 return this._minColour;
\r
183 * Returns the value of field 'threshold'.
\r
185 * @return the value of field 'Threshold'.
\r
187 public float getThreshold(
\r
189 return this._threshold;
\r
193 * Method hasAboveThreshold.
\r
195 * @return true if at least one AboveThreshold has been added
\r
197 public boolean hasAboveThreshold(
\r
199 return this._has_aboveThreshold;
\r
203 * Method hasMaxColour.
\r
205 * @return true if at least one MaxColour has been added
\r
207 public boolean hasMaxColour(
\r
209 return this._has_maxColour;
\r
213 * Method hasMinColour.
\r
215 * @return true if at least one MinColour has been added
\r
217 public boolean hasMinColour(
\r
219 return this._has_minColour;
\r
223 * Method hasThreshold.
\r
225 * @return true if at least one Threshold has been added
\r
227 public boolean hasThreshold(
\r
229 return this._has_threshold;
\r
235 * @return true if this object is valid according to the schema
\r
237 public boolean isValid(
\r
241 } catch (org.exolab.castor.xml.ValidationException vex) {
\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
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
266 * @throws java.io.IOException if an IOException occurs during
\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
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
280 * Sets the value of field 'aboveThreshold'.
\r
282 * @param aboveThreshold the value of field 'aboveThreshold'.
\r
284 public void setAboveThreshold(
\r
285 final int aboveThreshold) {
\r
286 this._aboveThreshold = aboveThreshold;
\r
287 this._has_aboveThreshold = true;
\r
291 * Sets the value of field 'annotation'.
\r
293 * @param annotation the value of field 'annotation'.
\r
295 public void setAnnotation(
\r
296 final java.lang.String annotation) {
\r
297 this._annotation = annotation;
\r
301 * Sets the value of field 'colourScheme'.
\r
303 * @param colourScheme the value of field 'colourScheme'.
\r
305 public void setColourScheme(
\r
306 final java.lang.String colourScheme) {
\r
307 this._colourScheme = colourScheme;
\r
311 * Sets the value of field 'maxColour'.
\r
313 * @param maxColour the value of field 'maxColour'.
\r
315 public void setMaxColour(
\r
316 final int maxColour) {
\r
317 this._maxColour = maxColour;
\r
318 this._has_maxColour = true;
\r
322 * Sets the value of field 'minColour'.
\r
324 * @param minColour the value of field 'minColour'.
\r
326 public void setMinColour(
\r
327 final int minColour) {
\r
328 this._minColour = minColour;
\r
329 this._has_minColour = true;
\r
333 * Sets the value of field 'threshold'.
\r
335 * @param threshold the value of field 'threshold'.
\r
337 public void setThreshold(
\r
338 final float threshold) {
\r
339 this._threshold = threshold;
\r
340 this._has_threshold = true;
\r
344 * Method unmarshal.
\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
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
363 * @throws org.exolab.castor.xml.ValidationException if this
\r
364 * object is an invalid instance according to the schema
\r
366 public void validate(
\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