extended Colour element with additional optional attributes for graduated colour
[jalview.git] / src / jalview / schemabinding / version2 / StructureState.java
1 /*
2  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.4.1)
3  * Copyright (C) 2009 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
4  * 
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU General Public License
7  * as published by the Free Software Foundation; either version 2
8  * of the License, or (at your option) any later version.
9  * 
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  * 
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
18  */
19 package jalview.schemabinding.version2;
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 StructureState.
30  * 
31  * @version $Revision$ $Date$
32  */
33 public class StructureState implements java.io.Serializable {
34
35
36       //--------------------------/
37      //- Class/Member Variables -/
38     //--------------------------/
39
40     /**
41      * internal content storage
42      */
43     private java.lang.String _content = "";
44
45     /**
46      * Field _visible.
47      */
48     private boolean _visible;
49
50     /**
51      * keeps track of state for field: _visible
52      */
53     private boolean _has_visible;
54
55     /**
56      * Field _xpos.
57      */
58     private int _xpos;
59
60     /**
61      * keeps track of state for field: _xpos
62      */
63     private boolean _has_xpos;
64
65     /**
66      * Field _ypos.
67      */
68     private int _ypos;
69
70     /**
71      * keeps track of state for field: _ypos
72      */
73     private boolean _has_ypos;
74
75     /**
76      * Field _width.
77      */
78     private int _width;
79
80     /**
81      * keeps track of state for field: _width
82      */
83     private boolean _has_width;
84
85     /**
86      * Field _height.
87      */
88     private int _height;
89
90     /**
91      * keeps track of state for field: _height
92      */
93     private boolean _has_height;
94
95     /**
96      * additional identifier which properly disambiguates
97      *  the structure view from any other view with the same
98      * attributes. This is not an ID,
99      *  because it is possible to have many references to the same
100      * physical structure view
101      *  from different sequences in an alignment. A structureState
102      * element citing the same
103      *  viewId will appear for each instance.
104      */
105     private java.lang.String _viewId;
106
107
108       //----------------/
109      //- Constructors -/
110     //----------------/
111
112     public StructureState() {
113         super();
114         setContent("");
115     }
116
117
118       //-----------/
119      //- Methods -/
120     //-----------/
121
122     /**
123      */
124     public void deleteHeight(
125     ) {
126         this._has_height= false;
127     }
128
129     /**
130      */
131     public void deleteVisible(
132     ) {
133         this._has_visible= false;
134     }
135
136     /**
137      */
138     public void deleteWidth(
139     ) {
140         this._has_width= false;
141     }
142
143     /**
144      */
145     public void deleteXpos(
146     ) {
147         this._has_xpos= false;
148     }
149
150     /**
151      */
152     public void deleteYpos(
153     ) {
154         this._has_ypos= false;
155     }
156
157     /**
158      * Returns the value of field 'content'. The field 'content'
159      * has the following description: internal content storage
160      * 
161      * @return the value of field 'Content'.
162      */
163     public java.lang.String getContent(
164     ) {
165         return this._content;
166     }
167
168     /**
169      * Returns the value of field 'height'.
170      * 
171      * @return the value of field 'Height'.
172      */
173     public int getHeight(
174     ) {
175         return this._height;
176     }
177
178     /**
179      * Returns the value of field 'viewId'. The field 'viewId' has
180      * the following description: additional identifier which
181      * properly disambiguates
182      *  the structure view from any other view with the same
183      * attributes. This is not an ID,
184      *  because it is possible to have many references to the same
185      * physical structure view
186      *  from different sequences in an alignment. A structureState
187      * element citing the same
188      *  viewId will appear for each instance.
189      * 
190      * @return the value of field 'ViewId'.
191      */
192     public java.lang.String getViewId(
193     ) {
194         return this._viewId;
195     }
196
197     /**
198      * Returns the value of field 'visible'.
199      * 
200      * @return the value of field 'Visible'.
201      */
202     public boolean getVisible(
203     ) {
204         return this._visible;
205     }
206
207     /**
208      * Returns the value of field 'width'.
209      * 
210      * @return the value of field 'Width'.
211      */
212     public int getWidth(
213     ) {
214         return this._width;
215     }
216
217     /**
218      * Returns the value of field 'xpos'.
219      * 
220      * @return the value of field 'Xpos'.
221      */
222     public int getXpos(
223     ) {
224         return this._xpos;
225     }
226
227     /**
228      * Returns the value of field 'ypos'.
229      * 
230      * @return the value of field 'Ypos'.
231      */
232     public int getYpos(
233     ) {
234         return this._ypos;
235     }
236
237     /**
238      * Method hasHeight.
239      * 
240      * @return true if at least one Height has been added
241      */
242     public boolean hasHeight(
243     ) {
244         return this._has_height;
245     }
246
247     /**
248      * Method hasVisible.
249      * 
250      * @return true if at least one Visible has been added
251      */
252     public boolean hasVisible(
253     ) {
254         return this._has_visible;
255     }
256
257     /**
258      * Method hasWidth.
259      * 
260      * @return true if at least one Width has been added
261      */
262     public boolean hasWidth(
263     ) {
264         return this._has_width;
265     }
266
267     /**
268      * Method hasXpos.
269      * 
270      * @return true if at least one Xpos has been added
271      */
272     public boolean hasXpos(
273     ) {
274         return this._has_xpos;
275     }
276
277     /**
278      * Method hasYpos.
279      * 
280      * @return true if at least one Ypos has been added
281      */
282     public boolean hasYpos(
283     ) {
284         return this._has_ypos;
285     }
286
287     /**
288      * Method isValid.
289      * 
290      * @return true if this object is valid according to the schema
291      */
292     public boolean isValid(
293     ) {
294         try {
295             validate();
296         } catch (org.exolab.castor.xml.ValidationException vex) {
297             return false;
298         }
299         return true;
300     }
301
302     /**
303      * Returns the value of field 'visible'.
304      * 
305      * @return the value of field 'Visible'.
306      */
307     public boolean isVisible(
308     ) {
309         return this._visible;
310     }
311
312     /**
313      * 
314      * 
315      * @param out
316      * @throws org.exolab.castor.xml.MarshalException if object is
317      * null or if any SAXException is thrown during marshaling
318      * @throws org.exolab.castor.xml.ValidationException if this
319      * object is an invalid instance according to the schema
320      */
321     public void marshal(
322             final java.io.Writer out)
323     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
324         Marshaller.marshal(this, out);
325     }
326
327     /**
328      * 
329      * 
330      * @param handler
331      * @throws java.io.IOException if an IOException occurs during
332      * marshaling
333      * @throws org.exolab.castor.xml.ValidationException if this
334      * object is an invalid instance according to the schema
335      * @throws org.exolab.castor.xml.MarshalException if object is
336      * null or if any SAXException is thrown during marshaling
337      */
338     public void marshal(
339             final org.xml.sax.ContentHandler handler)
340     throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
341         Marshaller.marshal(this, handler);
342     }
343
344     /**
345      * Sets the value of field 'content'. The field 'content' has
346      * the following description: internal content storage
347      * 
348      * @param content the value of field 'content'.
349      */
350     public void setContent(
351             final java.lang.String content) {
352         this._content = content;
353     }
354
355     /**
356      * Sets the value of field 'height'.
357      * 
358      * @param height the value of field 'height'.
359      */
360     public void setHeight(
361             final int height) {
362         this._height = height;
363         this._has_height = true;
364     }
365
366     /**
367      * Sets the value of field 'viewId'. The field 'viewId' has the
368      * following description: additional identifier which properly
369      * disambiguates
370      *  the structure view from any other view with the same
371      * attributes. This is not an ID,
372      *  because it is possible to have many references to the same
373      * physical structure view
374      *  from different sequences in an alignment. A structureState
375      * element citing the same
376      *  viewId will appear for each instance.
377      * 
378      * @param viewId the value of field 'viewId'.
379      */
380     public void setViewId(
381             final java.lang.String viewId) {
382         this._viewId = viewId;
383     }
384
385     /**
386      * Sets the value of field 'visible'.
387      * 
388      * @param visible the value of field 'visible'.
389      */
390     public void setVisible(
391             final boolean visible) {
392         this._visible = visible;
393         this._has_visible = true;
394     }
395
396     /**
397      * Sets the value of field 'width'.
398      * 
399      * @param width the value of field 'width'.
400      */
401     public void setWidth(
402             final int width) {
403         this._width = width;
404         this._has_width = true;
405     }
406
407     /**
408      * Sets the value of field 'xpos'.
409      * 
410      * @param xpos the value of field 'xpos'.
411      */
412     public void setXpos(
413             final int xpos) {
414         this._xpos = xpos;
415         this._has_xpos = true;
416     }
417
418     /**
419      * Sets the value of field 'ypos'.
420      * 
421      * @param ypos the value of field 'ypos'.
422      */
423     public void setYpos(
424             final int ypos) {
425         this._ypos = ypos;
426         this._has_ypos = true;
427     }
428
429     /**
430      * Method unmarshal.
431      * 
432      * @param reader
433      * @throws org.exolab.castor.xml.MarshalException if object is
434      * null or if any SAXException is thrown during marshaling
435      * @throws org.exolab.castor.xml.ValidationException if this
436      * object is an invalid instance according to the schema
437      * @return the unmarshaled
438      * jalview.schemabinding.version2.StructureState
439      */
440     public static jalview.schemabinding.version2.StructureState unmarshal(
441             final java.io.Reader reader)
442     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
443         return (jalview.schemabinding.version2.StructureState) Unmarshaller.unmarshal(jalview.schemabinding.version2.StructureState.class, reader);
444     }
445
446     /**
447      * 
448      * 
449      * @throws org.exolab.castor.xml.ValidationException if this
450      * object is an invalid instance according to the schema
451      */
452     public void validate(
453     )
454     throws org.exolab.castor.xml.ValidationException {
455         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
456         validator.validate(this);
457     }
458
459 }