2 * Jalview - A Sequence Alignment Editor and Viewer (Development Version 2.4.1)
3 * Copyright (C) 2009 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
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.
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.
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
19 package jalview.binding;
21 //---------------------------------/
22 //- Imported classes and packages -/
23 //---------------------------------/
25 import org.exolab.castor.xml.Marshaller;
26 import org.exolab.castor.xml.Unmarshaller;
31 * @version $Revision$ $Date$
33 public class Tree implements java.io.Serializable {
36 //--------------------------/
37 //- Class/Member Variables -/
38 //--------------------------/
46 * keeps track of state for field: _width
48 private boolean _has_width;
56 * keeps track of state for field: _height
58 private boolean _has_height;
66 * keeps track of state for field: _xpos
68 private boolean _has_xpos;
76 * keeps track of state for field: _ypos
78 private boolean _has_ypos;
83 private java.lang.String _fontName;
88 private int _fontSize;
91 * keeps track of state for field: _fontSize
93 private boolean _has_fontSize;
98 private int _fontStyle;
101 * keeps track of state for field: _fontStyle
103 private boolean _has_fontStyle;
108 private float _threshold;
111 * keeps track of state for field: _threshold
113 private boolean _has_threshold;
116 * Field _showBootstrap.
118 private boolean _showBootstrap;
121 * keeps track of state for field: _showBootstrap
123 private boolean _has_showBootstrap;
126 * Field _showDistances.
128 private boolean _showDistances;
131 * keeps track of state for field: _showDistances
133 private boolean _has_showDistances;
136 * Field _markUnlinked.
138 private boolean _markUnlinked;
141 * keeps track of state for field: _markUnlinked
143 private boolean _has_markUnlinked;
146 * Field _fitToWindow.
148 private boolean _fitToWindow;
151 * keeps track of state for field: _fitToWindow
153 private boolean _has_fitToWindow;
156 * Field _currentTree.
158 private boolean _currentTree;
161 * keeps track of state for field: _currentTree
163 private boolean _has_currentTree;
168 private java.lang.String _title;
173 private java.lang.String _newick;
191 public void deleteCurrentTree(
193 this._has_currentTree= false;
198 public void deleteFitToWindow(
200 this._has_fitToWindow= false;
205 public void deleteFontSize(
207 this._has_fontSize= false;
212 public void deleteFontStyle(
214 this._has_fontStyle= false;
219 public void deleteHeight(
221 this._has_height= false;
226 public void deleteMarkUnlinked(
228 this._has_markUnlinked= false;
233 public void deleteShowBootstrap(
235 this._has_showBootstrap= false;
240 public void deleteShowDistances(
242 this._has_showDistances= false;
247 public void deleteThreshold(
249 this._has_threshold= false;
254 public void deleteWidth(
256 this._has_width= false;
261 public void deleteXpos(
263 this._has_xpos= false;
268 public void deleteYpos(
270 this._has_ypos= false;
274 * Returns the value of field 'currentTree'.
276 * @return the value of field 'CurrentTree'.
278 public boolean getCurrentTree(
280 return this._currentTree;
284 * Returns the value of field 'fitToWindow'.
286 * @return the value of field 'FitToWindow'.
288 public boolean getFitToWindow(
290 return this._fitToWindow;
294 * Returns the value of field 'fontName'.
296 * @return the value of field 'FontName'.
298 public java.lang.String getFontName(
300 return this._fontName;
304 * Returns the value of field 'fontSize'.
306 * @return the value of field 'FontSize'.
308 public int getFontSize(
310 return this._fontSize;
314 * Returns the value of field 'fontStyle'.
316 * @return the value of field 'FontStyle'.
318 public int getFontStyle(
320 return this._fontStyle;
324 * Returns the value of field 'height'.
326 * @return the value of field 'Height'.
328 public int getHeight(
334 * Returns the value of field 'markUnlinked'.
336 * @return the value of field 'MarkUnlinked'.
338 public boolean getMarkUnlinked(
340 return this._markUnlinked;
344 * Returns the value of field 'newick'.
346 * @return the value of field 'Newick'.
348 public java.lang.String getNewick(
354 * Returns the value of field 'showBootstrap'.
356 * @return the value of field 'ShowBootstrap'.
358 public boolean getShowBootstrap(
360 return this._showBootstrap;
364 * Returns the value of field 'showDistances'.
366 * @return the value of field 'ShowDistances'.
368 public boolean getShowDistances(
370 return this._showDistances;
374 * Returns the value of field 'threshold'.
376 * @return the value of field 'Threshold'.
378 public float getThreshold(
380 return this._threshold;
384 * Returns the value of field 'title'.
386 * @return the value of field 'Title'.
388 public java.lang.String getTitle(
394 * Returns the value of field 'width'.
396 * @return the value of field 'Width'.
404 * Returns the value of field 'xpos'.
406 * @return the value of field 'Xpos'.
414 * Returns the value of field 'ypos'.
416 * @return the value of field 'Ypos'.
424 * Method hasCurrentTree.
426 * @return true if at least one CurrentTree has been added
428 public boolean hasCurrentTree(
430 return this._has_currentTree;
434 * Method hasFitToWindow.
436 * @return true if at least one FitToWindow has been added
438 public boolean hasFitToWindow(
440 return this._has_fitToWindow;
444 * Method hasFontSize.
446 * @return true if at least one FontSize has been added
448 public boolean hasFontSize(
450 return this._has_fontSize;
454 * Method hasFontStyle.
456 * @return true if at least one FontStyle has been added
458 public boolean hasFontStyle(
460 return this._has_fontStyle;
466 * @return true if at least one Height has been added
468 public boolean hasHeight(
470 return this._has_height;
474 * Method hasMarkUnlinked.
476 * @return true if at least one MarkUnlinked has been added
478 public boolean hasMarkUnlinked(
480 return this._has_markUnlinked;
484 * Method hasShowBootstrap.
486 * @return true if at least one ShowBootstrap has been added
488 public boolean hasShowBootstrap(
490 return this._has_showBootstrap;
494 * Method hasShowDistances.
496 * @return true if at least one ShowDistances has been added
498 public boolean hasShowDistances(
500 return this._has_showDistances;
504 * Method hasThreshold.
506 * @return true if at least one Threshold has been added
508 public boolean hasThreshold(
510 return this._has_threshold;
516 * @return true if at least one Width has been added
518 public boolean hasWidth(
520 return this._has_width;
526 * @return true if at least one Xpos has been added
528 public boolean hasXpos(
530 return this._has_xpos;
536 * @return true if at least one Ypos has been added
538 public boolean hasYpos(
540 return this._has_ypos;
544 * Returns the value of field 'currentTree'.
546 * @return the value of field 'CurrentTree'.
548 public boolean isCurrentTree(
550 return this._currentTree;
554 * Returns the value of field 'fitToWindow'.
556 * @return the value of field 'FitToWindow'.
558 public boolean isFitToWindow(
560 return this._fitToWindow;
564 * Returns the value of field 'markUnlinked'.
566 * @return the value of field 'MarkUnlinked'.
568 public boolean isMarkUnlinked(
570 return this._markUnlinked;
574 * Returns the value of field 'showBootstrap'.
576 * @return the value of field 'ShowBootstrap'.
578 public boolean isShowBootstrap(
580 return this._showBootstrap;
584 * Returns the value of field 'showDistances'.
586 * @return the value of field 'ShowDistances'.
588 public boolean isShowDistances(
590 return this._showDistances;
596 * @return true if this object is valid according to the schema
598 public boolean isValid(
602 } catch (org.exolab.castor.xml.ValidationException vex) {
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
618 final java.io.Writer out)
619 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
620 Marshaller.marshal(this, out);
627 * @throws java.io.IOException if an IOException occurs during
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
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);
641 * Sets the value of field 'currentTree'.
643 * @param currentTree the value of field 'currentTree'.
645 public void setCurrentTree(
646 final boolean currentTree) {
647 this._currentTree = currentTree;
648 this._has_currentTree = true;
652 * Sets the value of field 'fitToWindow'.
654 * @param fitToWindow the value of field 'fitToWindow'.
656 public void setFitToWindow(
657 final boolean fitToWindow) {
658 this._fitToWindow = fitToWindow;
659 this._has_fitToWindow = true;
663 * Sets the value of field 'fontName'.
665 * @param fontName the value of field 'fontName'.
667 public void setFontName(
668 final java.lang.String fontName) {
669 this._fontName = fontName;
673 * Sets the value of field 'fontSize'.
675 * @param fontSize the value of field 'fontSize'.
677 public void setFontSize(
678 final int fontSize) {
679 this._fontSize = fontSize;
680 this._has_fontSize = true;
684 * Sets the value of field 'fontStyle'.
686 * @param fontStyle the value of field 'fontStyle'.
688 public void setFontStyle(
689 final int fontStyle) {
690 this._fontStyle = fontStyle;
691 this._has_fontStyle = true;
695 * Sets the value of field 'height'.
697 * @param height the value of field 'height'.
699 public void setHeight(
701 this._height = height;
702 this._has_height = true;
706 * Sets the value of field 'markUnlinked'.
708 * @param markUnlinked the value of field 'markUnlinked'.
710 public void setMarkUnlinked(
711 final boolean markUnlinked) {
712 this._markUnlinked = markUnlinked;
713 this._has_markUnlinked = true;
717 * Sets the value of field 'newick'.
719 * @param newick the value of field 'newick'.
721 public void setNewick(
722 final java.lang.String newick) {
723 this._newick = newick;
727 * Sets the value of field 'showBootstrap'.
729 * @param showBootstrap the value of field 'showBootstrap'.
731 public void setShowBootstrap(
732 final boolean showBootstrap) {
733 this._showBootstrap = showBootstrap;
734 this._has_showBootstrap = true;
738 * Sets the value of field 'showDistances'.
740 * @param showDistances the value of field 'showDistances'.
742 public void setShowDistances(
743 final boolean showDistances) {
744 this._showDistances = showDistances;
745 this._has_showDistances = true;
749 * Sets the value of field 'threshold'.
751 * @param threshold the value of field 'threshold'.
753 public void setThreshold(
754 final float threshold) {
755 this._threshold = threshold;
756 this._has_threshold = true;
760 * Sets the value of field 'title'.
762 * @param title the value of field 'title'.
764 public void setTitle(
765 final java.lang.String title) {
770 * Sets the value of field 'width'.
772 * @param width the value of field 'width'.
774 public void setWidth(
777 this._has_width = true;
781 * Sets the value of field 'xpos'.
783 * @param xpos the value of field 'xpos'.
788 this._has_xpos = true;
792 * Sets the value of field 'ypos'.
794 * @param ypos the value of field 'ypos'.
799 this._has_ypos = true;
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
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);
821 * @throws org.exolab.castor.xml.ValidationException if this
822 * object is an invalid instance according to the schema
824 public void validate(
826 throws org.exolab.castor.xml.ValidationException {
827 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
828 validator.validate(this);