2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.4)
\r
3 * Copyright (C) 2008 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
90 // ----------------/
\r
91 // - Constructors -/
\r
92 // ----------------/
\r
94 public AnnotationColours()
\r
105 public void deleteAboveThreshold()
\r
107 this._has_aboveThreshold = false;
\r
112 public void deleteMaxColour()
\r
114 this._has_maxColour = false;
\r
119 public void deleteMinColour()
\r
121 this._has_minColour = false;
\r
126 public void deleteThreshold()
\r
128 this._has_threshold = false;
\r
132 * Returns the value of field 'aboveThreshold'.
\r
134 * @return the value of field 'AboveThreshold'.
\r
136 public int getAboveThreshold()
\r
138 return this._aboveThreshold;
\r
142 * Returns the value of field 'annotation'.
\r
144 * @return the value of field 'Annotation'.
\r
146 public java.lang.String getAnnotation()
\r
148 return this._annotation;
\r
152 * Returns the value of field 'colourScheme'.
\r
154 * @return the value of field 'ColourScheme'.
\r
156 public java.lang.String getColourScheme()
\r
158 return this._colourScheme;
\r
162 * Returns the value of field 'maxColour'.
\r
164 * @return the value of field 'MaxColour'.
\r
166 public int getMaxColour()
\r
168 return this._maxColour;
\r
172 * Returns the value of field 'minColour'.
\r
174 * @return the value of field 'MinColour'.
\r
176 public int getMinColour()
\r
178 return this._minColour;
\r
182 * Returns the value of field 'threshold'.
\r
184 * @return the value of field 'Threshold'.
\r
186 public float getThreshold()
\r
188 return this._threshold;
\r
192 * Method hasAboveThreshold.
\r
194 * @return true if at least one AboveThreshold has been added
\r
196 public boolean hasAboveThreshold()
\r
198 return this._has_aboveThreshold;
\r
202 * Method hasMaxColour.
\r
204 * @return true if at least one MaxColour has been added
\r
206 public boolean hasMaxColour()
\r
208 return this._has_maxColour;
\r
212 * Method hasMinColour.
\r
214 * @return true if at least one MinColour has been added
\r
216 public boolean hasMinColour()
\r
218 return this._has_minColour;
\r
222 * Method hasThreshold.
\r
224 * @return true if at least one Threshold has been added
\r
226 public boolean hasThreshold()
\r
228 return this._has_threshold;
\r
234 * @return true if this object is valid according to the schema
\r
236 public boolean isValid()
\r
241 } catch (org.exolab.castor.xml.ValidationException vex)
\r
252 * @throws org.exolab.castor.xml.MarshalException
\r
253 * if object is null or if any SAXException is thrown during
\r
255 * @throws org.exolab.castor.xml.ValidationException
\r
256 * if this object is an invalid instance according to the
\r
259 public void marshal(final java.io.Writer out)
\r
260 throws org.exolab.castor.xml.MarshalException,
\r
261 org.exolab.castor.xml.ValidationException
\r
263 Marshaller.marshal(this, out);
\r
270 * @throws java.io.IOException
\r
271 * if an IOException occurs during marshaling
\r
272 * @throws org.exolab.castor.xml.ValidationException
\r
273 * if this object is an invalid instance according to the
\r
275 * @throws org.exolab.castor.xml.MarshalException
\r
276 * if object is null or if any SAXException is thrown during
\r
279 public void marshal(final org.xml.sax.ContentHandler handler)
\r
280 throws java.io.IOException,
\r
281 org.exolab.castor.xml.MarshalException,
\r
282 org.exolab.castor.xml.ValidationException
\r
284 Marshaller.marshal(this, handler);
\r
288 * Sets the value of field 'aboveThreshold'.
\r
290 * @param aboveThreshold
\r
291 * the value of field 'aboveThreshold'.
\r
293 public void setAboveThreshold(final int aboveThreshold)
\r
295 this._aboveThreshold = aboveThreshold;
\r
296 this._has_aboveThreshold = true;
\r
300 * Sets the value of field 'annotation'.
\r
302 * @param annotation
\r
303 * the value of field 'annotation'.
\r
305 public void setAnnotation(final java.lang.String annotation)
\r
307 this._annotation = annotation;
\r
311 * Sets the value of field 'colourScheme'.
\r
313 * @param colourScheme
\r
314 * the value of field 'colourScheme'.
\r
316 public void setColourScheme(final java.lang.String colourScheme)
\r
318 this._colourScheme = colourScheme;
\r
322 * Sets the value of field 'maxColour'.
\r
325 * the value of field 'maxColour'.
\r
327 public void setMaxColour(final int maxColour)
\r
329 this._maxColour = maxColour;
\r
330 this._has_maxColour = true;
\r
334 * Sets the value of field 'minColour'.
\r
337 * the value of field 'minColour'.
\r
339 public void setMinColour(final int minColour)
\r
341 this._minColour = minColour;
\r
342 this._has_minColour = true;
\r
346 * Sets the value of field 'threshold'.
\r
349 * the value of field 'threshold'.
\r
351 public void setThreshold(final float threshold)
\r
353 this._threshold = threshold;
\r
354 this._has_threshold = true;
\r
358 * Method unmarshal.
\r
361 * @throws org.exolab.castor.xml.MarshalException
\r
362 * if object is null or if any SAXException is thrown during
\r
364 * @throws org.exolab.castor.xml.ValidationException
\r
365 * if this object is an invalid instance according to the
\r
367 * @return the unmarshaled jalview.schemabinding.version2.AnnotationColours
\r
369 public static jalview.schemabinding.version2.AnnotationColours unmarshal(
\r
370 final java.io.Reader reader)
\r
371 throws org.exolab.castor.xml.MarshalException,
\r
372 org.exolab.castor.xml.ValidationException
\r
374 return (jalview.schemabinding.version2.AnnotationColours) Unmarshaller
\r
376 jalview.schemabinding.version2.AnnotationColours.class,
\r
383 * @throws org.exolab.castor.xml.ValidationException
\r
384 * if this object is an invalid instance according to the
\r
387 public void validate() throws org.exolab.castor.xml.ValidationException
\r
389 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
\r
390 validator.validate(this);
\r