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