2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.4)
3 * Copyright (C) 2008 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
19 package jalview.binding;
21 // ---------------------------------/
22 // - Imported classes and packages -/
23 // ---------------------------------/
25 import org.exolab.castor.xml.Marshaller;
26 import org.exolab.castor.xml.Unmarshaller;
31 * @version $Revision$ $Date$
33 public class Setting implements java.io.Serializable
36 // --------------------------/
37 // - Class/Member Variables -/
38 // --------------------------/
43 private java.lang.String _type;
51 * keeps track of state for field: _colour
53 private boolean _has_colour;
58 private boolean _display;
61 * keeps track of state for field: _display
63 private boolean _has_display;
80 public void deleteColour()
82 this._has_colour = false;
87 public void deleteDisplay()
89 this._has_display = false;
93 * Returns the value of field 'colour'.
95 * @return the value of field 'Colour'.
97 public int getColour()
103 * Returns the value of field 'display'.
105 * @return the value of field 'Display'.
107 public boolean getDisplay()
109 return this._display;
113 * Returns the value of field 'type'.
115 * @return the value of field 'Type'.
117 public java.lang.String getType()
125 * @return true if at least one Colour has been added
127 public boolean hasColour()
129 return this._has_colour;
135 * @return true if at least one Display has been added
137 public boolean hasDisplay()
139 return this._has_display;
143 * Returns the value of field 'display'.
145 * @return the value of field 'Display'.
147 public boolean isDisplay()
149 return this._display;
155 * @return true if this object is valid according to the schema
157 public boolean isValid()
162 } catch (org.exolab.castor.xml.ValidationException vex)
173 * @throws org.exolab.castor.xml.MarshalException
174 * if object is null or if any SAXException is thrown during
176 * @throws org.exolab.castor.xml.ValidationException
177 * if this object is an invalid instance according to the
180 public void marshal(final java.io.Writer out)
181 throws org.exolab.castor.xml.MarshalException,
182 org.exolab.castor.xml.ValidationException
184 Marshaller.marshal(this, out);
191 * @throws java.io.IOException
192 * if an IOException occurs during marshaling
193 * @throws org.exolab.castor.xml.ValidationException
194 * if this object is an invalid instance according to the
196 * @throws org.exolab.castor.xml.MarshalException
197 * if object is null or if any SAXException is thrown during
200 public void marshal(final org.xml.sax.ContentHandler handler)
201 throws java.io.IOException,
202 org.exolab.castor.xml.MarshalException,
203 org.exolab.castor.xml.ValidationException
205 Marshaller.marshal(this, handler);
209 * Sets the value of field 'colour'.
212 * the value of field 'colour'.
214 public void setColour(final int colour)
216 this._colour = colour;
217 this._has_colour = true;
221 * Sets the value of field 'display'.
224 * the value of field 'display'.
226 public void setDisplay(final boolean display)
228 this._display = display;
229 this._has_display = true;
233 * Sets the value of field 'type'.
236 * the value of field 'type'.
238 public void setType(final java.lang.String type)
247 * @throws org.exolab.castor.xml.MarshalException
248 * if object is null or if any SAXException is thrown during
250 * @throws org.exolab.castor.xml.ValidationException
251 * if this object is an invalid instance according to the
253 * @return the unmarshaled jalview.binding.Setting
255 public static jalview.binding.Setting unmarshal(
256 final java.io.Reader reader)
257 throws org.exolab.castor.xml.MarshalException,
258 org.exolab.castor.xml.ValidationException
260 return (jalview.binding.Setting) Unmarshaller.unmarshal(
261 jalview.binding.Setting.class, reader);
267 * @throws org.exolab.castor.xml.ValidationException
268 * if this object is an invalid instance according to the
271 public void validate() throws org.exolab.castor.xml.ValidationException
273 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
274 validator.validate(this);