2 * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3 * Copyright (C) $$Year-Rel$$ The Jalview Authors
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
10 * of the License, or (at your option) any later version.
12 * Jalview is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty
14 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
19 * The Jalview Authors are detailed in the 'AUTHORS' file.
21 package jalview.schemabinding.version2;
23 //---------------------------------/
24 //- Imported classes and packages -/
25 //---------------------------------/
27 import org.exolab.castor.xml.Marshaller;
28 import org.exolab.castor.xml.Unmarshaller;
31 * Class AnnotationColourScheme.
33 * @version $Revision$ $Date$
35 public class AnnotationColourScheme implements java.io.Serializable
38 // --------------------------/
39 // - Class/Member Variables -/
40 // --------------------------/
43 * Field _aboveThreshold.
45 private int _aboveThreshold;
48 * keeps track of state for field: _aboveThreshold
50 private boolean _has_aboveThreshold;
55 private java.lang.String _annotation;
60 private int _minColour;
63 * keeps track of state for field: _minColour
65 private boolean _has_minColour;
70 private int _maxColour;
73 * keeps track of state for field: _maxColour
75 private boolean _has_maxColour;
78 * Field _colourScheme.
80 private java.lang.String _colourScheme;
85 private float _threshold;
88 * keeps track of state for field: _threshold
90 private boolean _has_threshold;
95 private boolean _perSequence;
98 * keeps track of state for field: _perSequence
100 private boolean _has_perSequence;
103 * Field _predefinedColours.
105 private boolean _predefinedColours;
108 * keeps track of state for field: _predefinedColours
110 private boolean _has_predefinedColours;
116 public AnnotationColourScheme()
127 public void deleteAboveThreshold()
129 this._has_aboveThreshold = false;
134 public void deleteMaxColour()
136 this._has_maxColour = false;
141 public void deleteMinColour()
143 this._has_minColour = false;
148 public void deletePerSequence()
150 this._has_perSequence = false;
155 public void deletePredefinedColours()
157 this._has_predefinedColours = false;
162 public void deleteThreshold()
164 this._has_threshold = false;
168 * Returns the value of field 'aboveThreshold'.
170 * @return the value of field 'AboveThreshold'.
172 public int getAboveThreshold()
174 return this._aboveThreshold;
178 * Returns the value of field 'annotation'.
180 * @return the value of field 'Annotation'.
182 public java.lang.String getAnnotation()
184 return this._annotation;
188 * Returns the value of field 'colourScheme'.
190 * @return the value of field 'ColourScheme'.
192 public java.lang.String getColourScheme()
194 return this._colourScheme;
198 * Returns the value of field 'maxColour'.
200 * @return the value of field 'MaxColour'.
202 public int getMaxColour()
204 return this._maxColour;
208 * Returns the value of field 'minColour'.
210 * @return the value of field 'MinColour'.
212 public int getMinColour()
214 return this._minColour;
218 * Returns the value of field 'perSequence'.
220 * @return the value of field 'PerSequence'.
222 public boolean getPerSequence()
224 return this._perSequence;
228 * Returns the value of field 'predefinedColours'.
230 * @return the value of field 'PredefinedColours'.
232 public boolean getPredefinedColours()
234 return this._predefinedColours;
238 * Returns the value of field 'threshold'.
240 * @return the value of field 'Threshold'.
242 public float getThreshold()
244 return this._threshold;
248 * Method hasAboveThreshold.
250 * @return true if at least one AboveThreshold has been added
252 public boolean hasAboveThreshold()
254 return this._has_aboveThreshold;
258 * Method hasMaxColour.
260 * @return true if at least one MaxColour has been added
262 public boolean hasMaxColour()
264 return this._has_maxColour;
268 * Method hasMinColour.
270 * @return true if at least one MinColour has been added
272 public boolean hasMinColour()
274 return this._has_minColour;
278 * Method hasPerSequence.
280 * @return true if at least one PerSequence has been added
282 public boolean hasPerSequence()
284 return this._has_perSequence;
288 * Method hasPredefinedColours.
290 * @return true if at least one PredefinedColours has been added
292 public boolean hasPredefinedColours()
294 return this._has_predefinedColours;
298 * Method hasThreshold.
300 * @return true if at least one Threshold has been added
302 public boolean hasThreshold()
304 return this._has_threshold;
308 * Returns the value of field 'perSequence'.
310 * @return the value of field 'PerSequence'.
312 public boolean isPerSequence()
314 return this._perSequence;
318 * Returns the value of field 'predefinedColours'.
320 * @return the value of field 'PredefinedColours'.
322 public boolean isPredefinedColours()
324 return this._predefinedColours;
330 * @return true if this object is valid according to the schema
332 public boolean isValid()
337 } catch (org.exolab.castor.xml.ValidationException vex)
348 * @throws org.exolab.castor.xml.MarshalException
349 * if object is null or if any SAXException is thrown during
351 * @throws org.exolab.castor.xml.ValidationException
352 * if this object is an invalid instance according to the schema
354 public void marshal(final java.io.Writer out)
355 throws org.exolab.castor.xml.MarshalException,
356 org.exolab.castor.xml.ValidationException
358 Marshaller.marshal(this, out);
365 * @throws java.io.IOException
366 * if an IOException occurs during marshaling
367 * @throws org.exolab.castor.xml.ValidationException
368 * if this object is an invalid instance according to the schema
369 * @throws org.exolab.castor.xml.MarshalException
370 * if object is null or if any SAXException is thrown during
373 public void marshal(final org.xml.sax.ContentHandler handler)
374 throws java.io.IOException,
375 org.exolab.castor.xml.MarshalException,
376 org.exolab.castor.xml.ValidationException
378 Marshaller.marshal(this, handler);
382 * Sets the value of field 'aboveThreshold'.
384 * @param aboveThreshold
385 * the value of field 'aboveThreshold'.
387 public void setAboveThreshold(final int aboveThreshold)
389 this._aboveThreshold = aboveThreshold;
390 this._has_aboveThreshold = true;
394 * Sets the value of field 'annotation'.
397 * the value of field 'annotation'.
399 public void setAnnotation(final java.lang.String annotation)
401 this._annotation = annotation;
405 * Sets the value of field 'colourScheme'.
407 * @param colourScheme
408 * the value of field 'colourScheme'.
410 public void setColourScheme(final java.lang.String colourScheme)
412 this._colourScheme = colourScheme;
416 * Sets the value of field 'maxColour'.
419 * the value of field 'maxColour'.
421 public void setMaxColour(final int maxColour)
423 this._maxColour = maxColour;
424 this._has_maxColour = true;
428 * Sets the value of field 'minColour'.
431 * the value of field 'minColour'.
433 public void setMinColour(final int minColour)
435 this._minColour = minColour;
436 this._has_minColour = true;
440 * Sets the value of field 'perSequence'.
443 * the value of field 'perSequence'.
445 public void setPerSequence(final boolean perSequence)
447 this._perSequence = perSequence;
448 this._has_perSequence = true;
452 * Sets the value of field 'predefinedColours'.
454 * @param predefinedColours
455 * the value of field 'predefinedColours'.
457 public void setPredefinedColours(final boolean predefinedColours)
459 this._predefinedColours = predefinedColours;
460 this._has_predefinedColours = true;
464 * Sets the value of field 'threshold'.
467 * the value of field 'threshold'.
469 public void setThreshold(final float threshold)
471 this._threshold = threshold;
472 this._has_threshold = true;
479 * @throws org.exolab.castor.xml.MarshalException
480 * if object is null or if any SAXException is thrown during
482 * @throws org.exolab.castor.xml.ValidationException
483 * if this object is an invalid instance according to the schema
484 * @return the unmarshaled
485 * jalview.schemabinding.version2.AnnotationColourScheme
487 public static jalview.schemabinding.version2.AnnotationColourScheme unmarshal(
488 final java.io.Reader reader)
489 throws org.exolab.castor.xml.MarshalException,
490 org.exolab.castor.xml.ValidationException
492 return (jalview.schemabinding.version2.AnnotationColourScheme) Unmarshaller
494 jalview.schemabinding.version2.AnnotationColourScheme.class,
501 * @throws org.exolab.castor.xml.ValidationException
502 * if this object is an invalid instance according to the schema
504 public void validate() throws org.exolab.castor.xml.ValidationException
506 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
507 validator.validate(this);