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
30 * @version $Revision$ $Date$
\r
32 public class Setting implements java.io.Serializable
\r
35 // --------------------------/
\r
36 // - Class/Member Variables -/
\r
37 // --------------------------/
\r
42 private java.lang.String _type;
\r
47 private int _colour;
\r
50 * keeps track of state for field: _colour
\r
52 private boolean _has_colour;
\r
57 private boolean _display;
\r
60 * keeps track of state for field: _display
\r
62 private boolean _has_display;
\r
67 private float _order;
\r
70 * keeps track of state for field: _order
\r
72 private boolean _has_order;
\r
75 * Optional minimum colour for graduated feature colour
\r
77 private int _mincolour;
\r
80 * keeps track of state for field: _mincolour
\r
82 private boolean _has_mincolour;
\r
85 * threshold value for graduated feature colour
\r
87 private float _threshold;
\r
90 * keeps track of state for field: _threshold
\r
92 private boolean _has_threshold;
\r
95 * threshold type for graduated feature colour
\r
97 private int _threshstate;
\r
100 * keeps track of state for field: _threshstate
\r
102 private boolean _has_threshstate;
\r
107 private float _max;
\r
110 * keeps track of state for field: _max
\r
112 private boolean _has_max;
\r
117 private float _min;
\r
120 * keeps track of state for field: _min
\r
122 private boolean _has_min;
\r
125 * Field _colourByLabel.
\r
127 private boolean _colourByLabel;
\r
130 * keeps track of state for field: _colourByLabel
\r
132 private boolean _has_colourByLabel;
\r
135 * Field _autoScale.
\r
137 private boolean _autoScale;
\r
140 * keeps track of state for field: _autoScale
\r
142 private boolean _has_autoScale;
\r
144 // ----------------/
\r
145 // - Constructors -/
\r
146 // ----------------/
\r
159 public void deleteAutoScale()
\r
161 this._has_autoScale = false;
\r
166 public void deleteColour()
\r
168 this._has_colour = false;
\r
173 public void deleteColourByLabel()
\r
175 this._has_colourByLabel = false;
\r
180 public void deleteDisplay()
\r
182 this._has_display = false;
\r
187 public void deleteMax()
\r
189 this._has_max = false;
\r
194 public void deleteMin()
\r
196 this._has_min = false;
\r
201 public void deleteMincolour()
\r
203 this._has_mincolour = false;
\r
208 public void deleteOrder()
\r
210 this._has_order = false;
\r
215 public void deleteThreshold()
\r
217 this._has_threshold = false;
\r
222 public void deleteThreshstate()
\r
224 this._has_threshstate = false;
\r
228 * Returns the value of field 'autoScale'.
\r
230 * @return the value of field 'AutoScale'.
\r
232 public boolean getAutoScale()
\r
234 return this._autoScale;
\r
238 * Returns the value of field 'colour'.
\r
240 * @return the value of field 'Colour'.
\r
242 public int getColour()
\r
244 return this._colour;
\r
248 * Returns the value of field 'colourByLabel'.
\r
250 * @return the value of field 'ColourByLabel'.
\r
252 public boolean getColourByLabel()
\r
254 return this._colourByLabel;
\r
258 * Returns the value of field 'display'.
\r
260 * @return the value of field 'Display'.
\r
262 public boolean getDisplay()
\r
264 return this._display;
\r
268 * Returns the value of field 'max'.
\r
270 * @return the value of field 'Max'.
\r
272 public float getMax()
\r
278 * Returns the value of field 'min'.
\r
280 * @return the value of field 'Min'.
\r
282 public float getMin()
\r
288 * Returns the value of field 'mincolour'. The field 'mincolour' has the
\r
289 * following description: Optional minimum colour for graduated feature colour
\r
291 * @return the value of field 'Mincolour'.
\r
293 public int getMincolour()
\r
295 return this._mincolour;
\r
299 * Returns the value of field 'order'.
\r
301 * @return the value of field 'Order'.
\r
303 public float getOrder()
\r
305 return this._order;
\r
309 * Returns the value of field 'threshold'. The field 'threshold' has the
\r
310 * following description: threshold value for graduated feature colour
\r
312 * @return the value of field 'Threshold'.
\r
314 public float getThreshold()
\r
316 return this._threshold;
\r
320 * Returns the value of field 'threshstate'. The field 'threshstate' has the
\r
321 * following description: threshold type for graduated feature colour
\r
323 * @return the value of field 'Threshstate'.
\r
325 public int getThreshstate()
\r
327 return this._threshstate;
\r
331 * Returns the value of field 'type'.
\r
333 * @return the value of field 'Type'.
\r
335 public java.lang.String getType()
\r
341 * Method hasAutoScale.
\r
343 * @return true if at least one AutoScale has been added
\r
345 public boolean hasAutoScale()
\r
347 return this._has_autoScale;
\r
351 * Method hasColour.
\r
353 * @return true if at least one Colour has been added
\r
355 public boolean hasColour()
\r
357 return this._has_colour;
\r
361 * Method hasColourByLabel.
\r
363 * @return true if at least one ColourByLabel has been added
\r
365 public boolean hasColourByLabel()
\r
367 return this._has_colourByLabel;
\r
371 * Method hasDisplay.
\r
373 * @return true if at least one Display has been added
\r
375 public boolean hasDisplay()
\r
377 return this._has_display;
\r
383 * @return true if at least one Max has been added
\r
385 public boolean hasMax()
\r
387 return this._has_max;
\r
393 * @return true if at least one Min has been added
\r
395 public boolean hasMin()
\r
397 return this._has_min;
\r
401 * Method hasMincolour.
\r
403 * @return true if at least one Mincolour has been added
\r
405 public boolean hasMincolour()
\r
407 return this._has_mincolour;
\r
413 * @return true if at least one Order has been added
\r
415 public boolean hasOrder()
\r
417 return this._has_order;
\r
421 * Method hasThreshold.
\r
423 * @return true if at least one Threshold has been added
\r
425 public boolean hasThreshold()
\r
427 return this._has_threshold;
\r
431 * Method hasThreshstate.
\r
433 * @return true if at least one Threshstate has been added
\r
435 public boolean hasThreshstate()
\r
437 return this._has_threshstate;
\r
441 * Returns the value of field 'autoScale'.
\r
443 * @return the value of field 'AutoScale'.
\r
445 public boolean isAutoScale()
\r
447 return this._autoScale;
\r
451 * Returns the value of field 'colourByLabel'.
\r
453 * @return the value of field 'ColourByLabel'.
\r
455 public boolean isColourByLabel()
\r
457 return this._colourByLabel;
\r
461 * Returns the value of field 'display'.
\r
463 * @return the value of field 'Display'.
\r
465 public boolean isDisplay()
\r
467 return this._display;
\r
473 * @return true if this object is valid according to the schema
\r
475 public boolean isValid()
\r
480 } catch (org.exolab.castor.xml.ValidationException vex)
\r
491 * @throws org.exolab.castor.xml.MarshalException
\r
492 * if object is null or if any SAXException is thrown during
\r
494 * @throws org.exolab.castor.xml.ValidationException
\r
495 * if this object is an invalid instance according to the schema
\r
497 public void marshal(final java.io.Writer out)
\r
498 throws org.exolab.castor.xml.MarshalException,
\r
499 org.exolab.castor.xml.ValidationException
\r
501 Marshaller.marshal(this, out);
\r
508 * @throws java.io.IOException
\r
509 * if an IOException occurs during marshaling
\r
510 * @throws org.exolab.castor.xml.ValidationException
\r
511 * if this object is an invalid instance according to the schema
\r
512 * @throws org.exolab.castor.xml.MarshalException
\r
513 * if object is null or if any SAXException is thrown during
\r
516 public void marshal(final org.xml.sax.ContentHandler handler)
\r
517 throws java.io.IOException,
\r
518 org.exolab.castor.xml.MarshalException,
\r
519 org.exolab.castor.xml.ValidationException
\r
521 Marshaller.marshal(this, handler);
\r
525 * Sets the value of field 'autoScale'.
\r
528 * the value of field 'autoScale'.
\r
530 public void setAutoScale(final boolean autoScale)
\r
532 this._autoScale = autoScale;
\r
533 this._has_autoScale = true;
\r
537 * Sets the value of field 'colour'.
\r
540 * the value of field 'colour'.
\r
542 public void setColour(final int colour)
\r
544 this._colour = colour;
\r
545 this._has_colour = true;
\r
549 * Sets the value of field 'colourByLabel'.
\r
551 * @param colourByLabel
\r
552 * the value of field 'colourByLabel'.
\r
554 public void setColourByLabel(final boolean colourByLabel)
\r
556 this._colourByLabel = colourByLabel;
\r
557 this._has_colourByLabel = true;
\r
561 * Sets the value of field 'display'.
\r
564 * the value of field 'display'.
\r
566 public void setDisplay(final boolean display)
\r
568 this._display = display;
\r
569 this._has_display = true;
\r
573 * Sets the value of field 'max'.
\r
576 * the value of field 'max'.
\r
578 public void setMax(final float max)
\r
581 this._has_max = true;
\r
585 * Sets the value of field 'min'.
\r
588 * the value of field 'min'.
\r
590 public void setMin(final float min)
\r
593 this._has_min = true;
\r
597 * Sets the value of field 'mincolour'. The field 'mincolour' has the
\r
598 * following description: Optional minimum colour for graduated feature colour
\r
601 * the value of field 'mincolour'.
\r
603 public void setMincolour(final int mincolour)
\r
605 this._mincolour = mincolour;
\r
606 this._has_mincolour = true;
\r
610 * Sets the value of field 'order'.
\r
613 * the value of field 'order'.
\r
615 public void setOrder(final float order)
\r
617 this._order = order;
\r
618 this._has_order = true;
\r
622 * Sets the value of field 'threshold'. The field 'threshold' has the
\r
623 * following description: threshold value for graduated feature colour
\r
626 * the value of field 'threshold'.
\r
628 public void setThreshold(final float threshold)
\r
630 this._threshold = threshold;
\r
631 this._has_threshold = true;
\r
635 * Sets the value of field 'threshstate'. The field 'threshstate' has the
\r
636 * following description: threshold type for graduated feature colour
\r
638 * @param threshstate
\r
639 * the value of field 'threshstate'.
\r
641 public void setThreshstate(final int threshstate)
\r
643 this._threshstate = threshstate;
\r
644 this._has_threshstate = true;
\r
648 * Sets the value of field 'type'.
\r
651 * the value of field 'type'.
\r
653 public void setType(final java.lang.String type)
\r
659 * Method unmarshal.
\r
662 * @throws org.exolab.castor.xml.MarshalException
\r
663 * if object is null or if any SAXException is thrown during
\r
665 * @throws org.exolab.castor.xml.ValidationException
\r
666 * if this object is an invalid instance according to the schema
\r
667 * @return the unmarshaled jalview.schemabinding.version2.Settin
\r
669 public static jalview.schemabinding.version2.Setting unmarshal(
\r
670 final java.io.Reader reader)
\r
671 throws org.exolab.castor.xml.MarshalException,
\r
672 org.exolab.castor.xml.ValidationException
\r
674 return (jalview.schemabinding.version2.Setting) Unmarshaller.unmarshal(
\r
675 jalview.schemabinding.version2.Setting.class, reader);
\r
681 * @throws org.exolab.castor.xml.ValidationException
\r
682 * if this object is an invalid instance according to the schema
\r
684 public void validate() throws org.exolab.castor.xml.ValidationException
\r
686 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
\r
687 validator.validate(this);
\r