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
5 * This file is part of Jalview.
\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
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
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
18 package jalview.schemabinding.version2;
\r
20 //---------------------------------/
\r
21 //- Imported classes and packages -/
\r
22 //---------------------------------/
\r
24 import org.exolab.castor.xml.Marshaller;
\r
25 import org.exolab.castor.xml.Unmarshaller;
\r
28 * Class AnnotationColours.
\r
30 * @version $Revision$ $Date$
\r
32 public class AnnotationColours implements java.io.Serializable
\r
35 // --------------------------/
\r
36 // - Class/Member Variables -/
\r
37 // --------------------------/
\r
40 * Field _aboveThreshold.
\r
42 private int _aboveThreshold;
\r
45 * keeps track of state for field: _aboveThreshold
\r
47 private boolean _has_aboveThreshold;
\r
50 * Field _annotation.
\r
52 private java.lang.String _annotation;
\r
57 private int _minColour;
\r
60 * keeps track of state for field: _minColour
\r
62 private boolean _has_minColour;
\r
67 private int _maxColour;
\r
70 * keeps track of state for field: _maxColour
\r
72 private boolean _has_maxColour;
\r
75 * Field _colourScheme.
\r
77 private java.lang.String _colourScheme;
\r
82 private float _threshold;
\r
85 * keeps track of state for field: _threshold
\r
87 private boolean _has_threshold;
\r
89 // ----------------/
\r
90 // - Constructors -/
\r
91 // ----------------/
\r
93 public AnnotationColours()
\r
104 public void deleteAboveThreshold()
\r
106 this._has_aboveThreshold = false;
\r
111 public void deleteMaxColour()
\r
113 this._has_maxColour = false;
\r
118 public void deleteMinColour()
\r
120 this._has_minColour = false;
\r
125 public void deleteThreshold()
\r
127 this._has_threshold = false;
\r
131 * Returns the value of field 'aboveThreshold'.
\r
133 * @return the value of field 'AboveThreshold'.
\r
135 public int getAboveThreshold()
\r
137 return this._aboveThreshold;
\r
141 * Returns the value of field 'annotation'.
\r
143 * @return the value of field 'Annotation'.
\r
145 public java.lang.String getAnnotation()
\r
147 return this._annotation;
\r
151 * Returns the value of field 'colourScheme'.
\r
153 * @return the value of field 'ColourScheme'.
\r
155 public java.lang.String getColourScheme()
\r
157 return this._colourScheme;
\r
161 * Returns the value of field 'maxColour'.
\r
163 * @return the value of field 'MaxColour'.
\r
165 public int getMaxColour()
\r
167 return this._maxColour;
\r
171 * Returns the value of field 'minColour'.
\r
173 * @return the value of field 'MinColour'.
\r
175 public int getMinColour()
\r
177 return this._minColour;
\r
181 * Returns the value of field 'threshold'.
\r
183 * @return the value of field 'Threshold'.
\r
185 public float getThreshold()
\r
187 return this._threshold;
\r
191 * Method hasAboveThreshold.
\r
193 * @return true if at least one AboveThreshold has been added
\r
195 public boolean hasAboveThreshold()
\r
197 return this._has_aboveThreshold;
\r
201 * Method hasMaxColour.
\r
203 * @return true if at least one MaxColour has been added
\r
205 public boolean hasMaxColour()
\r
207 return this._has_maxColour;
\r
211 * Method hasMinColour.
\r
213 * @return true if at least one MinColour has been added
\r
215 public boolean hasMinColour()
\r
217 return this._has_minColour;
\r
221 * Method hasThreshold.
\r
223 * @return true if at least one Threshold has been added
\r
225 public boolean hasThreshold()
\r
227 return this._has_threshold;
\r
233 * @return true if this object is valid according to the schema
\r
235 public boolean isValid()
\r
240 } catch (org.exolab.castor.xml.ValidationException vex)
\r
251 * @throws org.exolab.castor.xml.MarshalException
\r
252 * if object is null or if any SAXException is thrown during
\r
254 * @throws org.exolab.castor.xml.ValidationException
\r
255 * if this object is an invalid instance according to the schema
\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
261 Marshaller.marshal(this, out);
\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
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
281 Marshaller.marshal(this, handler);
\r
285 * Sets the value of field 'aboveThreshold'.
\r
287 * @param aboveThreshold
\r
288 * the value of field 'aboveThreshold'.
\r
290 public void setAboveThreshold(final int aboveThreshold)
\r
292 this._aboveThreshold = aboveThreshold;
\r
293 this._has_aboveThreshold = true;
\r
297 * Sets the value of field 'annotation'.
\r
299 * @param annotation
\r
300 * the value of field 'annotation'.
\r
302 public void setAnnotation(final java.lang.String annotation)
\r
304 this._annotation = annotation;
\r
308 * Sets the value of field 'colourScheme'.
\r
310 * @param colourScheme
\r
311 * the value of field 'colourScheme'.
\r
313 public void setColourScheme(final java.lang.String colourScheme)
\r
315 this._colourScheme = colourScheme;
\r
319 * Sets the value of field 'maxColour'.
\r
322 * the value of field 'maxColour'.
\r
324 public void setMaxColour(final int maxColour)
\r
326 this._maxColour = maxColour;
\r
327 this._has_maxColour = true;
\r
331 * Sets the value of field 'minColour'.
\r
334 * the value of field 'minColour'.
\r
336 public void setMinColour(final int minColour)
\r
338 this._minColour = minColour;
\r
339 this._has_minColour = true;
\r
343 * Sets the value of field 'threshold'.
\r
346 * the value of field 'threshold'.
\r
348 public void setThreshold(final float threshold)
\r
350 this._threshold = threshold;
\r
351 this._has_threshold = true;
\r
355 * Method unmarshal.
\r
358 * @throws org.exolab.castor.xml.MarshalException
\r
359 * if object is null or if any SAXException is thrown during
\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
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
370 return (jalview.schemabinding.version2.AnnotationColours) Unmarshaller
\r
372 jalview.schemabinding.version2.AnnotationColours.class,
\r
379 * @throws org.exolab.castor.xml.ValidationException
\r
380 * if this object is an invalid instance according to the schema
\r
382 public void validate() throws org.exolab.castor.xml.ValidationException
\r
384 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
\r
385 validator.validate(this);
\r