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