2 * Jalview - A Sequence Alignment Editor and Viewer (Development Version 2.4.1)
3 * Copyright (C) 2009 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
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.
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.
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
19 package jalview.schemabinding.version2;
21 //---------------------------------/
22 //- Imported classes and packages -/
23 //---------------------------------/
25 import org.exolab.castor.xml.Marshaller;
26 import org.exolab.castor.xml.Unmarshaller;
29 * Class StructureState.
31 * @version $Revision$ $Date$
33 public class StructureState implements java.io.Serializable {
36 //--------------------------/
37 //- Class/Member Variables -/
38 //--------------------------/
41 * internal content storage
43 private java.lang.String _content = "";
48 private boolean _visible;
51 * keeps track of state for field: _visible
53 private boolean _has_visible;
61 * keeps track of state for field: _xpos
63 private boolean _has_xpos;
71 * keeps track of state for field: _ypos
73 private boolean _has_ypos;
81 * keeps track of state for field: _width
83 private boolean _has_width;
91 * keeps track of state for field: _height
93 private boolean _has_height;
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.
105 private java.lang.String _viewId;
112 public StructureState() {
124 public void deleteHeight(
126 this._has_height= false;
131 public void deleteVisible(
133 this._has_visible= false;
138 public void deleteWidth(
140 this._has_width= false;
145 public void deleteXpos(
147 this._has_xpos= false;
152 public void deleteYpos(
154 this._has_ypos= false;
158 * Returns the value of field 'content'. The field 'content'
159 * has the following description: internal content storage
161 * @return the value of field 'Content'.
163 public java.lang.String getContent(
165 return this._content;
169 * Returns the value of field 'height'.
171 * @return the value of field 'Height'.
173 public int getHeight(
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.
190 * @return the value of field 'ViewId'.
192 public java.lang.String getViewId(
198 * Returns the value of field 'visible'.
200 * @return the value of field 'Visible'.
202 public boolean getVisible(
204 return this._visible;
208 * Returns the value of field 'width'.
210 * @return the value of field 'Width'.
218 * Returns the value of field 'xpos'.
220 * @return the value of field 'Xpos'.
228 * Returns the value of field 'ypos'.
230 * @return the value of field 'Ypos'.
240 * @return true if at least one Height has been added
242 public boolean hasHeight(
244 return this._has_height;
250 * @return true if at least one Visible has been added
252 public boolean hasVisible(
254 return this._has_visible;
260 * @return true if at least one Width has been added
262 public boolean hasWidth(
264 return this._has_width;
270 * @return true if at least one Xpos has been added
272 public boolean hasXpos(
274 return this._has_xpos;
280 * @return true if at least one Ypos has been added
282 public boolean hasYpos(
284 return this._has_ypos;
290 * @return true if this object is valid according to the schema
292 public boolean isValid(
296 } catch (org.exolab.castor.xml.ValidationException vex) {
303 * Returns the value of field 'visible'.
305 * @return the value of field 'Visible'.
307 public boolean isVisible(
309 return this._visible;
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
322 final java.io.Writer out)
323 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
324 Marshaller.marshal(this, out);
331 * @throws java.io.IOException if an IOException occurs during
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
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);
345 * Sets the value of field 'content'. The field 'content' has
346 * the following description: internal content storage
348 * @param content the value of field 'content'.
350 public void setContent(
351 final java.lang.String content) {
352 this._content = content;
356 * Sets the value of field 'height'.
358 * @param height the value of field 'height'.
360 public void setHeight(
362 this._height = height;
363 this._has_height = true;
367 * Sets the value of field 'viewId'. The field 'viewId' has the
368 * following description: additional identifier which properly
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.
378 * @param viewId the value of field 'viewId'.
380 public void setViewId(
381 final java.lang.String viewId) {
382 this._viewId = viewId;
386 * Sets the value of field 'visible'.
388 * @param visible the value of field 'visible'.
390 public void setVisible(
391 final boolean visible) {
392 this._visible = visible;
393 this._has_visible = true;
397 * Sets the value of field 'width'.
399 * @param width the value of field 'width'.
401 public void setWidth(
404 this._has_width = true;
408 * Sets the value of field 'xpos'.
410 * @param xpos the value of field 'xpos'.
415 this._has_xpos = true;
419 * Sets the value of field 'ypos'.
421 * @param ypos the value of field 'ypos'.
426 this._has_ypos = true;
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
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);
449 * @throws org.exolab.castor.xml.ValidationException if this
450 * object is an invalid instance according to the schema
452 public void validate(
454 throws org.exolab.castor.xml.ValidationException {
455 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
456 validator.validate(this);