2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.4)
3 * Copyright (C) 2008 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;
99 public StructureState()
111 public void deleteHeight()
113 this._has_height = false;
118 public void deleteVisible()
120 this._has_visible = false;
125 public void deleteWidth()
127 this._has_width = false;
132 public void deleteXpos()
134 this._has_xpos = false;
139 public void deleteYpos()
141 this._has_ypos = false;
145 * Returns the value of field 'content'. The field 'content' has the following
146 * description: internal content storage
148 * @return the value of field 'Content'.
150 public java.lang.String getContent()
152 return this._content;
156 * Returns the value of field 'height'.
158 * @return the value of field 'Height'.
160 public int getHeight()
166 * Returns the value of field 'visible'.
168 * @return the value of field 'Visible'.
170 public boolean getVisible()
172 return this._visible;
176 * Returns the value of field 'width'.
178 * @return the value of field 'Width'.
180 public int getWidth()
186 * Returns the value of field 'xpos'.
188 * @return the value of field 'Xpos'.
196 * Returns the value of field 'ypos'.
198 * @return the value of field 'Ypos'.
208 * @return true if at least one Height has been added
210 public boolean hasHeight()
212 return this._has_height;
218 * @return true if at least one Visible has been added
220 public boolean hasVisible()
222 return this._has_visible;
228 * @return true if at least one Width has been added
230 public boolean hasWidth()
232 return this._has_width;
238 * @return true if at least one Xpos has been added
240 public boolean hasXpos()
242 return this._has_xpos;
248 * @return true if at least one Ypos has been added
250 public boolean hasYpos()
252 return this._has_ypos;
258 * @return true if this object is valid according to the schema
260 public boolean isValid()
265 } catch (org.exolab.castor.xml.ValidationException vex)
273 * Returns the value of field 'visible'.
275 * @return the value of field 'Visible'.
277 public boolean isVisible()
279 return this._visible;
286 * @throws org.exolab.castor.xml.MarshalException
287 * if object is null or if any SAXException is thrown during
289 * @throws org.exolab.castor.xml.ValidationException
290 * if this object is an invalid instance according to the
293 public void marshal(final java.io.Writer out)
294 throws org.exolab.castor.xml.MarshalException,
295 org.exolab.castor.xml.ValidationException
297 Marshaller.marshal(this, out);
304 * @throws java.io.IOException
305 * if an IOException occurs during marshaling
306 * @throws org.exolab.castor.xml.ValidationException
307 * if this object is an invalid instance according to the
309 * @throws org.exolab.castor.xml.MarshalException
310 * if object is null or if any SAXException is thrown during
313 public void marshal(final org.xml.sax.ContentHandler handler)
314 throws java.io.IOException,
315 org.exolab.castor.xml.MarshalException,
316 org.exolab.castor.xml.ValidationException
318 Marshaller.marshal(this, handler);
322 * Sets the value of field 'content'. The field 'content' has the following
323 * description: internal content storage
326 * the value of field 'content'.
328 public void setContent(final java.lang.String content)
330 this._content = content;
334 * Sets the value of field 'height'.
337 * the value of field 'height'.
339 public void setHeight(final int height)
341 this._height = height;
342 this._has_height = true;
346 * Sets the value of field 'visible'.
349 * the value of field 'visible'.
351 public void setVisible(final boolean visible)
353 this._visible = visible;
354 this._has_visible = true;
358 * Sets the value of field 'width'.
361 * the value of field 'width'.
363 public void setWidth(final int width)
366 this._has_width = true;
370 * Sets the value of field 'xpos'.
373 * the value of field 'xpos'.
375 public void setXpos(final int xpos)
378 this._has_xpos = true;
382 * Sets the value of field 'ypos'.
385 * the value of field 'ypos'.
387 public void setYpos(final int ypos)
390 this._has_ypos = true;
397 * @throws org.exolab.castor.xml.MarshalException
398 * if object is null or if any SAXException is thrown during
400 * @throws org.exolab.castor.xml.ValidationException
401 * if this object is an invalid instance according to the
403 * @return the unmarshaled jalview.schemabinding.version2.StructureState
405 public static jalview.schemabinding.version2.StructureState unmarshal(
406 final java.io.Reader reader)
407 throws org.exolab.castor.xml.MarshalException,
408 org.exolab.castor.xml.ValidationException
410 return (jalview.schemabinding.version2.StructureState) Unmarshaller
411 .unmarshal(jalview.schemabinding.version2.StructureState.class,
418 * @throws org.exolab.castor.xml.ValidationException
419 * if this object is an invalid instance according to the
422 public void validate() throws org.exolab.castor.xml.ValidationException
424 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
425 validator.validate(this);