2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.0b1)
3 * Copyright (C) 2014 The Jalview Authors
5 * This file is part of Jalview.
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.
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.
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.
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;
56 * additional identifier which properly disambiguates the structure view from
57 * any other view with the same attributes. This is not an ID, because it is
58 * possible to have many references to the same physical structure view from
59 * different sequences in an alignment. A structureState element citing the
60 * same viewId will appear for each instance.
63 private java.lang.String _viewId;
66 * Flag set if the alignment panel containing this JSeq should be included in
67 * those used to perform a structure superposition (since Jalview 2.7).
70 private boolean _alignwithAlignPanel = true;
73 * keeps track of state for field: _alignwithAlignPanel
75 private boolean _has_alignwithAlignPanel;
78 * Flag set if the alignment panel containing this JSeq should be included in
79 * those used to colour its associated sequences in this structureState(since
83 private boolean _colourwithAlignPanel = false;
86 * keeps track of state for field: _colourwithAlignPanel
88 private boolean _has_colourwithAlignPanel;
91 * Flag set if the structure display is coloured by the Jmol state, rather
92 * than by one or more linked alignment views.
95 private boolean _colourByJmol = true;
98 * keeps track of state for field: _colourByJmol
100 private boolean _has_colourByJmol;
108 * keeps track of state for field: _width
110 private boolean _has_width;
118 * keeps track of state for field: _height
120 private boolean _has_height;
128 * keeps track of state for field: _xpos
130 private boolean _has_xpos;
138 * keeps track of state for field: _ypos
140 private boolean _has_ypos;
146 public StructureState()
158 public void deleteAlignwithAlignPanel()
160 this._has_alignwithAlignPanel = false;
165 public void deleteColourByJmol()
167 this._has_colourByJmol = false;
172 public void deleteColourwithAlignPanel()
174 this._has_colourwithAlignPanel = false;
179 public void deleteHeight()
181 this._has_height = false;
186 public void deleteVisible()
188 this._has_visible = false;
193 public void deleteWidth()
195 this._has_width = false;
200 public void deleteXpos()
202 this._has_xpos = false;
207 public void deleteYpos()
209 this._has_ypos = false;
213 * Returns the value of field 'alignwithAlignPanel'. The field
214 * 'alignwithAlignPanel' has the following description: Flag set if the
215 * alignment panel containing this JSeq should be included in those used to
216 * perform a structure superposition (since Jalview 2.7).
219 * @return the value of field 'AlignwithAlignPanel'.
221 public boolean getAlignwithAlignPanel()
223 return this._alignwithAlignPanel;
227 * Returns the value of field 'colourByJmol'. The field 'colourByJmol' has the
228 * following description: Flag set if the structure display is coloured by the
229 * Jmol state, rather than by one or more linked alignment views.
232 * @return the value of field 'ColourByJmol'.
234 public boolean getColourByJmol()
236 return this._colourByJmol;
240 * Returns the value of field 'colourwithAlignPanel'. The field
241 * 'colourwithAlignPanel' has the following description: Flag set if the
242 * alignment panel containing this JSeq should be included in those used to
243 * colour its associated sequences in this structureState(since Jalview 2.7).
246 * @return the value of field 'ColourwithAlignPanel'.
248 public boolean getColourwithAlignPanel()
250 return this._colourwithAlignPanel;
254 * Returns the value of field 'content'. The field 'content' has the following
255 * description: internal content storage
257 * @return the value of field 'Content'.
259 public java.lang.String getContent()
261 return this._content;
265 * Returns the value of field 'height'.
267 * @return the value of field 'Height'.
269 public int getHeight()
275 * Returns the value of field 'viewId'. The field 'viewId' has the following
276 * description: additional identifier which properly disambiguates the
277 * structure view from any other view with the same attributes. This is not an
278 * ID, because it is possible to have many references to the same physical
279 * structure view from different sequences in an alignment. A structureState
280 * element citing the same viewId will appear for each instance.
283 * @return the value of field 'ViewId'.
285 public java.lang.String getViewId()
291 * Returns the value of field 'visible'.
293 * @return the value of field 'Visible'.
295 public boolean getVisible()
297 return this._visible;
301 * Returns the value of field 'width'.
303 * @return the value of field 'Width'.
305 public int getWidth()
311 * Returns the value of field 'xpos'.
313 * @return the value of field 'Xpos'.
321 * Returns the value of field 'ypos'.
323 * @return the value of field 'Ypos'.
331 * Method hasAlignwithAlignPanel.
333 * @return true if at least one AlignwithAlignPanel has been added
335 public boolean hasAlignwithAlignPanel()
337 return this._has_alignwithAlignPanel;
341 * Method hasColourByJmol.
343 * @return true if at least one ColourByJmol has been added
345 public boolean hasColourByJmol()
347 return this._has_colourByJmol;
351 * Method hasColourwithAlignPanel.
353 * @return true if at least one ColourwithAlignPanel has been added
355 public boolean hasColourwithAlignPanel()
357 return this._has_colourwithAlignPanel;
363 * @return true if at least one Height has been added
365 public boolean hasHeight()
367 return this._has_height;
373 * @return true if at least one Visible has been added
375 public boolean hasVisible()
377 return this._has_visible;
383 * @return true if at least one Width has been added
385 public boolean hasWidth()
387 return this._has_width;
393 * @return true if at least one Xpos has been added
395 public boolean hasXpos()
397 return this._has_xpos;
403 * @return true if at least one Ypos has been added
405 public boolean hasYpos()
407 return this._has_ypos;
411 * Returns the value of field 'alignwithAlignPanel'. The field
412 * 'alignwithAlignPanel' has the following description: Flag set if the
413 * alignment panel containing this JSeq should be included in those used to
414 * perform a structure superposition (since Jalview 2.7).
417 * @return the value of field 'AlignwithAlignPanel'.
419 public boolean isAlignwithAlignPanel()
421 return this._alignwithAlignPanel;
425 * Returns the value of field 'colourByJmol'. The field 'colourByJmol' has the
426 * following description: Flag set if the structure display is coloured by the
427 * Jmol state, rather than by one or more linked alignment views.
430 * @return the value of field 'ColourByJmol'.
432 public boolean isColourByJmol()
434 return this._colourByJmol;
438 * Returns the value of field 'colourwithAlignPanel'. The field
439 * 'colourwithAlignPanel' has the following description: Flag set if the
440 * alignment panel containing this JSeq should be included in those used to
441 * colour its associated sequences in this structureState(since Jalview 2.7).
444 * @return the value of field 'ColourwithAlignPanel'.
446 public boolean isColourwithAlignPanel()
448 return this._colourwithAlignPanel;
454 * @return true if this object is valid according to the schema
456 public boolean isValid()
461 } catch (org.exolab.castor.xml.ValidationException vex)
469 * Returns the value of field 'visible'.
471 * @return the value of field 'Visible'.
473 public boolean isVisible()
475 return this._visible;
482 * @throws org.exolab.castor.xml.MarshalException
483 * if object is null or if any SAXException is thrown during
485 * @throws org.exolab.castor.xml.ValidationException
486 * if this object is an invalid instance according to the schema
488 public void marshal(final java.io.Writer out)
489 throws org.exolab.castor.xml.MarshalException,
490 org.exolab.castor.xml.ValidationException
492 Marshaller.marshal(this, out);
499 * @throws java.io.IOException
500 * if an IOException occurs during marshaling
501 * @throws org.exolab.castor.xml.ValidationException
502 * if this object is an invalid instance according to the schema
503 * @throws org.exolab.castor.xml.MarshalException
504 * if object is null or if any SAXException is thrown during
507 public void marshal(final org.xml.sax.ContentHandler handler)
508 throws java.io.IOException,
509 org.exolab.castor.xml.MarshalException,
510 org.exolab.castor.xml.ValidationException
512 Marshaller.marshal(this, handler);
516 * Sets the value of field 'alignwithAlignPanel'. The field
517 * 'alignwithAlignPanel' has the following description: Flag set if the
518 * alignment panel containing this JSeq should be included in those used to
519 * perform a structure superposition (since Jalview 2.7).
522 * @param alignwithAlignPanel
523 * the value of field 'alignwithAlignPanel'.
525 public void setAlignwithAlignPanel(final boolean alignwithAlignPanel)
527 this._alignwithAlignPanel = alignwithAlignPanel;
528 this._has_alignwithAlignPanel = true;
532 * Sets the value of field 'colourByJmol'. The field 'colourByJmol' has the
533 * following description: Flag set if the structure display is coloured by the
534 * Jmol state, rather than by one or more linked alignment views.
537 * @param colourByJmol
538 * the value of field 'colourByJmol'.
540 public void setColourByJmol(final boolean colourByJmol)
542 this._colourByJmol = colourByJmol;
543 this._has_colourByJmol = true;
547 * Sets the value of field 'colourwithAlignPanel'. The field
548 * 'colourwithAlignPanel' has the following description: Flag set if the
549 * alignment panel containing this JSeq should be included in those used to
550 * colour its associated sequences in this structureState(since Jalview 2.7).
553 * @param colourwithAlignPanel
554 * the value of field 'colourwithAlignPanel'.
556 public void setColourwithAlignPanel(final boolean colourwithAlignPanel)
558 this._colourwithAlignPanel = colourwithAlignPanel;
559 this._has_colourwithAlignPanel = true;
563 * Sets the value of field 'content'. The field 'content' has the following
564 * description: internal content storage
567 * the value of field 'content'.
569 public void setContent(final java.lang.String content)
571 this._content = content;
575 * Sets the value of field 'height'.
578 * the value of field 'height'.
580 public void setHeight(final int height)
582 this._height = height;
583 this._has_height = true;
587 * Sets the value of field 'viewId'. The field 'viewId' has the following
588 * description: additional identifier which properly disambiguates the
589 * structure view from any other view with the same attributes. This is not an
590 * ID, because it is possible to have many references to the same physical
591 * structure view from different sequences in an alignment. A structureState
592 * element citing the same viewId will appear for each instance.
596 * the value of field 'viewId'.
598 public void setViewId(final java.lang.String viewId)
600 this._viewId = viewId;
604 * Sets the value of field 'visible'.
607 * the value of field 'visible'.
609 public void setVisible(final boolean visible)
611 this._visible = visible;
612 this._has_visible = true;
616 * Sets the value of field 'width'.
619 * the value of field 'width'.
621 public void setWidth(final int width)
624 this._has_width = true;
628 * Sets the value of field 'xpos'.
631 * the value of field 'xpos'.
633 public void setXpos(final int xpos)
636 this._has_xpos = true;
640 * Sets the value of field 'ypos'.
643 * the value of field 'ypos'.
645 public void setYpos(final int ypos)
648 this._has_ypos = true;
655 * @throws org.exolab.castor.xml.MarshalException
656 * if object is null or if any SAXException is thrown during
658 * @throws org.exolab.castor.xml.ValidationException
659 * if this object is an invalid instance according to the schema
660 * @return the unmarshaled jalview.schemabinding.version2.StructureState
662 public static jalview.schemabinding.version2.StructureState unmarshal(
663 final java.io.Reader reader)
664 throws org.exolab.castor.xml.MarshalException,
665 org.exolab.castor.xml.ValidationException
667 return (jalview.schemabinding.version2.StructureState) Unmarshaller
668 .unmarshal(jalview.schemabinding.version2.StructureState.class,
675 * @throws org.exolab.castor.xml.ValidationException
676 * if this object is an invalid instance according to the schema
678 public void validate() throws org.exolab.castor.xml.ValidationException
680 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
681 validator.validate(this);