2 * Jalview - A Sequence Alignment Editor and Viewer (Development Version 2.4.1)
3 * Copyright (C) 2009 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;
81 public void deleteColour(
83 this._has_colour= false;
88 public void deleteDisplay(
90 this._has_display= false;
94 * Returns the value of field 'colour'.
96 * @return the value of field 'Colour'.
104 * Returns the value of field 'display'.
106 * @return the value of field 'Display'.
108 public boolean getDisplay(
110 return this._display;
114 * Returns the value of field 'type'.
116 * @return the value of field 'Type'.
118 public java.lang.String getType(
126 * @return true if at least one Colour has been added
128 public boolean hasColour(
130 return this._has_colour;
136 * @return true if at least one Display has been added
138 public boolean hasDisplay(
140 return this._has_display;
144 * Returns the value of field 'display'.
146 * @return the value of field 'Display'.
148 public boolean isDisplay(
150 return this._display;
156 * @return true if this object is valid according to the schema
158 public boolean isValid(
162 } catch (org.exolab.castor.xml.ValidationException vex) {
172 * @throws org.exolab.castor.xml.MarshalException if object is
173 * null or if any SAXException is thrown during marshaling
174 * @throws org.exolab.castor.xml.ValidationException if this
175 * object is an invalid instance according to the schema
178 final java.io.Writer out)
179 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
180 Marshaller.marshal(this, out);
187 * @throws java.io.IOException if an IOException occurs during
189 * @throws org.exolab.castor.xml.ValidationException if this
190 * object is an invalid instance according to the schema
191 * @throws org.exolab.castor.xml.MarshalException if object is
192 * null or if any SAXException is thrown during marshaling
195 final org.xml.sax.ContentHandler handler)
196 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
197 Marshaller.marshal(this, handler);
201 * Sets the value of field 'colour'.
203 * @param colour the value of field 'colour'.
205 public void setColour(
207 this._colour = colour;
208 this._has_colour = true;
212 * Sets the value of field 'display'.
214 * @param display the value of field 'display'.
216 public void setDisplay(
217 final boolean display) {
218 this._display = display;
219 this._has_display = true;
223 * Sets the value of field 'type'.
225 * @param type the value of field 'type'.
228 final java.lang.String type) {
236 * @throws org.exolab.castor.xml.MarshalException if object is
237 * null or if any SAXException is thrown during marshaling
238 * @throws org.exolab.castor.xml.ValidationException if this
239 * object is an invalid instance according to the schema
240 * @return the unmarshaled jalview.binding.Setting
242 public static jalview.binding.Setting unmarshal(
243 final java.io.Reader reader)
244 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
245 return (jalview.binding.Setting) Unmarshaller.unmarshal(jalview.binding.Setting.class, reader);
251 * @throws org.exolab.castor.xml.ValidationException if this
252 * object is an invalid instance according to the schema
254 public void validate(
256 throws org.exolab.castor.xml.ValidationException {
257 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
258 validator.validate(this);