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.binding;
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;
79 public void deleteColour()
81 this._has_colour = false;
86 public void deleteDisplay()
88 this._has_display = false;
92 * Returns the value of field 'colour'.
94 * @return the value of field 'Colour'.
96 public int getColour()
102 * Returns the value of field 'display'.
104 * @return the value of field 'Display'.
106 public boolean getDisplay()
108 return this._display;
112 * Returns the value of field 'type'.
114 * @return the value of field 'Type'.
116 public java.lang.String getType()
124 * @return true if at least one Colour has been added
126 public boolean hasColour()
128 return this._has_colour;
134 * @return true if at least one Display has been added
136 public boolean hasDisplay()
138 return this._has_display;
142 * Returns the value of field 'display'.
144 * @return the value of field 'Display'.
146 public boolean isDisplay()
148 return this._display;
154 * @return true if this object is valid according to the schema
156 public boolean isValid()
161 } catch (org.exolab.castor.xml.ValidationException vex)
172 * @throws org.exolab.castor.xml.MarshalException
173 * if object is null or if any SAXException is thrown during
175 * @throws org.exolab.castor.xml.ValidationException
176 * if this object is an invalid instance according to the schema
178 public void marshal(final java.io.Writer out)
179 throws org.exolab.castor.xml.MarshalException,
180 org.exolab.castor.xml.ValidationException
182 Marshaller.marshal(this, out);
189 * @throws java.io.IOException
190 * if an IOException occurs during marshaling
191 * @throws org.exolab.castor.xml.ValidationException
192 * if this object is an invalid instance according to the schema
193 * @throws org.exolab.castor.xml.MarshalException
194 * if object is null or if any SAXException is thrown during
197 public void marshal(final org.xml.sax.ContentHandler handler)
198 throws java.io.IOException,
199 org.exolab.castor.xml.MarshalException,
200 org.exolab.castor.xml.ValidationException
202 Marshaller.marshal(this, handler);
206 * Sets the value of field 'colour'.
209 * the value of field 'colour'.
211 public void setColour(final int colour)
213 this._colour = colour;
214 this._has_colour = true;
218 * Sets the value of field 'display'.
221 * the value of field 'display'.
223 public void setDisplay(final boolean display)
225 this._display = display;
226 this._has_display = true;
230 * Sets the value of field 'type'.
233 * the value of field 'type'.
235 public void setType(final java.lang.String type)
244 * @throws org.exolab.castor.xml.MarshalException
245 * if object is null or if any SAXException is thrown during
247 * @throws org.exolab.castor.xml.ValidationException
248 * if this object is an invalid instance according to the schema
249 * @return the unmarshaled jalview.binding.Setting
251 public static jalview.binding.Setting unmarshal(
252 final java.io.Reader reader)
253 throws org.exolab.castor.xml.MarshalException,
254 org.exolab.castor.xml.ValidationException
256 return (jalview.binding.Setting) Unmarshaller.unmarshal(
257 jalview.binding.Setting.class, reader);
263 * @throws org.exolab.castor.xml.ValidationException
264 * if this object is an invalid instance according to the schema
266 public void validate() throws org.exolab.castor.xml.ValidationException
268 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
269 validator.validate(this);