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