2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.0b1)
3 * Copyright (C) 2014 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 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/>.
17 * The Jalview Authors are detailed in the 'AUTHORS' file.
20 package jalview.schemabinding.version2;
22 //---------------------------------/
23 //- Imported classes and packages -/
24 //---------------------------------/
26 import org.exolab.castor.xml.Marshaller;
27 import org.exolab.castor.xml.Unmarshaller;
30 * Class AnnotationColours.
32 * @version $Revision$ $Date$
34 public class AnnotationColours implements java.io.Serializable {
37 //--------------------------/
38 //- Class/Member Variables -/
39 //--------------------------/
42 * Field _aboveThreshold.
44 private int _aboveThreshold;
47 * keeps track of state for field: _aboveThreshold
49 private boolean _has_aboveThreshold;
54 private java.lang.String _annotation;
59 private int _minColour;
62 * keeps track of state for field: _minColour
64 private boolean _has_minColour;
69 private int _maxColour;
72 * keeps track of state for field: _maxColour
74 private boolean _has_maxColour;
77 * Field _colourScheme.
79 private java.lang.String _colourScheme;
84 private float _threshold;
87 * keeps track of state for field: _threshold
89 private boolean _has_threshold;
94 private boolean _perSequence;
97 * keeps track of state for field: _perSequence
99 private boolean _has_perSequence;
102 * Field _predefinedColours.
104 private boolean _predefinedColours;
107 * keeps track of state for field: _predefinedColours
109 private boolean _has_predefinedColours;
116 public AnnotationColours() {
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(
336 } catch (org.exolab.castor.xml.ValidationException vex) {
346 * @throws org.exolab.castor.xml.MarshalException if object is
347 * null or if any SAXException is thrown during marshaling
348 * @throws org.exolab.castor.xml.ValidationException if this
349 * object is an invalid instance according to the schema
352 final java.io.Writer out)
353 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
354 Marshaller.marshal(this, out);
361 * @throws java.io.IOException if an IOException occurs during
363 * @throws org.exolab.castor.xml.ValidationException if this
364 * object is an invalid instance according to the schema
365 * @throws org.exolab.castor.xml.MarshalException if object is
366 * null or if any SAXException is thrown during marshaling
369 final org.xml.sax.ContentHandler handler)
370 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
371 Marshaller.marshal(this, handler);
375 * Sets the value of field 'aboveThreshold'.
377 * @param aboveThreshold the value of field 'aboveThreshold'.
379 public void setAboveThreshold(
380 final int aboveThreshold) {
381 this._aboveThreshold = aboveThreshold;
382 this._has_aboveThreshold = true;
386 * Sets the value of field 'annotation'.
388 * @param annotation the value of field 'annotation'.
390 public void setAnnotation(
391 final java.lang.String annotation) {
392 this._annotation = annotation;
396 * Sets the value of field 'colourScheme'.
398 * @param colourScheme the value of field 'colourScheme'.
400 public void setColourScheme(
401 final java.lang.String colourScheme) {
402 this._colourScheme = colourScheme;
406 * Sets the value of field 'maxColour'.
408 * @param maxColour the value of field 'maxColour'.
410 public void setMaxColour(
411 final int maxColour) {
412 this._maxColour = maxColour;
413 this._has_maxColour = true;
417 * Sets the value of field 'minColour'.
419 * @param minColour the value of field 'minColour'.
421 public void setMinColour(
422 final int minColour) {
423 this._minColour = minColour;
424 this._has_minColour = true;
428 * Sets the value of field 'perSequence'.
430 * @param perSequence the value of field 'perSequence'.
432 public void setPerSequence(
433 final boolean perSequence) {
434 this._perSequence = perSequence;
435 this._has_perSequence = true;
439 * Sets the value of field 'predefinedColours'.
441 * @param predefinedColours the value of field
442 * 'predefinedColours'.
444 public void setPredefinedColours(
445 final boolean predefinedColours) {
446 this._predefinedColours = predefinedColours;
447 this._has_predefinedColours = true;
451 * Sets the value of field 'threshold'.
453 * @param threshold the value of field 'threshold'.
455 public void setThreshold(
456 final float threshold) {
457 this._threshold = threshold;
458 this._has_threshold = true;
465 * @throws org.exolab.castor.xml.MarshalException if object is
466 * null or if any SAXException is thrown during marshaling
467 * @throws org.exolab.castor.xml.ValidationException if this
468 * object is an invalid instance according to the schema
469 * @return the unmarshaled
470 * jalview.schemabinding.version2.AnnotationColours
472 public static jalview.schemabinding.version2.AnnotationColours unmarshal(
473 final java.io.Reader reader)
474 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
475 return (jalview.schemabinding.version2.AnnotationColours) Unmarshaller.unmarshal(jalview.schemabinding.version2.AnnotationColours.class, reader);
481 * @throws org.exolab.castor.xml.ValidationException if this
482 * object is an invalid instance according to the schema
484 public void validate(
486 throws org.exolab.castor.xml.ValidationException {
487 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
488 validator.validate(this);