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