JAL-1432 updated copyright notices
[jalview.git] / src / jalview / schemabinding / version2 / Tree.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 Tree.
30  * 
31  * @version $Revision$ $Date$
32  */
33 public class Tree implements java.io.Serializable
34 {
35
36   // --------------------------/
37   // - Class/Member Variables -/
38   // --------------------------/
39
40   /**
41    * Field _fontName.
42    */
43   private java.lang.String _fontName;
44
45   /**
46    * Field _fontSize.
47    */
48   private int _fontSize;
49
50   /**
51    * keeps track of state for field: _fontSize
52    */
53   private boolean _has_fontSize;
54
55   /**
56    * Field _fontStyle.
57    */
58   private int _fontStyle;
59
60   /**
61    * keeps track of state for field: _fontStyle
62    */
63   private boolean _has_fontStyle;
64
65   /**
66    * Field _threshold.
67    */
68   private float _threshold;
69
70   /**
71    * keeps track of state for field: _threshold
72    */
73   private boolean _has_threshold;
74
75   /**
76    * Field _showBootstrap.
77    */
78   private boolean _showBootstrap;
79
80   /**
81    * keeps track of state for field: _showBootstrap
82    */
83   private boolean _has_showBootstrap;
84
85   /**
86    * Field _showDistances.
87    */
88   private boolean _showDistances;
89
90   /**
91    * keeps track of state for field: _showDistances
92    */
93   private boolean _has_showDistances;
94
95   /**
96    * Field _markUnlinked.
97    */
98   private boolean _markUnlinked;
99
100   /**
101    * keeps track of state for field: _markUnlinked
102    */
103   private boolean _has_markUnlinked;
104
105   /**
106    * Field _fitToWindow.
107    */
108   private boolean _fitToWindow;
109
110   /**
111    * keeps track of state for field: _fitToWindow
112    */
113   private boolean _has_fitToWindow;
114
115   /**
116    * Field _currentTree.
117    */
118   private boolean _currentTree;
119
120   /**
121    * keeps track of state for field: _currentTree
122    */
123   private boolean _has_currentTree;
124
125   /**
126    * Tree ID added for binding tree visualization settings to vamsas document
127    * trees in jalview 2.4.1
128    * 
129    */
130   private java.lang.String _id;
131
132   /**
133    * Field _width.
134    */
135   private int _width;
136
137   /**
138    * keeps track of state for field: _width
139    */
140   private boolean _has_width;
141
142   /**
143    * Field _height.
144    */
145   private int _height;
146
147   /**
148    * keeps track of state for field: _height
149    */
150   private boolean _has_height;
151
152   /**
153    * Field _xpos.
154    */
155   private int _xpos;
156
157   /**
158    * keeps track of state for field: _xpos
159    */
160   private boolean _has_xpos;
161
162   /**
163    * Field _ypos.
164    */
165   private int _ypos;
166
167   /**
168    * keeps track of state for field: _ypos
169    */
170   private boolean _has_ypos;
171
172   /**
173    * Field _title.
174    */
175   private java.lang.String _title;
176
177   /**
178    * Field _newick.
179    */
180   private java.lang.String _newick;
181
182   // ----------------/
183   // - Constructors -/
184   // ----------------/
185
186   public Tree()
187   {
188     super();
189   }
190
191   // -----------/
192   // - Methods -/
193   // -----------/
194
195   /**
196      */
197   public void deleteCurrentTree()
198   {
199     this._has_currentTree = false;
200   }
201
202   /**
203      */
204   public void deleteFitToWindow()
205   {
206     this._has_fitToWindow = false;
207   }
208
209   /**
210      */
211   public void deleteFontSize()
212   {
213     this._has_fontSize = false;
214   }
215
216   /**
217      */
218   public void deleteFontStyle()
219   {
220     this._has_fontStyle = false;
221   }
222
223   /**
224      */
225   public void deleteHeight()
226   {
227     this._has_height = false;
228   }
229
230   /**
231      */
232   public void deleteMarkUnlinked()
233   {
234     this._has_markUnlinked = false;
235   }
236
237   /**
238      */
239   public void deleteShowBootstrap()
240   {
241     this._has_showBootstrap = false;
242   }
243
244   /**
245      */
246   public void deleteShowDistances()
247   {
248     this._has_showDistances = false;
249   }
250
251   /**
252      */
253   public void deleteThreshold()
254   {
255     this._has_threshold = false;
256   }
257
258   /**
259      */
260   public void deleteWidth()
261   {
262     this._has_width = false;
263   }
264
265   /**
266      */
267   public void deleteXpos()
268   {
269     this._has_xpos = false;
270   }
271
272   /**
273      */
274   public void deleteYpos()
275   {
276     this._has_ypos = false;
277   }
278
279   /**
280    * Returns the value of field 'currentTree'.
281    * 
282    * @return the value of field 'CurrentTree'.
283    */
284   public boolean getCurrentTree()
285   {
286     return this._currentTree;
287   }
288
289   /**
290    * Returns the value of field 'fitToWindow'.
291    * 
292    * @return the value of field 'FitToWindow'.
293    */
294   public boolean getFitToWindow()
295   {
296     return this._fitToWindow;
297   }
298
299   /**
300    * Returns the value of field 'fontName'.
301    * 
302    * @return the value of field 'FontName'.
303    */
304   public java.lang.String getFontName()
305   {
306     return this._fontName;
307   }
308
309   /**
310    * Returns the value of field 'fontSize'.
311    * 
312    * @return the value of field 'FontSize'.
313    */
314   public int getFontSize()
315   {
316     return this._fontSize;
317   }
318
319   /**
320    * Returns the value of field 'fontStyle'.
321    * 
322    * @return the value of field 'FontStyle'.
323    */
324   public int getFontStyle()
325   {
326     return this._fontStyle;
327   }
328
329   /**
330    * Returns the value of field 'height'.
331    * 
332    * @return the value of field 'Height'.
333    */
334   public int getHeight()
335   {
336     return this._height;
337   }
338
339   /**
340    * Returns the value of field 'id'. The field 'id' has the following
341    * description: Tree ID added for binding tree visualization settings to
342    * vamsas document trees in jalview 2.4.1
343    * 
344    * 
345    * @return the value of field 'Id'.
346    */
347   public java.lang.String getId()
348   {
349     return this._id;
350   }
351
352   /**
353    * Returns the value of field 'markUnlinked'.
354    * 
355    * @return the value of field 'MarkUnlinked'.
356    */
357   public boolean getMarkUnlinked()
358   {
359     return this._markUnlinked;
360   }
361
362   /**
363    * Returns the value of field 'newick'.
364    * 
365    * @return the value of field 'Newick'.
366    */
367   public java.lang.String getNewick()
368   {
369     return this._newick;
370   }
371
372   /**
373    * Returns the value of field 'showBootstrap'.
374    * 
375    * @return the value of field 'ShowBootstrap'.
376    */
377   public boolean getShowBootstrap()
378   {
379     return this._showBootstrap;
380   }
381
382   /**
383    * Returns the value of field 'showDistances'.
384    * 
385    * @return the value of field 'ShowDistances'.
386    */
387   public boolean getShowDistances()
388   {
389     return this._showDistances;
390   }
391
392   /**
393    * Returns the value of field 'threshold'.
394    * 
395    * @return the value of field 'Threshold'.
396    */
397   public float getThreshold()
398   {
399     return this._threshold;
400   }
401
402   /**
403    * Returns the value of field 'title'.
404    * 
405    * @return the value of field 'Title'.
406    */
407   public java.lang.String getTitle()
408   {
409     return this._title;
410   }
411
412   /**
413    * Returns the value of field 'width'.
414    * 
415    * @return the value of field 'Width'.
416    */
417   public int getWidth()
418   {
419     return this._width;
420   }
421
422   /**
423    * Returns the value of field 'xpos'.
424    * 
425    * @return the value of field 'Xpos'.
426    */
427   public int getXpos()
428   {
429     return this._xpos;
430   }
431
432   /**
433    * Returns the value of field 'ypos'.
434    * 
435    * @return the value of field 'Ypos'.
436    */
437   public int getYpos()
438   {
439     return this._ypos;
440   }
441
442   /**
443    * Method hasCurrentTree.
444    * 
445    * @return true if at least one CurrentTree has been added
446    */
447   public boolean hasCurrentTree()
448   {
449     return this._has_currentTree;
450   }
451
452   /**
453    * Method hasFitToWindow.
454    * 
455    * @return true if at least one FitToWindow has been added
456    */
457   public boolean hasFitToWindow()
458   {
459     return this._has_fitToWindow;
460   }
461
462   /**
463    * Method hasFontSize.
464    * 
465    * @return true if at least one FontSize has been added
466    */
467   public boolean hasFontSize()
468   {
469     return this._has_fontSize;
470   }
471
472   /**
473    * Method hasFontStyle.
474    * 
475    * @return true if at least one FontStyle has been added
476    */
477   public boolean hasFontStyle()
478   {
479     return this._has_fontStyle;
480   }
481
482   /**
483    * Method hasHeight.
484    * 
485    * @return true if at least one Height has been added
486    */
487   public boolean hasHeight()
488   {
489     return this._has_height;
490   }
491
492   /**
493    * Method hasMarkUnlinked.
494    * 
495    * @return true if at least one MarkUnlinked has been added
496    */
497   public boolean hasMarkUnlinked()
498   {
499     return this._has_markUnlinked;
500   }
501
502   /**
503    * Method hasShowBootstrap.
504    * 
505    * @return true if at least one ShowBootstrap has been added
506    */
507   public boolean hasShowBootstrap()
508   {
509     return this._has_showBootstrap;
510   }
511
512   /**
513    * Method hasShowDistances.
514    * 
515    * @return true if at least one ShowDistances has been added
516    */
517   public boolean hasShowDistances()
518   {
519     return this._has_showDistances;
520   }
521
522   /**
523    * Method hasThreshold.
524    * 
525    * @return true if at least one Threshold has been added
526    */
527   public boolean hasThreshold()
528   {
529     return this._has_threshold;
530   }
531
532   /**
533    * Method hasWidth.
534    * 
535    * @return true if at least one Width has been added
536    */
537   public boolean hasWidth()
538   {
539     return this._has_width;
540   }
541
542   /**
543    * Method hasXpos.
544    * 
545    * @return true if at least one Xpos has been added
546    */
547   public boolean hasXpos()
548   {
549     return this._has_xpos;
550   }
551
552   /**
553    * Method hasYpos.
554    * 
555    * @return true if at least one Ypos has been added
556    */
557   public boolean hasYpos()
558   {
559     return this._has_ypos;
560   }
561
562   /**
563    * Returns the value of field 'currentTree'.
564    * 
565    * @return the value of field 'CurrentTree'.
566    */
567   public boolean isCurrentTree()
568   {
569     return this._currentTree;
570   }
571
572   /**
573    * Returns the value of field 'fitToWindow'.
574    * 
575    * @return the value of field 'FitToWindow'.
576    */
577   public boolean isFitToWindow()
578   {
579     return this._fitToWindow;
580   }
581
582   /**
583    * Returns the value of field 'markUnlinked'.
584    * 
585    * @return the value of field 'MarkUnlinked'.
586    */
587   public boolean isMarkUnlinked()
588   {
589     return this._markUnlinked;
590   }
591
592   /**
593    * Returns the value of field 'showBootstrap'.
594    * 
595    * @return the value of field 'ShowBootstrap'.
596    */
597   public boolean isShowBootstrap()
598   {
599     return this._showBootstrap;
600   }
601
602   /**
603    * Returns the value of field 'showDistances'.
604    * 
605    * @return the value of field 'ShowDistances'.
606    */
607   public boolean isShowDistances()
608   {
609     return this._showDistances;
610   }
611
612   /**
613    * Method isValid.
614    * 
615    * @return true if this object is valid according to the schema
616    */
617   public boolean isValid()
618   {
619     try
620     {
621       validate();
622     } catch (org.exolab.castor.xml.ValidationException vex)
623     {
624       return false;
625     }
626     return true;
627   }
628
629   /**
630    * 
631    * 
632    * @param out
633    * @throws org.exolab.castor.xml.MarshalException
634    *           if object is null or if any SAXException is thrown during
635    *           marshaling
636    * @throws org.exolab.castor.xml.ValidationException
637    *           if this object is an invalid instance according to the schema
638    */
639   public void marshal(final java.io.Writer out)
640           throws org.exolab.castor.xml.MarshalException,
641           org.exolab.castor.xml.ValidationException
642   {
643     Marshaller.marshal(this, out);
644   }
645
646   /**
647    * 
648    * 
649    * @param handler
650    * @throws java.io.IOException
651    *           if an IOException occurs during marshaling
652    * @throws org.exolab.castor.xml.ValidationException
653    *           if this object is an invalid instance according to the schema
654    * @throws org.exolab.castor.xml.MarshalException
655    *           if object is null or if any SAXException is thrown during
656    *           marshaling
657    */
658   public void marshal(final org.xml.sax.ContentHandler handler)
659           throws java.io.IOException,
660           org.exolab.castor.xml.MarshalException,
661           org.exolab.castor.xml.ValidationException
662   {
663     Marshaller.marshal(this, handler);
664   }
665
666   /**
667    * Sets the value of field 'currentTree'.
668    * 
669    * @param currentTree
670    *          the value of field 'currentTree'.
671    */
672   public void setCurrentTree(final boolean currentTree)
673   {
674     this._currentTree = currentTree;
675     this._has_currentTree = true;
676   }
677
678   /**
679    * Sets the value of field 'fitToWindow'.
680    * 
681    * @param fitToWindow
682    *          the value of field 'fitToWindow'.
683    */
684   public void setFitToWindow(final boolean fitToWindow)
685   {
686     this._fitToWindow = fitToWindow;
687     this._has_fitToWindow = true;
688   }
689
690   /**
691    * Sets the value of field 'fontName'.
692    * 
693    * @param fontName
694    *          the value of field 'fontName'.
695    */
696   public void setFontName(final java.lang.String fontName)
697   {
698     this._fontName = fontName;
699   }
700
701   /**
702    * Sets the value of field 'fontSize'.
703    * 
704    * @param fontSize
705    *          the value of field 'fontSize'.
706    */
707   public void setFontSize(final int fontSize)
708   {
709     this._fontSize = fontSize;
710     this._has_fontSize = true;
711   }
712
713   /**
714    * Sets the value of field 'fontStyle'.
715    * 
716    * @param fontStyle
717    *          the value of field 'fontStyle'.
718    */
719   public void setFontStyle(final int fontStyle)
720   {
721     this._fontStyle = fontStyle;
722     this._has_fontStyle = true;
723   }
724
725   /**
726    * Sets the value of field 'height'.
727    * 
728    * @param height
729    *          the value of field 'height'.
730    */
731   public void setHeight(final int height)
732   {
733     this._height = height;
734     this._has_height = true;
735   }
736
737   /**
738    * Sets the value of field 'id'. The field 'id' has the following description:
739    * Tree ID added for binding tree visualization settings to vamsas document
740    * trees in jalview 2.4.1
741    * 
742    * 
743    * @param id
744    *          the value of field 'id'.
745    */
746   public void setId(final java.lang.String id)
747   {
748     this._id = id;
749   }
750
751   /**
752    * Sets the value of field 'markUnlinked'.
753    * 
754    * @param markUnlinked
755    *          the value of field 'markUnlinked'.
756    */
757   public void setMarkUnlinked(final boolean markUnlinked)
758   {
759     this._markUnlinked = markUnlinked;
760     this._has_markUnlinked = true;
761   }
762
763   /**
764    * Sets the value of field 'newick'.
765    * 
766    * @param newick
767    *          the value of field 'newick'.
768    */
769   public void setNewick(final java.lang.String newick)
770   {
771     this._newick = newick;
772   }
773
774   /**
775    * Sets the value of field 'showBootstrap'.
776    * 
777    * @param showBootstrap
778    *          the value of field 'showBootstrap'.
779    */
780   public void setShowBootstrap(final boolean showBootstrap)
781   {
782     this._showBootstrap = showBootstrap;
783     this._has_showBootstrap = true;
784   }
785
786   /**
787    * Sets the value of field 'showDistances'.
788    * 
789    * @param showDistances
790    *          the value of field 'showDistances'.
791    */
792   public void setShowDistances(final boolean showDistances)
793   {
794     this._showDistances = showDistances;
795     this._has_showDistances = true;
796   }
797
798   /**
799    * Sets the value of field 'threshold'.
800    * 
801    * @param threshold
802    *          the value of field 'threshold'.
803    */
804   public void setThreshold(final float threshold)
805   {
806     this._threshold = threshold;
807     this._has_threshold = true;
808   }
809
810   /**
811    * Sets the value of field 'title'.
812    * 
813    * @param title
814    *          the value of field 'title'.
815    */
816   public void setTitle(final java.lang.String title)
817   {
818     this._title = title;
819   }
820
821   /**
822    * Sets the value of field 'width'.
823    * 
824    * @param width
825    *          the value of field 'width'.
826    */
827   public void setWidth(final int width)
828   {
829     this._width = width;
830     this._has_width = true;
831   }
832
833   /**
834    * Sets the value of field 'xpos'.
835    * 
836    * @param xpos
837    *          the value of field 'xpos'.
838    */
839   public void setXpos(final int xpos)
840   {
841     this._xpos = xpos;
842     this._has_xpos = true;
843   }
844
845   /**
846    * Sets the value of field 'ypos'.
847    * 
848    * @param ypos
849    *          the value of field 'ypos'.
850    */
851   public void setYpos(final int ypos)
852   {
853     this._ypos = ypos;
854     this._has_ypos = true;
855   }
856
857   /**
858    * Method unmarshal.
859    * 
860    * @param reader
861    * @throws org.exolab.castor.xml.MarshalException
862    *           if object is null or if any SAXException is thrown during
863    *           marshaling
864    * @throws org.exolab.castor.xml.ValidationException
865    *           if this object is an invalid instance according to the schema
866    * @return the unmarshaled jalview.schemabinding.version2.Tree
867    */
868   public static jalview.schemabinding.version2.Tree unmarshal(
869           final java.io.Reader reader)
870           throws org.exolab.castor.xml.MarshalException,
871           org.exolab.castor.xml.ValidationException
872   {
873     return (jalview.schemabinding.version2.Tree) Unmarshaller.unmarshal(
874             jalview.schemabinding.version2.Tree.class, reader);
875   }
876
877   /**
878    * 
879    * 
880    * @throws org.exolab.castor.xml.ValidationException
881    *           if this object is an invalid instance according to the schema
882    */
883   public void validate() throws org.exolab.castor.xml.ValidationException
884   {
885     org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
886     validator.validate(this);
887   }
888
889 }