2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8)
3 * Copyright (C) 2012 J Procter, AM Waterhouse, LM Lui, J Engelhardt, G Barton, M Clamp, S Searle
5 * This file is part of Jalview.
7 * Jalview is free software: you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
11 * Jalview is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty
13 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 * PURPOSE. See the GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License along with Jalview. If not, see <http://www.gnu.org/licenses/>.
18 package jalview.schemabinding.version2;
20 //---------------------------------/
21 //- Imported classes and packages -/
22 //---------------------------------/
24 import org.exolab.castor.xml.Marshaller;
25 import org.exolab.castor.xml.Unmarshaller;
28 * Class AnnotationColours.
30 * @version $Revision$ $Date$
32 public class AnnotationColours implements java.io.Serializable
35 // --------------------------/
36 // - Class/Member Variables -/
37 // --------------------------/
40 * Field _aboveThreshold.
42 private int _aboveThreshold;
45 * keeps track of state for field: _aboveThreshold
47 private boolean _has_aboveThreshold;
52 private java.lang.String _annotation;
57 private int _minColour;
60 * keeps track of state for field: _minColour
62 private boolean _has_minColour;
67 private int _maxColour;
70 * keeps track of state for field: _maxColour
72 private boolean _has_maxColour;
75 * Field _colourScheme.
77 private java.lang.String _colourScheme;
82 private float _threshold;
85 * keeps track of state for field: _threshold
87 private boolean _has_threshold;
93 public AnnotationColours()
104 public void deleteAboveThreshold()
106 this._has_aboveThreshold = false;
111 public void deleteMaxColour()
113 this._has_maxColour = false;
118 public void deleteMinColour()
120 this._has_minColour = false;
125 public void deleteThreshold()
127 this._has_threshold = false;
131 * Returns the value of field 'aboveThreshold'.
133 * @return the value of field 'AboveThreshold'.
135 public int getAboveThreshold()
137 return this._aboveThreshold;
141 * Returns the value of field 'annotation'.
143 * @return the value of field 'Annotation'.
145 public java.lang.String getAnnotation()
147 return this._annotation;
151 * Returns the value of field 'colourScheme'.
153 * @return the value of field 'ColourScheme'.
155 public java.lang.String getColourScheme()
157 return this._colourScheme;
161 * Returns the value of field 'maxColour'.
163 * @return the value of field 'MaxColour'.
165 public int getMaxColour()
167 return this._maxColour;
171 * Returns the value of field 'minColour'.
173 * @return the value of field 'MinColour'.
175 public int getMinColour()
177 return this._minColour;
181 * Returns the value of field 'threshold'.
183 * @return the value of field 'Threshold'.
185 public float getThreshold()
187 return this._threshold;
191 * Method hasAboveThreshold.
193 * @return true if at least one AboveThreshold has been added
195 public boolean hasAboveThreshold()
197 return this._has_aboveThreshold;
201 * Method hasMaxColour.
203 * @return true if at least one MaxColour has been added
205 public boolean hasMaxColour()
207 return this._has_maxColour;
211 * Method hasMinColour.
213 * @return true if at least one MinColour has been added
215 public boolean hasMinColour()
217 return this._has_minColour;
221 * Method hasThreshold.
223 * @return true if at least one Threshold has been added
225 public boolean hasThreshold()
227 return this._has_threshold;
233 * @return true if this object is valid according to the schema
235 public boolean isValid()
240 } catch (org.exolab.castor.xml.ValidationException vex)
251 * @throws org.exolab.castor.xml.MarshalException
252 * if object is null or if any SAXException is thrown during
254 * @throws org.exolab.castor.xml.ValidationException
255 * if this object is an invalid instance according to the schema
257 public void marshal(final java.io.Writer out)
258 throws org.exolab.castor.xml.MarshalException,
259 org.exolab.castor.xml.ValidationException
261 Marshaller.marshal(this, out);
268 * @throws java.io.IOException
269 * if an IOException occurs during marshaling
270 * @throws org.exolab.castor.xml.ValidationException
271 * if this object is an invalid instance according to the schema
272 * @throws org.exolab.castor.xml.MarshalException
273 * if object is null or if any SAXException is thrown during
276 public void marshal(final org.xml.sax.ContentHandler handler)
277 throws java.io.IOException,
278 org.exolab.castor.xml.MarshalException,
279 org.exolab.castor.xml.ValidationException
281 Marshaller.marshal(this, handler);
285 * Sets the value of field 'aboveThreshold'.
287 * @param aboveThreshold
288 * the value of field 'aboveThreshold'.
290 public void setAboveThreshold(final int aboveThreshold)
292 this._aboveThreshold = aboveThreshold;
293 this._has_aboveThreshold = true;
297 * Sets the value of field 'annotation'.
300 * the value of field 'annotation'.
302 public void setAnnotation(final java.lang.String annotation)
304 this._annotation = annotation;
308 * Sets the value of field 'colourScheme'.
310 * @param colourScheme
311 * the value of field 'colourScheme'.
313 public void setColourScheme(final java.lang.String colourScheme)
315 this._colourScheme = colourScheme;
319 * Sets the value of field 'maxColour'.
322 * the value of field 'maxColour'.
324 public void setMaxColour(final int maxColour)
326 this._maxColour = maxColour;
327 this._has_maxColour = true;
331 * Sets the value of field 'minColour'.
334 * the value of field 'minColour'.
336 public void setMinColour(final int minColour)
338 this._minColour = minColour;
339 this._has_minColour = true;
343 * Sets the value of field 'threshold'.
346 * the value of field 'threshold'.
348 public void setThreshold(final float threshold)
350 this._threshold = threshold;
351 this._has_threshold = true;
358 * @throws org.exolab.castor.xml.MarshalException
359 * if object is null or if any SAXException is thrown during
361 * @throws org.exolab.castor.xml.ValidationException
362 * if this object is an invalid instance according to the schema
363 * @return the unmarshaled jalview.schemabinding.version2.AnnotationColours
365 public static jalview.schemabinding.version2.AnnotationColours unmarshal(
366 final java.io.Reader reader)
367 throws org.exolab.castor.xml.MarshalException,
368 org.exolab.castor.xml.ValidationException
370 return (jalview.schemabinding.version2.AnnotationColours) Unmarshaller
372 jalview.schemabinding.version2.AnnotationColours.class,
379 * @throws org.exolab.castor.xml.ValidationException
380 * if this object is an invalid instance according to the schema
382 public void validate() throws org.exolab.castor.xml.ValidationException
384 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
385 validator.validate(this);