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;
30 * @version $Revision$ $Date$
32 public class Setting implements java.io.Serializable
35 // --------------------------/
36 // - Class/Member Variables -/
37 // --------------------------/
42 private java.lang.String _type;
50 * keeps track of state for field: _colour
52 private boolean _has_colour;
57 private boolean _display;
60 * keeps track of state for field: _display
62 private boolean _has_display;
70 * keeps track of state for field: _order
72 private boolean _has_order;
75 * Optional minimum colour for graduated feature colour
78 private int _mincolour;
81 * keeps track of state for field: _mincolour
83 private boolean _has_mincolour;
86 * threshold value for graduated feature colour
89 private float _threshold;
92 * keeps track of state for field: _threshold
94 private boolean _has_threshold;
97 * threshold type for graduated feature colour
100 private int _threshstate;
103 * keeps track of state for field: _threshstate
105 private boolean _has_threshstate;
113 * keeps track of state for field: _max
115 private boolean _has_max;
123 * keeps track of state for field: _min
125 private boolean _has_min;
128 * Field _colourByLabel.
130 private boolean _colourByLabel;
133 * keeps track of state for field: _colourByLabel
135 private boolean _has_colourByLabel;
140 private boolean _autoScale;
143 * keeps track of state for field: _autoScale
145 private boolean _has_autoScale;
162 public void deleteAutoScale()
164 this._has_autoScale = false;
169 public void deleteColour()
171 this._has_colour = false;
176 public void deleteColourByLabel()
178 this._has_colourByLabel = false;
183 public void deleteDisplay()
185 this._has_display = false;
190 public void deleteMax()
192 this._has_max = false;
197 public void deleteMin()
199 this._has_min = false;
204 public void deleteMincolour()
206 this._has_mincolour = false;
211 public void deleteOrder()
213 this._has_order = false;
218 public void deleteThreshold()
220 this._has_threshold = false;
225 public void deleteThreshstate()
227 this._has_threshstate = false;
231 * Returns the value of field 'autoScale'.
233 * @return the value of field 'AutoScale'.
235 public boolean getAutoScale()
237 return this._autoScale;
241 * Returns the value of field 'colour'.
243 * @return the value of field 'Colour'.
245 public int getColour()
251 * Returns the value of field 'colourByLabel'.
253 * @return the value of field 'ColourByLabel'.
255 public boolean getColourByLabel()
257 return this._colourByLabel;
261 * Returns the value of field 'display'.
263 * @return the value of field 'Display'.
265 public boolean getDisplay()
267 return this._display;
271 * Returns the value of field 'max'.
273 * @return the value of field 'Max'.
275 public float getMax()
281 * Returns the value of field 'min'.
283 * @return the value of field 'Min'.
285 public float getMin()
291 * Returns the value of field 'mincolour'. The field 'mincolour' has the
292 * following description: Optional minimum colour for graduated feature colour
295 * @return the value of field 'Mincolour'.
297 public int getMincolour()
299 return this._mincolour;
303 * Returns the value of field 'order'.
305 * @return the value of field 'Order'.
307 public float getOrder()
313 * Returns the value of field 'threshold'. The field 'threshold' has the
314 * following description: threshold value for graduated feature colour
317 * @return the value of field 'Threshold'.
319 public float getThreshold()
321 return this._threshold;
325 * Returns the value of field 'threshstate'. The field 'threshstate' has the
326 * following description: threshold type for graduated feature colour
329 * @return the value of field 'Threshstate'.
331 public int getThreshstate()
333 return this._threshstate;
337 * Returns the value of field 'type'.
339 * @return the value of field 'Type'.
341 public java.lang.String getType()
347 * Method hasAutoScale.
349 * @return true if at least one AutoScale has been added
351 public boolean hasAutoScale()
353 return this._has_autoScale;
359 * @return true if at least one Colour has been added
361 public boolean hasColour()
363 return this._has_colour;
367 * Method hasColourByLabel.
369 * @return true if at least one ColourByLabel has been added
371 public boolean hasColourByLabel()
373 return this._has_colourByLabel;
379 * @return true if at least one Display has been added
381 public boolean hasDisplay()
383 return this._has_display;
389 * @return true if at least one Max has been added
391 public boolean hasMax()
393 return this._has_max;
399 * @return true if at least one Min has been added
401 public boolean hasMin()
403 return this._has_min;
407 * Method hasMincolour.
409 * @return true if at least one Mincolour has been added
411 public boolean hasMincolour()
413 return this._has_mincolour;
419 * @return true if at least one Order has been added
421 public boolean hasOrder()
423 return this._has_order;
427 * Method hasThreshold.
429 * @return true if at least one Threshold has been added
431 public boolean hasThreshold()
433 return this._has_threshold;
437 * Method hasThreshstate.
439 * @return true if at least one Threshstate has been added
441 public boolean hasThreshstate()
443 return this._has_threshstate;
447 * Returns the value of field 'autoScale'.
449 * @return the value of field 'AutoScale'.
451 public boolean isAutoScale()
453 return this._autoScale;
457 * Returns the value of field 'colourByLabel'.
459 * @return the value of field 'ColourByLabel'.
461 public boolean isColourByLabel()
463 return this._colourByLabel;
467 * Returns the value of field 'display'.
469 * @return the value of field 'Display'.
471 public boolean isDisplay()
473 return this._display;
479 * @return true if this object is valid according to the schema
481 public boolean isValid()
486 } catch (org.exolab.castor.xml.ValidationException vex)
497 * @throws org.exolab.castor.xml.MarshalException
498 * if object is null or if any SAXException is thrown during
500 * @throws org.exolab.castor.xml.ValidationException
501 * if this object is an invalid instance according to the schema
503 public void marshal(final java.io.Writer out)
504 throws org.exolab.castor.xml.MarshalException,
505 org.exolab.castor.xml.ValidationException
507 Marshaller.marshal(this, out);
514 * @throws java.io.IOException
515 * if an IOException occurs during marshaling
516 * @throws org.exolab.castor.xml.ValidationException
517 * if this object is an invalid instance according to the schema
518 * @throws org.exolab.castor.xml.MarshalException
519 * if object is null or if any SAXException is thrown during
522 public void marshal(final org.xml.sax.ContentHandler handler)
523 throws java.io.IOException,
524 org.exolab.castor.xml.MarshalException,
525 org.exolab.castor.xml.ValidationException
527 Marshaller.marshal(this, handler);
531 * Sets the value of field 'autoScale'.
534 * the value of field 'autoScale'.
536 public void setAutoScale(final boolean autoScale)
538 this._autoScale = autoScale;
539 this._has_autoScale = true;
543 * Sets the value of field 'colour'.
546 * the value of field 'colour'.
548 public void setColour(final int colour)
550 this._colour = colour;
551 this._has_colour = true;
555 * Sets the value of field 'colourByLabel'.
557 * @param colourByLabel
558 * the value of field 'colourByLabel'.
560 public void setColourByLabel(final boolean colourByLabel)
562 this._colourByLabel = colourByLabel;
563 this._has_colourByLabel = true;
567 * Sets the value of field 'display'.
570 * the value of field 'display'.
572 public void setDisplay(final boolean display)
574 this._display = display;
575 this._has_display = true;
579 * Sets the value of field 'max'.
582 * the value of field 'max'.
584 public void setMax(final float max)
587 this._has_max = true;
591 * Sets the value of field 'min'.
594 * the value of field 'min'.
596 public void setMin(final float min)
599 this._has_min = true;
603 * Sets the value of field 'mincolour'. The field 'mincolour' has the
604 * following description: Optional minimum colour for graduated feature colour
608 * the value of field 'mincolour'.
610 public void setMincolour(final int mincolour)
612 this._mincolour = mincolour;
613 this._has_mincolour = true;
617 * Sets the value of field 'order'.
620 * the value of field 'order'.
622 public void setOrder(final float order)
625 this._has_order = true;
629 * Sets the value of field 'threshold'. The field 'threshold' has the
630 * following description: threshold value for graduated feature colour
634 * the value of field 'threshold'.
636 public void setThreshold(final float threshold)
638 this._threshold = threshold;
639 this._has_threshold = true;
643 * Sets the value of field 'threshstate'. The field 'threshstate' has the
644 * following description: threshold type for graduated feature colour
648 * the value of field 'threshstate'.
650 public void setThreshstate(final int threshstate)
652 this._threshstate = threshstate;
653 this._has_threshstate = true;
657 * Sets the value of field 'type'.
660 * the value of field 'type'.
662 public void setType(final java.lang.String type)
671 * @throws org.exolab.castor.xml.MarshalException
672 * if object is null or if any SAXException is thrown during
674 * @throws org.exolab.castor.xml.ValidationException
675 * if this object is an invalid instance according to the schema
676 * @return the unmarshaled jalview.schemabinding.version2.Settin
678 public static jalview.schemabinding.version2.Setting unmarshal(
679 final java.io.Reader reader)
680 throws org.exolab.castor.xml.MarshalException,
681 org.exolab.castor.xml.ValidationException
683 return (jalview.schemabinding.version2.Setting) Unmarshaller.unmarshal(
684 jalview.schemabinding.version2.Setting.class, reader);
690 * @throws org.exolab.castor.xml.ValidationException
691 * if this object is an invalid instance according to the schema
693 public void validate() throws org.exolab.castor.xml.ValidationException
695 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
696 validator.validate(this);