2 * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3 * Copyright (C) $$Year-Rel$$ The Jalview Authors
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
10 * of the License, or (at your option) any later version.
12 * Jalview is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty
14 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
19 * The Jalview Authors are detailed in the 'AUTHORS' file.
21 package jalview.binding;
23 //---------------------------------/
24 //- Imported classes and packages -/
25 //---------------------------------/
27 import org.exolab.castor.xml.Marshaller;
28 import org.exolab.castor.xml.Unmarshaller;
33 * @version $Revision$ $Date$
35 public class Setting implements java.io.Serializable
38 // --------------------------/
39 // - Class/Member Variables -/
40 // --------------------------/
45 private java.lang.String _type;
53 * keeps track of state for field: _colour
55 private boolean _has_colour;
60 private boolean _display;
63 * keeps track of state for field: _display
65 private boolean _has_display;
82 public void deleteColour()
84 this._has_colour = false;
89 public void deleteDisplay()
91 this._has_display = false;
95 * Returns the value of field 'colour'.
97 * @return the value of field 'Colour'.
99 public int getColour()
105 * Returns the value of field 'display'.
107 * @return the value of field 'Display'.
109 public boolean getDisplay()
111 return this._display;
115 * Returns the value of field 'type'.
117 * @return the value of field 'Type'.
119 public java.lang.String getType()
127 * @return true if at least one Colour has been added
129 public boolean hasColour()
131 return this._has_colour;
137 * @return true if at least one Display has been added
139 public boolean hasDisplay()
141 return this._has_display;
145 * Returns the value of field 'display'.
147 * @return the value of field 'Display'.
149 public boolean isDisplay()
151 return this._display;
157 * @return true if this object is valid according to the schema
159 public boolean isValid()
164 } catch (org.exolab.castor.xml.ValidationException vex)
175 * @throws org.exolab.castor.xml.MarshalException
176 * if object is null or if any SAXException is thrown during
178 * @throws org.exolab.castor.xml.ValidationException
179 * if this object is an invalid instance according to the schema
181 public void marshal(final java.io.Writer out)
182 throws org.exolab.castor.xml.MarshalException,
183 org.exolab.castor.xml.ValidationException
185 Marshaller.marshal(this, out);
192 * @throws java.io.IOException
193 * if an IOException occurs during marshaling
194 * @throws org.exolab.castor.xml.ValidationException
195 * if this object is an invalid instance according to the schema
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 schema
252 * @return the unmarshaled jalview.binding.Setting
254 public static jalview.binding.Setting unmarshal(
255 final java.io.Reader reader)
256 throws org.exolab.castor.xml.MarshalException,
257 org.exolab.castor.xml.ValidationException
259 return (jalview.binding.Setting) Unmarshaller.unmarshal(
260 jalview.binding.Setting.class, reader);
266 * @throws org.exolab.castor.xml.ValidationException
267 * if this object is an invalid instance according to the schema
269 public void validate() throws org.exolab.castor.xml.ValidationException
271 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
272 validator.validate(this);