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