2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.4)
\r
3 * Copyright (C) 2008 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
\r
5 * This program is free software; you can redistribute it and/or
\r
6 * modify it under the terms of the GNU General Public License
\r
7 * as published by the Free Software Foundation; either version 2
\r
8 * of the License, or (at your option) any later version.
\r
10 * This program is distributed in the hope that it will be useful,
\r
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
13 * GNU General Public License for more details.
\r
15 * You should have received a copy of the GNU General Public License
\r
16 * along with this program; if not, write to the Free Software
\r
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
\r
19 package jalview.schemabinding.version2;
\r
21 // ---------------------------------/
\r
22 // - Imported classes and packages -/
\r
23 // ---------------------------------/
\r
25 import org.exolab.castor.xml.Marshaller;
\r
26 import org.exolab.castor.xml.Unmarshaller;
\r
31 * @version $Revision$ $Date$
\r
33 public class Setting implements java.io.Serializable
\r
36 // --------------------------/
\r
37 // - Class/Member Variables -/
\r
38 // --------------------------/
\r
43 private java.lang.String _type;
\r
48 private int _colour;
\r
51 * keeps track of state for field: _colour
\r
53 private boolean _has_colour;
\r
58 private boolean _display;
\r
61 * keeps track of state for field: _display
\r
63 private boolean _has_display;
\r
68 private float _order;
\r
71 * keeps track of state for field: _order
\r
73 private boolean _has_order;
\r
75 // ----------------/
\r
76 // - Constructors -/
\r
77 // ----------------/
\r
90 public void deleteColour()
\r
92 this._has_colour = false;
\r
97 public void deleteDisplay()
\r
99 this._has_display = false;
\r
104 public void deleteOrder()
\r
106 this._has_order = false;
\r
110 * Returns the value of field 'colour'.
\r
112 * @return the value of field 'Colour'.
\r
114 public int getColour()
\r
116 return this._colour;
\r
120 * Returns the value of field 'display'.
\r
122 * @return the value of field 'Display'.
\r
124 public boolean getDisplay()
\r
126 return this._display;
\r
130 * Returns the value of field 'order'.
\r
132 * @return the value of field 'Order'.
\r
134 public float getOrder()
\r
136 return this._order;
\r
140 * Returns the value of field 'type'.
\r
142 * @return the value of field 'Type'.
\r
144 public java.lang.String getType()
\r
150 * Method hasColour.
\r
152 * @return true if at least one Colour has been added
\r
154 public boolean hasColour()
\r
156 return this._has_colour;
\r
160 * Method hasDisplay.
\r
162 * @return true if at least one Display has been added
\r
164 public boolean hasDisplay()
\r
166 return this._has_display;
\r
172 * @return true if at least one Order has been added
\r
174 public boolean hasOrder()
\r
176 return this._has_order;
\r
180 * Returns the value of field 'display'.
\r
182 * @return the value of field 'Display'.
\r
184 public boolean isDisplay()
\r
186 return this._display;
\r
192 * @return true if this object is valid according to the schema
\r
194 public boolean isValid()
\r
199 } catch (org.exolab.castor.xml.ValidationException vex)
\r
210 * @throws org.exolab.castor.xml.MarshalException
\r
211 * if object is null or if any SAXException is thrown during
\r
213 * @throws org.exolab.castor.xml.ValidationException
\r
214 * if this object is an invalid instance according to the
\r
217 public void marshal(final java.io.Writer out)
\r
218 throws org.exolab.castor.xml.MarshalException,
\r
219 org.exolab.castor.xml.ValidationException
\r
221 Marshaller.marshal(this, out);
\r
228 * @throws java.io.IOException
\r
229 * if an IOException occurs during marshaling
\r
230 * @throws org.exolab.castor.xml.ValidationException
\r
231 * if this object is an invalid instance according to the
\r
233 * @throws org.exolab.castor.xml.MarshalException
\r
234 * if object is null or if any SAXException is thrown during
\r
237 public void marshal(final org.xml.sax.ContentHandler handler)
\r
238 throws java.io.IOException,
\r
239 org.exolab.castor.xml.MarshalException,
\r
240 org.exolab.castor.xml.ValidationException
\r
242 Marshaller.marshal(this, handler);
\r
246 * Sets the value of field 'colour'.
\r
249 * the value of field 'colour'.
\r
251 public void setColour(final int colour)
\r
253 this._colour = colour;
\r
254 this._has_colour = true;
\r
258 * Sets the value of field 'display'.
\r
261 * the value of field 'display'.
\r
263 public void setDisplay(final boolean display)
\r
265 this._display = display;
\r
266 this._has_display = true;
\r
270 * Sets the value of field 'order'.
\r
273 * the value of field 'order'.
\r
275 public void setOrder(final float order)
\r
277 this._order = order;
\r
278 this._has_order = true;
\r
282 * Sets the value of field 'type'.
\r
285 * the value of field 'type'.
\r
287 public void setType(final java.lang.String type)
\r
293 * Method unmarshal.
\r
296 * @throws org.exolab.castor.xml.MarshalException
\r
297 * if object is null or if any SAXException is thrown during
\r
299 * @throws org.exolab.castor.xml.ValidationException
\r
300 * if this object is an invalid instance according to the
\r
302 * @return the unmarshaled jalview.schemabinding.version2.Settin
\r
304 public static jalview.schemabinding.version2.Setting unmarshal(
\r
305 final java.io.Reader reader)
\r
306 throws org.exolab.castor.xml.MarshalException,
\r
307 org.exolab.castor.xml.ValidationException
\r
309 return (jalview.schemabinding.version2.Setting) Unmarshaller.unmarshal(
\r
310 jalview.schemabinding.version2.Setting.class, reader);
\r
316 * @throws org.exolab.castor.xml.ValidationException
\r
317 * if this object is an invalid instance according to the
\r
320 public void validate() throws org.exolab.castor.xml.ValidationException
\r
322 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
\r
323 validator.validate(this);
\r