8c534a2eb20154b7db7c6457e08ea69b7e873e4c
[jalview.git] / src / jalview / binding / Setting.java
1 /*******************************************************************************
2  * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3  * Copyright (C) $(date) The Jalview Authors
4  *
5  * This file is part of Jalview.
6  *  
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.
11  *   
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.
16  *
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.
20  *******************************************************************************/
21 /*
22  * This class was automatically generated with 
23  * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
24  * Schema.
25  * $Id$
26  */
27
28 package jalview.binding;
29
30 //---------------------------------/
31 //- Imported classes and packages -/
32 //---------------------------------/
33
34 import org.exolab.castor.xml.Marshaller;
35 import org.exolab.castor.xml.Unmarshaller;
36
37 /**
38  * Class Setting.
39  * 
40  * @version $Revision$ $Date$
41  */
42 public class Setting implements java.io.Serializable
43 {
44
45   // --------------------------/
46   // - Class/Member Variables -/
47   // --------------------------/
48
49   /**
50    * Field _type.
51    */
52   private java.lang.String _type;
53
54   /**
55    * Field _colour.
56    */
57   private int _colour;
58
59   /**
60    * keeps track of state for field: _colour
61    */
62   private boolean _has_colour;
63
64   /**
65    * Field _display.
66    */
67   private boolean _display;
68
69   /**
70    * keeps track of state for field: _display
71    */
72   private boolean _has_display;
73
74   // ----------------/
75   // - Constructors -/
76   // ----------------/
77
78   public Setting()
79   {
80     super();
81   }
82
83   // -----------/
84   // - Methods -/
85   // -----------/
86
87   /**
88      */
89   public void deleteColour()
90   {
91     this._has_colour = false;
92   }
93
94   /**
95      */
96   public void deleteDisplay()
97   {
98     this._has_display = false;
99   }
100
101   /**
102    * Returns the value of field 'colour'.
103    * 
104    * @return the value of field 'Colour'.
105    */
106   public int getColour()
107   {
108     return this._colour;
109   }
110
111   /**
112    * Returns the value of field 'display'.
113    * 
114    * @return the value of field 'Display'.
115    */
116   public boolean getDisplay()
117   {
118     return this._display;
119   }
120
121   /**
122    * Returns the value of field 'type'.
123    * 
124    * @return the value of field 'Type'.
125    */
126   public java.lang.String getType()
127   {
128     return this._type;
129   }
130
131   /**
132    * Method hasColour.
133    * 
134    * @return true if at least one Colour has been added
135    */
136   public boolean hasColour()
137   {
138     return this._has_colour;
139   }
140
141   /**
142    * Method hasDisplay.
143    * 
144    * @return true if at least one Display has been added
145    */
146   public boolean hasDisplay()
147   {
148     return this._has_display;
149   }
150
151   /**
152    * Returns the value of field 'display'.
153    * 
154    * @return the value of field 'Display'.
155    */
156   public boolean isDisplay()
157   {
158     return this._display;
159   }
160
161   /**
162    * Method isValid.
163    * 
164    * @return true if this object is valid according to the schema
165    */
166   public boolean isValid()
167   {
168     try
169     {
170       validate();
171     } catch (org.exolab.castor.xml.ValidationException vex)
172     {
173       return false;
174     }
175     return true;
176   }
177
178   /**
179    * 
180    * 
181    * @param out
182    * @throws org.exolab.castor.xml.MarshalException
183    *           if object is null or if any SAXException is thrown during
184    *           marshaling
185    * @throws org.exolab.castor.xml.ValidationException
186    *           if this object is an invalid instance according to the schema
187    */
188   public void marshal(final java.io.Writer out)
189           throws org.exolab.castor.xml.MarshalException,
190           org.exolab.castor.xml.ValidationException
191   {
192     Marshaller.marshal(this, out);
193   }
194
195   /**
196    * 
197    * 
198    * @param handler
199    * @throws java.io.IOException
200    *           if an IOException occurs during marshaling
201    * @throws org.exolab.castor.xml.ValidationException
202    *           if this object is an invalid instance according to the schema
203    * @throws org.exolab.castor.xml.MarshalException
204    *           if object is null or if any SAXException is thrown during
205    *           marshaling
206    */
207   public void marshal(final org.xml.sax.ContentHandler handler)
208           throws java.io.IOException,
209           org.exolab.castor.xml.MarshalException,
210           org.exolab.castor.xml.ValidationException
211   {
212     Marshaller.marshal(this, handler);
213   }
214
215   /**
216    * Sets the value of field 'colour'.
217    * 
218    * @param colour
219    *          the value of field 'colour'.
220    */
221   public void setColour(final int colour)
222   {
223     this._colour = colour;
224     this._has_colour = true;
225   }
226
227   /**
228    * Sets the value of field 'display'.
229    * 
230    * @param display
231    *          the value of field 'display'.
232    */
233   public void setDisplay(final boolean display)
234   {
235     this._display = display;
236     this._has_display = true;
237   }
238
239   /**
240    * Sets the value of field 'type'.
241    * 
242    * @param type
243    *          the value of field 'type'.
244    */
245   public void setType(final java.lang.String type)
246   {
247     this._type = type;
248   }
249
250   /**
251    * Method unmarshal.
252    * 
253    * @param reader
254    * @throws org.exolab.castor.xml.MarshalException
255    *           if object is null or if any SAXException is thrown during
256    *           marshaling
257    * @throws org.exolab.castor.xml.ValidationException
258    *           if this object is an invalid instance according to the schema
259    * @return the unmarshaled jalview.binding.Setting
260    */
261   public static jalview.binding.Setting unmarshal(
262           final java.io.Reader reader)
263           throws org.exolab.castor.xml.MarshalException,
264           org.exolab.castor.xml.ValidationException
265   {
266     return (jalview.binding.Setting) Unmarshaller
267             .unmarshal(jalview.binding.Setting.class, reader);
268   }
269
270   /**
271    * 
272    * 
273    * @throws org.exolab.castor.xml.ValidationException
274    *           if this object is an invalid instance according to the schema
275    */
276   public void validate() throws org.exolab.castor.xml.ValidationException
277   {
278     org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
279     validator.validate(this);
280   }
281
282 }