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