2 * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3 * Copyright (C) $$Year-Rel$$ 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
10 * of the License, or (at your option) any later version.
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.
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.
21 package jalview.schemabinding.version2;
23 //---------------------------------/
24 //- Imported classes and packages -/
25 //---------------------------------/
27 import org.exolab.castor.xml.Marshaller;
28 import org.exolab.castor.xml.Unmarshaller;
31 * Class StructureState.
33 * @version $Revision$ $Date$
35 public class StructureState implements java.io.Serializable
38 // --------------------------/
39 // - Class/Member Variables -/
40 // --------------------------/
43 * internal content storage
45 private java.lang.String _content = "";
50 private boolean _visible;
53 * keeps track of state for field: _visible
55 private boolean _has_visible;
58 * additional identifier which properly disambiguates the structure view from
59 * any other view with the same attributes. This is not an ID, because it is
60 * possible to have many references to the same physical structure view from
61 * different sequences in an alignment. A structureState element citing the
62 * same viewId will appear for each instance.
65 private java.lang.String _viewId;
68 * Flag set if the alignment panel containing this JSeq should be included in
69 * those used to perform a structure superposition (since Jalview 2.7).
72 private boolean _alignwithAlignPanel = true;
75 * keeps track of state for field: _alignwithAlignPanel
77 private boolean _has_alignwithAlignPanel;
80 * Flag set if the alignment panel containing this JSeq should be included in
81 * those used to colour its associated sequences in this structureState(since
85 private boolean _colourwithAlignPanel = false;
88 * keeps track of state for field: _colourwithAlignPanel
90 private boolean _has_colourwithAlignPanel;
93 * Flag set if the structure display is coloured by the Jmol state, rather
94 * than by one or more linked alignment views.
97 private boolean _colourByJmol = true;
100 * keeps track of state for field: _colourByJmol
102 private boolean _has_colourByJmol;
110 * keeps track of state for field: _width
112 private boolean _has_width;
120 * keeps track of state for field: _height
122 private boolean _has_height;
130 * keeps track of state for field: _xpos
132 private boolean _has_xpos;
140 * keeps track of state for field: _ypos
142 private boolean _has_ypos;
148 public StructureState()
160 public void deleteAlignwithAlignPanel()
162 this._has_alignwithAlignPanel = false;
167 public void deleteColourByJmol()
169 this._has_colourByJmol = false;
174 public void deleteColourwithAlignPanel()
176 this._has_colourwithAlignPanel = false;
181 public void deleteHeight()
183 this._has_height = false;
188 public void deleteVisible()
190 this._has_visible = false;
195 public void deleteWidth()
197 this._has_width = false;
202 public void deleteXpos()
204 this._has_xpos = false;
209 public void deleteYpos()
211 this._has_ypos = false;
215 * Returns the value of field 'alignwithAlignPanel'. The field
216 * 'alignwithAlignPanel' has the following description: Flag set if the
217 * alignment panel containing this JSeq should be included in those used to
218 * perform a structure superposition (since Jalview 2.7).
221 * @return the value of field 'AlignwithAlignPanel'.
223 public boolean getAlignwithAlignPanel()
225 return this._alignwithAlignPanel;
229 * Returns the value of field 'colourByJmol'. The field 'colourByJmol' has the
230 * following description: Flag set if the structure display is coloured by the
231 * Jmol state, rather than by one or more linked alignment views.
234 * @return the value of field 'ColourByJmol'.
236 public boolean getColourByJmol()
238 return this._colourByJmol;
242 * Returns the value of field 'colourwithAlignPanel'. The field
243 * 'colourwithAlignPanel' has the following description: Flag set if the
244 * alignment panel containing this JSeq should be included in those used to
245 * colour its associated sequences in this structureState(since Jalview 2.7).
248 * @return the value of field 'ColourwithAlignPanel'.
250 public boolean getColourwithAlignPanel()
252 return this._colourwithAlignPanel;
256 * Returns the value of field 'content'. The field 'content' has the following
257 * description: internal content storage
259 * @return the value of field 'Content'.
261 public java.lang.String getContent()
263 return this._content;
267 * Returns the value of field 'height'.
269 * @return the value of field 'Height'.
271 public int getHeight()
277 * Returns the value of field 'viewId'. The field 'viewId' has the following
278 * description: additional identifier which properly disambiguates the
279 * structure view from any other view with the same attributes. This is not an
280 * ID, because it is possible to have many references to the same physical
281 * structure view from different sequences in an alignment. A structureState
282 * element citing the same viewId will appear for each instance.
285 * @return the value of field 'ViewId'.
287 public java.lang.String getViewId()
293 * Returns the value of field 'visible'.
295 * @return the value of field 'Visible'.
297 public boolean getVisible()
299 return this._visible;
303 * Returns the value of field 'width'.
305 * @return the value of field 'Width'.
307 public int getWidth()
313 * Returns the value of field 'xpos'.
315 * @return the value of field 'Xpos'.
323 * Returns the value of field 'ypos'.
325 * @return the value of field 'Ypos'.
333 * Method hasAlignwithAlignPanel.
335 * @return true if at least one AlignwithAlignPanel has been added
337 public boolean hasAlignwithAlignPanel()
339 return this._has_alignwithAlignPanel;
343 * Method hasColourByJmol.
345 * @return true if at least one ColourByJmol has been added
347 public boolean hasColourByJmol()
349 return this._has_colourByJmol;
353 * Method hasColourwithAlignPanel.
355 * @return true if at least one ColourwithAlignPanel has been added
357 public boolean hasColourwithAlignPanel()
359 return this._has_colourwithAlignPanel;
365 * @return true if at least one Height has been added
367 public boolean hasHeight()
369 return this._has_height;
375 * @return true if at least one Visible has been added
377 public boolean hasVisible()
379 return this._has_visible;
385 * @return true if at least one Width has been added
387 public boolean hasWidth()
389 return this._has_width;
395 * @return true if at least one Xpos has been added
397 public boolean hasXpos()
399 return this._has_xpos;
405 * @return true if at least one Ypos has been added
407 public boolean hasYpos()
409 return this._has_ypos;
413 * Returns the value of field 'alignwithAlignPanel'. The field
414 * 'alignwithAlignPanel' has the following description: Flag set if the
415 * alignment panel containing this JSeq should be included in those used to
416 * perform a structure superposition (since Jalview 2.7).
419 * @return the value of field 'AlignwithAlignPanel'.
421 public boolean isAlignwithAlignPanel()
423 return this._alignwithAlignPanel;
427 * Returns the value of field 'colourByJmol'. The field 'colourByJmol' has the
428 * following description: Flag set if the structure display is coloured by the
429 * Jmol state, rather than by one or more linked alignment views.
432 * @return the value of field 'ColourByJmol'.
434 public boolean isColourByJmol()
436 return this._colourByJmol;
440 * Returns the value of field 'colourwithAlignPanel'. The field
441 * 'colourwithAlignPanel' has the following description: Flag set if the
442 * alignment panel containing this JSeq should be included in those used to
443 * colour its associated sequences in this structureState(since Jalview 2.7).
446 * @return the value of field 'ColourwithAlignPanel'.
448 public boolean isColourwithAlignPanel()
450 return this._colourwithAlignPanel;
456 * @return true if this object is valid according to the schema
458 public boolean isValid()
463 } catch (org.exolab.castor.xml.ValidationException vex)
471 * Returns the value of field 'visible'.
473 * @return the value of field 'Visible'.
475 public boolean isVisible()
477 return this._visible;
484 * @throws org.exolab.castor.xml.MarshalException
485 * if object is null or if any SAXException is thrown during
487 * @throws org.exolab.castor.xml.ValidationException
488 * if this object is an invalid instance according to the schema
490 public void marshal(final java.io.Writer out)
491 throws org.exolab.castor.xml.MarshalException,
492 org.exolab.castor.xml.ValidationException
494 Marshaller.marshal(this, out);
501 * @throws java.io.IOException
502 * if an IOException occurs during marshaling
503 * @throws org.exolab.castor.xml.ValidationException
504 * if this object is an invalid instance according to the schema
505 * @throws org.exolab.castor.xml.MarshalException
506 * if object is null or if any SAXException is thrown during
509 public void marshal(final org.xml.sax.ContentHandler handler)
510 throws java.io.IOException,
511 org.exolab.castor.xml.MarshalException,
512 org.exolab.castor.xml.ValidationException
514 Marshaller.marshal(this, handler);
518 * Sets the value of field 'alignwithAlignPanel'. The field
519 * 'alignwithAlignPanel' has the following description: Flag set if the
520 * alignment panel containing this JSeq should be included in those used to
521 * perform a structure superposition (since Jalview 2.7).
524 * @param alignwithAlignPanel
525 * the value of field 'alignwithAlignPanel'.
527 public void setAlignwithAlignPanel(final boolean alignwithAlignPanel)
529 this._alignwithAlignPanel = alignwithAlignPanel;
530 this._has_alignwithAlignPanel = true;
534 * Sets the value of field 'colourByJmol'. The field 'colourByJmol' has the
535 * following description: Flag set if the structure display is coloured by the
536 * Jmol state, rather than by one or more linked alignment views.
539 * @param colourByJmol
540 * the value of field 'colourByJmol'.
542 public void setColourByJmol(final boolean colourByJmol)
544 this._colourByJmol = colourByJmol;
545 this._has_colourByJmol = true;
549 * Sets the value of field 'colourwithAlignPanel'. The field
550 * 'colourwithAlignPanel' has the following description: Flag set if the
551 * alignment panel containing this JSeq should be included in those used to
552 * colour its associated sequences in this structureState(since Jalview 2.7).
555 * @param colourwithAlignPanel
556 * the value of field 'colourwithAlignPanel'.
558 public void setColourwithAlignPanel(final boolean colourwithAlignPanel)
560 this._colourwithAlignPanel = colourwithAlignPanel;
561 this._has_colourwithAlignPanel = true;
565 * Sets the value of field 'content'. The field 'content' has the following
566 * description: internal content storage
569 * the value of field 'content'.
571 public void setContent(final java.lang.String content)
573 this._content = content;
577 * Sets the value of field 'height'.
580 * the value of field 'height'.
582 public void setHeight(final int height)
584 this._height = height;
585 this._has_height = true;
589 * Sets the value of field 'viewId'. The field 'viewId' has the following
590 * description: additional identifier which properly disambiguates the
591 * structure view from any other view with the same attributes. This is not an
592 * ID, because it is possible to have many references to the same physical
593 * structure view from different sequences in an alignment. A structureState
594 * element citing the same viewId will appear for each instance.
598 * the value of field 'viewId'.
600 public void setViewId(final java.lang.String viewId)
602 this._viewId = viewId;
606 * Sets the value of field 'visible'.
609 * the value of field 'visible'.
611 public void setVisible(final boolean visible)
613 this._visible = visible;
614 this._has_visible = true;
618 * Sets the value of field 'width'.
621 * the value of field 'width'.
623 public void setWidth(final int width)
626 this._has_width = true;
630 * Sets the value of field 'xpos'.
633 * the value of field 'xpos'.
635 public void setXpos(final int xpos)
638 this._has_xpos = true;
642 * Sets the value of field 'ypos'.
645 * the value of field 'ypos'.
647 public void setYpos(final int ypos)
650 this._has_ypos = true;
657 * @throws org.exolab.castor.xml.MarshalException
658 * if object is null or if any SAXException is thrown during
660 * @throws org.exolab.castor.xml.ValidationException
661 * if this object is an invalid instance according to the schema
662 * @return the unmarshaled jalview.schemabinding.version2.StructureState
664 public static jalview.schemabinding.version2.StructureState unmarshal(
665 final java.io.Reader reader)
666 throws org.exolab.castor.xml.MarshalException,
667 org.exolab.castor.xml.ValidationException
669 return (jalview.schemabinding.version2.StructureState) Unmarshaller
670 .unmarshal(jalview.schemabinding.version2.StructureState.class,
677 * @throws org.exolab.castor.xml.ValidationException
678 * if this object is an invalid instance according to the schema
680 public void validate() throws org.exolab.castor.xml.ValidationException
682 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
683 validator.validate(this);