JAL-1432 updated copyright notices
[jalview.git] / src / jalview / schemabinding / version2 / StructureState.java
1 /*
2  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.0b1)
3  * Copyright (C) 2014 The Jalview Authors
4  * 
5  * This file is part of Jalview.
6  * 
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.
10  *  
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.
15  * 
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.
18  */
19 package jalview.schemabinding.version2;
20
21 //---------------------------------/
22 //- Imported classes and packages -/
23 //---------------------------------/
24
25 import org.exolab.castor.xml.Marshaller;
26 import org.exolab.castor.xml.Unmarshaller;
27
28 /**
29  * Class StructureState.
30  * 
31  * @version $Revision$ $Date$
32  */
33 public class StructureState implements java.io.Serializable
34 {
35
36   // --------------------------/
37   // - Class/Member Variables -/
38   // --------------------------/
39
40   /**
41    * internal content storage
42    */
43   private java.lang.String _content = "";
44
45   /**
46    * Field _visible.
47    */
48   private boolean _visible;
49
50   /**
51    * keeps track of state for field: _visible
52    */
53   private boolean _has_visible;
54
55   /**
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.
61    * 
62    */
63   private java.lang.String _viewId;
64
65   /**
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).
68    * 
69    */
70   private boolean _alignwithAlignPanel = true;
71
72   /**
73    * keeps track of state for field: _alignwithAlignPanel
74    */
75   private boolean _has_alignwithAlignPanel;
76
77   /**
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
80    * Jalview 2.7).
81    * 
82    */
83   private boolean _colourwithAlignPanel = false;
84
85   /**
86    * keeps track of state for field: _colourwithAlignPanel
87    */
88   private boolean _has_colourwithAlignPanel;
89
90   /**
91    * Flag set if the structure display is coloured by the Jmol state, rather
92    * than by one or more linked alignment views.
93    * 
94    */
95   private boolean _colourByJmol = true;
96
97   /**
98    * keeps track of state for field: _colourByJmol
99    */
100   private boolean _has_colourByJmol;
101
102   /**
103    * Field _width.
104    */
105   private int _width;
106
107   /**
108    * keeps track of state for field: _width
109    */
110   private boolean _has_width;
111
112   /**
113    * Field _height.
114    */
115   private int _height;
116
117   /**
118    * keeps track of state for field: _height
119    */
120   private boolean _has_height;
121
122   /**
123    * Field _xpos.
124    */
125   private int _xpos;
126
127   /**
128    * keeps track of state for field: _xpos
129    */
130   private boolean _has_xpos;
131
132   /**
133    * Field _ypos.
134    */
135   private int _ypos;
136
137   /**
138    * keeps track of state for field: _ypos
139    */
140   private boolean _has_ypos;
141
142   // ----------------/
143   // - Constructors -/
144   // ----------------/
145
146   public StructureState()
147   {
148     super();
149     setContent("");
150   }
151
152   // -----------/
153   // - Methods -/
154   // -----------/
155
156   /**
157      */
158   public void deleteAlignwithAlignPanel()
159   {
160     this._has_alignwithAlignPanel = false;
161   }
162
163   /**
164      */
165   public void deleteColourByJmol()
166   {
167     this._has_colourByJmol = false;
168   }
169
170   /**
171      */
172   public void deleteColourwithAlignPanel()
173   {
174     this._has_colourwithAlignPanel = false;
175   }
176
177   /**
178      */
179   public void deleteHeight()
180   {
181     this._has_height = false;
182   }
183
184   /**
185      */
186   public void deleteVisible()
187   {
188     this._has_visible = false;
189   }
190
191   /**
192      */
193   public void deleteWidth()
194   {
195     this._has_width = false;
196   }
197
198   /**
199      */
200   public void deleteXpos()
201   {
202     this._has_xpos = false;
203   }
204
205   /**
206      */
207   public void deleteYpos()
208   {
209     this._has_ypos = false;
210   }
211
212   /**
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).
217    * 
218    * 
219    * @return the value of field 'AlignwithAlignPanel'.
220    */
221   public boolean getAlignwithAlignPanel()
222   {
223     return this._alignwithAlignPanel;
224   }
225
226   /**
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.
230    * 
231    * 
232    * @return the value of field 'ColourByJmol'.
233    */
234   public boolean getColourByJmol()
235   {
236     return this._colourByJmol;
237   }
238
239   /**
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).
244    * 
245    * 
246    * @return the value of field 'ColourwithAlignPanel'.
247    */
248   public boolean getColourwithAlignPanel()
249   {
250     return this._colourwithAlignPanel;
251   }
252
253   /**
254    * Returns the value of field 'content'. The field 'content' has the following
255    * description: internal content storage
256    * 
257    * @return the value of field 'Content'.
258    */
259   public java.lang.String getContent()
260   {
261     return this._content;
262   }
263
264   /**
265    * Returns the value of field 'height'.
266    * 
267    * @return the value of field 'Height'.
268    */
269   public int getHeight()
270   {
271     return this._height;
272   }
273
274   /**
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.
281    * 
282    * 
283    * @return the value of field 'ViewId'.
284    */
285   public java.lang.String getViewId()
286   {
287     return this._viewId;
288   }
289
290   /**
291    * Returns the value of field 'visible'.
292    * 
293    * @return the value of field 'Visible'.
294    */
295   public boolean getVisible()
296   {
297     return this._visible;
298   }
299
300   /**
301    * Returns the value of field 'width'.
302    * 
303    * @return the value of field 'Width'.
304    */
305   public int getWidth()
306   {
307     return this._width;
308   }
309
310   /**
311    * Returns the value of field 'xpos'.
312    * 
313    * @return the value of field 'Xpos'.
314    */
315   public int getXpos()
316   {
317     return this._xpos;
318   }
319
320   /**
321    * Returns the value of field 'ypos'.
322    * 
323    * @return the value of field 'Ypos'.
324    */
325   public int getYpos()
326   {
327     return this._ypos;
328   }
329
330   /**
331    * Method hasAlignwithAlignPanel.
332    * 
333    * @return true if at least one AlignwithAlignPanel has been added
334    */
335   public boolean hasAlignwithAlignPanel()
336   {
337     return this._has_alignwithAlignPanel;
338   }
339
340   /**
341    * Method hasColourByJmol.
342    * 
343    * @return true if at least one ColourByJmol has been added
344    */
345   public boolean hasColourByJmol()
346   {
347     return this._has_colourByJmol;
348   }
349
350   /**
351    * Method hasColourwithAlignPanel.
352    * 
353    * @return true if at least one ColourwithAlignPanel has been added
354    */
355   public boolean hasColourwithAlignPanel()
356   {
357     return this._has_colourwithAlignPanel;
358   }
359
360   /**
361    * Method hasHeight.
362    * 
363    * @return true if at least one Height has been added
364    */
365   public boolean hasHeight()
366   {
367     return this._has_height;
368   }
369
370   /**
371    * Method hasVisible.
372    * 
373    * @return true if at least one Visible has been added
374    */
375   public boolean hasVisible()
376   {
377     return this._has_visible;
378   }
379
380   /**
381    * Method hasWidth.
382    * 
383    * @return true if at least one Width has been added
384    */
385   public boolean hasWidth()
386   {
387     return this._has_width;
388   }
389
390   /**
391    * Method hasXpos.
392    * 
393    * @return true if at least one Xpos has been added
394    */
395   public boolean hasXpos()
396   {
397     return this._has_xpos;
398   }
399
400   /**
401    * Method hasYpos.
402    * 
403    * @return true if at least one Ypos has been added
404    */
405   public boolean hasYpos()
406   {
407     return this._has_ypos;
408   }
409
410   /**
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).
415    * 
416    * 
417    * @return the value of field 'AlignwithAlignPanel'.
418    */
419   public boolean isAlignwithAlignPanel()
420   {
421     return this._alignwithAlignPanel;
422   }
423
424   /**
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.
428    * 
429    * 
430    * @return the value of field 'ColourByJmol'.
431    */
432   public boolean isColourByJmol()
433   {
434     return this._colourByJmol;
435   }
436
437   /**
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).
442    * 
443    * 
444    * @return the value of field 'ColourwithAlignPanel'.
445    */
446   public boolean isColourwithAlignPanel()
447   {
448     return this._colourwithAlignPanel;
449   }
450
451   /**
452    * Method isValid.
453    * 
454    * @return true if this object is valid according to the schema
455    */
456   public boolean isValid()
457   {
458     try
459     {
460       validate();
461     } catch (org.exolab.castor.xml.ValidationException vex)
462     {
463       return false;
464     }
465     return true;
466   }
467
468   /**
469    * Returns the value of field 'visible'.
470    * 
471    * @return the value of field 'Visible'.
472    */
473   public boolean isVisible()
474   {
475     return this._visible;
476   }
477
478   /**
479    * 
480    * 
481    * @param out
482    * @throws org.exolab.castor.xml.MarshalException
483    *           if object is null or if any SAXException is thrown during
484    *           marshaling
485    * @throws org.exolab.castor.xml.ValidationException
486    *           if this object is an invalid instance according to the schema
487    */
488   public void marshal(final java.io.Writer out)
489           throws org.exolab.castor.xml.MarshalException,
490           org.exolab.castor.xml.ValidationException
491   {
492     Marshaller.marshal(this, out);
493   }
494
495   /**
496    * 
497    * 
498    * @param handler
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
505    *           marshaling
506    */
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
511   {
512     Marshaller.marshal(this, handler);
513   }
514
515   /**
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).
520    * 
521    * 
522    * @param alignwithAlignPanel
523    *          the value of field 'alignwithAlignPanel'.
524    */
525   public void setAlignwithAlignPanel(final boolean alignwithAlignPanel)
526   {
527     this._alignwithAlignPanel = alignwithAlignPanel;
528     this._has_alignwithAlignPanel = true;
529   }
530
531   /**
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.
535    * 
536    * 
537    * @param colourByJmol
538    *          the value of field 'colourByJmol'.
539    */
540   public void setColourByJmol(final boolean colourByJmol)
541   {
542     this._colourByJmol = colourByJmol;
543     this._has_colourByJmol = true;
544   }
545
546   /**
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).
551    * 
552    * 
553    * @param colourwithAlignPanel
554    *          the value of field 'colourwithAlignPanel'.
555    */
556   public void setColourwithAlignPanel(final boolean colourwithAlignPanel)
557   {
558     this._colourwithAlignPanel = colourwithAlignPanel;
559     this._has_colourwithAlignPanel = true;
560   }
561
562   /**
563    * Sets the value of field 'content'. The field 'content' has the following
564    * description: internal content storage
565    * 
566    * @param content
567    *          the value of field 'content'.
568    */
569   public void setContent(final java.lang.String content)
570   {
571     this._content = content;
572   }
573
574   /**
575    * Sets the value of field 'height'.
576    * 
577    * @param height
578    *          the value of field 'height'.
579    */
580   public void setHeight(final int height)
581   {
582     this._height = height;
583     this._has_height = true;
584   }
585
586   /**
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.
593    * 
594    * 
595    * @param viewId
596    *          the value of field 'viewId'.
597    */
598   public void setViewId(final java.lang.String viewId)
599   {
600     this._viewId = viewId;
601   }
602
603   /**
604    * Sets the value of field 'visible'.
605    * 
606    * @param visible
607    *          the value of field 'visible'.
608    */
609   public void setVisible(final boolean visible)
610   {
611     this._visible = visible;
612     this._has_visible = true;
613   }
614
615   /**
616    * Sets the value of field 'width'.
617    * 
618    * @param width
619    *          the value of field 'width'.
620    */
621   public void setWidth(final int width)
622   {
623     this._width = width;
624     this._has_width = true;
625   }
626
627   /**
628    * Sets the value of field 'xpos'.
629    * 
630    * @param xpos
631    *          the value of field 'xpos'.
632    */
633   public void setXpos(final int xpos)
634   {
635     this._xpos = xpos;
636     this._has_xpos = true;
637   }
638
639   /**
640    * Sets the value of field 'ypos'.
641    * 
642    * @param ypos
643    *          the value of field 'ypos'.
644    */
645   public void setYpos(final int ypos)
646   {
647     this._ypos = ypos;
648     this._has_ypos = true;
649   }
650
651   /**
652    * Method unmarshal.
653    * 
654    * @param reader
655    * @throws org.exolab.castor.xml.MarshalException
656    *           if object is null or if any SAXException is thrown during
657    *           marshaling
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
661    */
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
666   {
667     return (jalview.schemabinding.version2.StructureState) Unmarshaller
668             .unmarshal(jalview.schemabinding.version2.StructureState.class,
669                     reader);
670   }
671
672   /**
673    * 
674    * 
675    * @throws org.exolab.castor.xml.ValidationException
676    *           if this object is an invalid instance according to the schema
677    */
678   public void validate() throws org.exolab.castor.xml.ValidationException
679   {
680     org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
681     validator.validate(this);
682   }
683
684 }