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