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