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