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