2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8)
3 * Copyright (C) 2012 J Procter, AM Waterhouse, LM Lui, J Engelhardt, G Barton, M Clamp, S Searle
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/>.
18 package jalview.schemabinding.version2;
20 //---------------------------------/
21 //- Imported classes and packages -/
22 //---------------------------------/
24 import org.exolab.castor.xml.Marshaller;
25 import org.exolab.castor.xml.Unmarshaller;
28 * Class StructureState.
30 * @version $Revision$ $Date$
32 public class StructureState implements java.io.Serializable
35 // --------------------------/
36 // - Class/Member Variables -/
37 // --------------------------/
40 * internal content storage
42 private java.lang.String _content = "";
47 private boolean _visible;
50 * keeps track of state for field: _visible
52 private boolean _has_visible;
55 * additional identifier which properly disambiguates the structure view from
56 * any other view with the same attributes. This is not an ID, because it is
57 * possible to have many references to the same physical structure view from
58 * different sequences in an alignment. A structureState element citing the
59 * same viewId will appear for each instance.
62 private java.lang.String _viewId;
65 * Flag set if the alignment panel containing this JSeq should be included in
66 * those used to perform a structure superposition (since Jalview 2.7).
69 private boolean _alignwithAlignPanel = true;
72 * keeps track of state for field: _alignwithAlignPanel
74 private boolean _has_alignwithAlignPanel;
77 * Flag set if the alignment panel containing this JSeq should be included in
78 * those used to colour its associated sequences in this structureState(since
82 private boolean _colourwithAlignPanel = false;
85 * keeps track of state for field: _colourwithAlignPanel
87 private boolean _has_colourwithAlignPanel;
90 * Flag set if the structure display is coloured by the Jmol state, rather
91 * than by one or more linked alignment views.
94 private boolean _colourByJmol = true;
97 * keeps track of state for field: _colourByJmol
99 private boolean _has_colourByJmol;
107 * keeps track of state for field: _width
109 private boolean _has_width;
117 * keeps track of state for field: _height
119 private boolean _has_height;
127 * keeps track of state for field: _xpos
129 private boolean _has_xpos;
137 * keeps track of state for field: _ypos
139 private boolean _has_ypos;
145 public StructureState()
157 public void deleteAlignwithAlignPanel()
159 this._has_alignwithAlignPanel = false;
164 public void deleteColourByJmol()
166 this._has_colourByJmol = false;
171 public void deleteColourwithAlignPanel()
173 this._has_colourwithAlignPanel = false;
178 public void deleteHeight()
180 this._has_height = false;
185 public void deleteVisible()
187 this._has_visible = false;
192 public void deleteWidth()
194 this._has_width = false;
199 public void deleteXpos()
201 this._has_xpos = false;
206 public void deleteYpos()
208 this._has_ypos = false;
212 * Returns the value of field 'alignwithAlignPanel'. The field
213 * 'alignwithAlignPanel' has the following description: Flag set if the
214 * alignment panel containing this JSeq should be included in those used to
215 * perform a structure superposition (since Jalview 2.7).
218 * @return the value of field 'AlignwithAlignPanel'.
220 public boolean getAlignwithAlignPanel()
222 return this._alignwithAlignPanel;
226 * Returns the value of field 'colourByJmol'. The field 'colourByJmol' has the
227 * following description: Flag set if the structure display is coloured by the
228 * Jmol state, rather than by one or more linked alignment views.
231 * @return the value of field 'ColourByJmol'.
233 public boolean getColourByJmol()
235 return this._colourByJmol;
239 * Returns the value of field 'colourwithAlignPanel'. The field
240 * 'colourwithAlignPanel' has the following description: Flag set if the
241 * alignment panel containing this JSeq should be included in those used to
242 * colour its associated sequences in this structureState(since Jalview 2.7).
245 * @return the value of field 'ColourwithAlignPanel'.
247 public boolean getColourwithAlignPanel()
249 return this._colourwithAlignPanel;
253 * Returns the value of field 'content'. The field 'content' has the following
254 * description: internal content storage
256 * @return the value of field 'Content'.
258 public java.lang.String getContent()
260 return this._content;
264 * Returns the value of field 'height'.
266 * @return the value of field 'Height'.
268 public int getHeight()
274 * Returns the value of field 'viewId'. The field 'viewId' has the following
275 * description: additional identifier which properly disambiguates the
276 * structure view from any other view with the same attributes. This is not an
277 * ID, because it is possible to have many references to the same physical
278 * structure view from different sequences in an alignment. A structureState
279 * element citing the same viewId will appear for each instance.
282 * @return the value of field 'ViewId'.
284 public java.lang.String getViewId()
290 * Returns the value of field 'visible'.
292 * @return the value of field 'Visible'.
294 public boolean getVisible()
296 return this._visible;
300 * Returns the value of field 'width'.
302 * @return the value of field 'Width'.
304 public int getWidth()
310 * Returns the value of field 'xpos'.
312 * @return the value of field 'Xpos'.
320 * Returns the value of field 'ypos'.
322 * @return the value of field 'Ypos'.
330 * Method hasAlignwithAlignPanel.
332 * @return true if at least one AlignwithAlignPanel has been added
334 public boolean hasAlignwithAlignPanel()
336 return this._has_alignwithAlignPanel;
340 * Method hasColourByJmol.
342 * @return true if at least one ColourByJmol has been added
344 public boolean hasColourByJmol()
346 return this._has_colourByJmol;
350 * Method hasColourwithAlignPanel.
352 * @return true if at least one ColourwithAlignPanel has been added
354 public boolean hasColourwithAlignPanel()
356 return this._has_colourwithAlignPanel;
362 * @return true if at least one Height has been added
364 public boolean hasHeight()
366 return this._has_height;
372 * @return true if at least one Visible has been added
374 public boolean hasVisible()
376 return this._has_visible;
382 * @return true if at least one Width has been added
384 public boolean hasWidth()
386 return this._has_width;
392 * @return true if at least one Xpos has been added
394 public boolean hasXpos()
396 return this._has_xpos;
402 * @return true if at least one Ypos has been added
404 public boolean hasYpos()
406 return this._has_ypos;
410 * Returns the value of field 'alignwithAlignPanel'. The field
411 * 'alignwithAlignPanel' has the following description: Flag set if the
412 * alignment panel containing this JSeq should be included in those used to
413 * perform a structure superposition (since Jalview 2.7).
416 * @return the value of field 'AlignwithAlignPanel'.
418 public boolean isAlignwithAlignPanel()
420 return this._alignwithAlignPanel;
424 * Returns the value of field 'colourByJmol'. The field 'colourByJmol' has the
425 * following description: Flag set if the structure display is coloured by the
426 * Jmol state, rather than by one or more linked alignment views.
429 * @return the value of field 'ColourByJmol'.
431 public boolean isColourByJmol()
433 return this._colourByJmol;
437 * Returns the value of field 'colourwithAlignPanel'. The field
438 * 'colourwithAlignPanel' has the following description: Flag set if the
439 * alignment panel containing this JSeq should be included in those used to
440 * colour its associated sequences in this structureState(since Jalview 2.7).
443 * @return the value of field 'ColourwithAlignPanel'.
445 public boolean isColourwithAlignPanel()
447 return this._colourwithAlignPanel;
453 * @return true if this object is valid according to the schema
455 public boolean isValid()
460 } catch (org.exolab.castor.xml.ValidationException vex)
468 * Returns the value of field 'visible'.
470 * @return the value of field 'Visible'.
472 public boolean isVisible()
474 return this._visible;
481 * @throws org.exolab.castor.xml.MarshalException
482 * if object is null or if any SAXException is thrown during
484 * @throws org.exolab.castor.xml.ValidationException
485 * if this object is an invalid instance according to the schema
487 public void marshal(final java.io.Writer out)
488 throws org.exolab.castor.xml.MarshalException,
489 org.exolab.castor.xml.ValidationException
491 Marshaller.marshal(this, out);
498 * @throws java.io.IOException
499 * if an IOException occurs during marshaling
500 * @throws org.exolab.castor.xml.ValidationException
501 * if this object is an invalid instance according to the schema
502 * @throws org.exolab.castor.xml.MarshalException
503 * if object is null or if any SAXException is thrown during
506 public void marshal(final org.xml.sax.ContentHandler handler)
507 throws java.io.IOException,
508 org.exolab.castor.xml.MarshalException,
509 org.exolab.castor.xml.ValidationException
511 Marshaller.marshal(this, handler);
515 * Sets the value of field 'alignwithAlignPanel'. The field
516 * 'alignwithAlignPanel' has the following description: Flag set if the
517 * alignment panel containing this JSeq should be included in those used to
518 * perform a structure superposition (since Jalview 2.7).
521 * @param alignwithAlignPanel
522 * the value of field 'alignwithAlignPanel'.
524 public void setAlignwithAlignPanel(final boolean alignwithAlignPanel)
526 this._alignwithAlignPanel = alignwithAlignPanel;
527 this._has_alignwithAlignPanel = true;
531 * Sets the value of field 'colourByJmol'. The field 'colourByJmol' has the
532 * following description: Flag set if the structure display is coloured by the
533 * Jmol state, rather than by one or more linked alignment views.
536 * @param colourByJmol
537 * the value of field 'colourByJmol'.
539 public void setColourByJmol(final boolean colourByJmol)
541 this._colourByJmol = colourByJmol;
542 this._has_colourByJmol = true;
546 * Sets the value of field 'colourwithAlignPanel'. The field
547 * 'colourwithAlignPanel' has the following description: Flag set if the
548 * alignment panel containing this JSeq should be included in those used to
549 * colour its associated sequences in this structureState(since Jalview 2.7).
552 * @param colourwithAlignPanel
553 * the value of field 'colourwithAlignPanel'.
555 public void setColourwithAlignPanel(final boolean colourwithAlignPanel)
557 this._colourwithAlignPanel = colourwithAlignPanel;
558 this._has_colourwithAlignPanel = true;
562 * Sets the value of field 'content'. The field 'content' has the following
563 * description: internal content storage
566 * the value of field 'content'.
568 public void setContent(final java.lang.String content)
570 this._content = content;
574 * Sets the value of field 'height'.
577 * the value of field 'height'.
579 public void setHeight(final int height)
581 this._height = height;
582 this._has_height = true;
586 * Sets the value of field 'viewId'. The field 'viewId' has the following
587 * description: additional identifier which properly disambiguates the
588 * structure view from any other view with the same attributes. This is not an
589 * ID, because it is possible to have many references to the same physical
590 * structure view from different sequences in an alignment. A structureState
591 * element citing the same viewId will appear for each instance.
595 * the value of field 'viewId'.
597 public void setViewId(final java.lang.String viewId)
599 this._viewId = viewId;
603 * Sets the value of field 'visible'.
606 * the value of field 'visible'.
608 public void setVisible(final boolean visible)
610 this._visible = visible;
611 this._has_visible = true;
615 * Sets the value of field 'width'.
618 * the value of field 'width'.
620 public void setWidth(final int width)
623 this._has_width = true;
627 * Sets the value of field 'xpos'.
630 * the value of field 'xpos'.
632 public void setXpos(final int xpos)
635 this._has_xpos = true;
639 * Sets the value of field 'ypos'.
642 * the value of field 'ypos'.
644 public void setYpos(final int ypos)
647 this._has_ypos = true;
654 * @throws org.exolab.castor.xml.MarshalException
655 * if object is null or if any SAXException is thrown during
657 * @throws org.exolab.castor.xml.ValidationException
658 * if this object is an invalid instance according to the schema
659 * @return the unmarshaled jalview.schemabinding.version2.StructureState
661 public static jalview.schemabinding.version2.StructureState unmarshal(
662 final java.io.Reader reader)
663 throws org.exolab.castor.xml.MarshalException,
664 org.exolab.castor.xml.ValidationException
666 return (jalview.schemabinding.version2.StructureState) Unmarshaller
667 .unmarshal(jalview.schemabinding.version2.StructureState.class,
674 * @throws org.exolab.castor.xml.ValidationException
675 * if this object is an invalid instance according to the schema
677 public void validate() throws org.exolab.castor.xml.ValidationException
679 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
680 validator.validate(this);