2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5.1)
3 * Copyright (C) 2010 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
5 * This file is part of Jalview.
7 * Jalview is free software: you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
11 * Jalview is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty
13 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 * PURPOSE. See the GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License along with Jalview. If not, see <http://www.gnu.org/licenses/>.
18 package jalview.binding;
20 //---------------------------------/
21 //- Imported classes and packages -/
22 //---------------------------------/
24 import org.exolab.castor.xml.Marshaller;
25 import org.exolab.castor.xml.Unmarshaller;
30 * @version $Revision$ $Date$
32 public class Tree implements java.io.Serializable
35 // --------------------------/
36 // - Class/Member Variables -/
37 // --------------------------/
45 * keeps track of state for field: _width
47 private boolean _has_width;
55 * keeps track of state for field: _height
57 private boolean _has_height;
65 * keeps track of state for field: _xpos
67 private boolean _has_xpos;
75 * keeps track of state for field: _ypos
77 private boolean _has_ypos;
82 private java.lang.String _fontName;
87 private int _fontSize;
90 * keeps track of state for field: _fontSize
92 private boolean _has_fontSize;
97 private int _fontStyle;
100 * keeps track of state for field: _fontStyle
102 private boolean _has_fontStyle;
107 private float _threshold;
110 * keeps track of state for field: _threshold
112 private boolean _has_threshold;
115 * Field _showBootstrap.
117 private boolean _showBootstrap;
120 * keeps track of state for field: _showBootstrap
122 private boolean _has_showBootstrap;
125 * Field _showDistances.
127 private boolean _showDistances;
130 * keeps track of state for field: _showDistances
132 private boolean _has_showDistances;
135 * Field _markUnlinked.
137 private boolean _markUnlinked;
140 * keeps track of state for field: _markUnlinked
142 private boolean _has_markUnlinked;
145 * Field _fitToWindow.
147 private boolean _fitToWindow;
150 * keeps track of state for field: _fitToWindow
152 private boolean _has_fitToWindow;
155 * Field _currentTree.
157 private boolean _currentTree;
160 * keeps track of state for field: _currentTree
162 private boolean _has_currentTree;
167 private java.lang.String _title;
172 private java.lang.String _newick;
189 public void deleteCurrentTree()
191 this._has_currentTree = false;
196 public void deleteFitToWindow()
198 this._has_fitToWindow = false;
203 public void deleteFontSize()
205 this._has_fontSize = false;
210 public void deleteFontStyle()
212 this._has_fontStyle = false;
217 public void deleteHeight()
219 this._has_height = false;
224 public void deleteMarkUnlinked()
226 this._has_markUnlinked = false;
231 public void deleteShowBootstrap()
233 this._has_showBootstrap = false;
238 public void deleteShowDistances()
240 this._has_showDistances = false;
245 public void deleteThreshold()
247 this._has_threshold = false;
252 public void deleteWidth()
254 this._has_width = false;
259 public void deleteXpos()
261 this._has_xpos = false;
266 public void deleteYpos()
268 this._has_ypos = false;
272 * Returns the value of field 'currentTree'.
274 * @return the value of field 'CurrentTree'.
276 public boolean getCurrentTree()
278 return this._currentTree;
282 * Returns the value of field 'fitToWindow'.
284 * @return the value of field 'FitToWindow'.
286 public boolean getFitToWindow()
288 return this._fitToWindow;
292 * Returns the value of field 'fontName'.
294 * @return the value of field 'FontName'.
296 public java.lang.String getFontName()
298 return this._fontName;
302 * Returns the value of field 'fontSize'.
304 * @return the value of field 'FontSize'.
306 public int getFontSize()
308 return this._fontSize;
312 * Returns the value of field 'fontStyle'.
314 * @return the value of field 'FontStyle'.
316 public int getFontStyle()
318 return this._fontStyle;
322 * Returns the value of field 'height'.
324 * @return the value of field 'Height'.
326 public int getHeight()
332 * Returns the value of field 'markUnlinked'.
334 * @return the value of field 'MarkUnlinked'.
336 public boolean getMarkUnlinked()
338 return this._markUnlinked;
342 * Returns the value of field 'newick'.
344 * @return the value of field 'Newick'.
346 public java.lang.String getNewick()
352 * Returns the value of field 'showBootstrap'.
354 * @return the value of field 'ShowBootstrap'.
356 public boolean getShowBootstrap()
358 return this._showBootstrap;
362 * Returns the value of field 'showDistances'.
364 * @return the value of field 'ShowDistances'.
366 public boolean getShowDistances()
368 return this._showDistances;
372 * Returns the value of field 'threshold'.
374 * @return the value of field 'Threshold'.
376 public float getThreshold()
378 return this._threshold;
382 * Returns the value of field 'title'.
384 * @return the value of field 'Title'.
386 public java.lang.String getTitle()
392 * Returns the value of field 'width'.
394 * @return the value of field 'Width'.
396 public int getWidth()
402 * Returns the value of field 'xpos'.
404 * @return the value of field 'Xpos'.
412 * Returns the value of field 'ypos'.
414 * @return the value of field 'Ypos'.
422 * Method hasCurrentTree.
424 * @return true if at least one CurrentTree has been added
426 public boolean hasCurrentTree()
428 return this._has_currentTree;
432 * Method hasFitToWindow.
434 * @return true if at least one FitToWindow has been added
436 public boolean hasFitToWindow()
438 return this._has_fitToWindow;
442 * Method hasFontSize.
444 * @return true if at least one FontSize has been added
446 public boolean hasFontSize()
448 return this._has_fontSize;
452 * Method hasFontStyle.
454 * @return true if at least one FontStyle has been added
456 public boolean hasFontStyle()
458 return this._has_fontStyle;
464 * @return true if at least one Height has been added
466 public boolean hasHeight()
468 return this._has_height;
472 * Method hasMarkUnlinked.
474 * @return true if at least one MarkUnlinked has been added
476 public boolean hasMarkUnlinked()
478 return this._has_markUnlinked;
482 * Method hasShowBootstrap.
484 * @return true if at least one ShowBootstrap has been added
486 public boolean hasShowBootstrap()
488 return this._has_showBootstrap;
492 * Method hasShowDistances.
494 * @return true if at least one ShowDistances has been added
496 public boolean hasShowDistances()
498 return this._has_showDistances;
502 * Method hasThreshold.
504 * @return true if at least one Threshold has been added
506 public boolean hasThreshold()
508 return this._has_threshold;
514 * @return true if at least one Width has been added
516 public boolean hasWidth()
518 return this._has_width;
524 * @return true if at least one Xpos has been added
526 public boolean hasXpos()
528 return this._has_xpos;
534 * @return true if at least one Ypos has been added
536 public boolean hasYpos()
538 return this._has_ypos;
542 * Returns the value of field 'currentTree'.
544 * @return the value of field 'CurrentTree'.
546 public boolean isCurrentTree()
548 return this._currentTree;
552 * Returns the value of field 'fitToWindow'.
554 * @return the value of field 'FitToWindow'.
556 public boolean isFitToWindow()
558 return this._fitToWindow;
562 * Returns the value of field 'markUnlinked'.
564 * @return the value of field 'MarkUnlinked'.
566 public boolean isMarkUnlinked()
568 return this._markUnlinked;
572 * Returns the value of field 'showBootstrap'.
574 * @return the value of field 'ShowBootstrap'.
576 public boolean isShowBootstrap()
578 return this._showBootstrap;
582 * Returns the value of field 'showDistances'.
584 * @return the value of field 'ShowDistances'.
586 public boolean isShowDistances()
588 return this._showDistances;
594 * @return true if this object is valid according to the schema
596 public boolean isValid()
601 } catch (org.exolab.castor.xml.ValidationException vex)
612 * @throws org.exolab.castor.xml.MarshalException
613 * if object is null or if any SAXException is thrown during
615 * @throws org.exolab.castor.xml.ValidationException
616 * if this object is an invalid instance according to the schema
618 public void marshal(final java.io.Writer out)
619 throws org.exolab.castor.xml.MarshalException,
620 org.exolab.castor.xml.ValidationException
622 Marshaller.marshal(this, out);
629 * @throws java.io.IOException
630 * if an IOException occurs during marshaling
631 * @throws org.exolab.castor.xml.ValidationException
632 * if this object is an invalid instance according to the schema
633 * @throws org.exolab.castor.xml.MarshalException
634 * if object is null or if any SAXException is thrown during
637 public void marshal(final org.xml.sax.ContentHandler handler)
638 throws java.io.IOException,
639 org.exolab.castor.xml.MarshalException,
640 org.exolab.castor.xml.ValidationException
642 Marshaller.marshal(this, handler);
646 * Sets the value of field 'currentTree'.
649 * the value of field 'currentTree'.
651 public void setCurrentTree(final boolean currentTree)
653 this._currentTree = currentTree;
654 this._has_currentTree = true;
658 * Sets the value of field 'fitToWindow'.
661 * the value of field 'fitToWindow'.
663 public void setFitToWindow(final boolean fitToWindow)
665 this._fitToWindow = fitToWindow;
666 this._has_fitToWindow = true;
670 * Sets the value of field 'fontName'.
673 * the value of field 'fontName'.
675 public void setFontName(final java.lang.String fontName)
677 this._fontName = fontName;
681 * Sets the value of field 'fontSize'.
684 * the value of field 'fontSize'.
686 public void setFontSize(final int fontSize)
688 this._fontSize = fontSize;
689 this._has_fontSize = true;
693 * Sets the value of field 'fontStyle'.
696 * the value of field 'fontStyle'.
698 public void setFontStyle(final int fontStyle)
700 this._fontStyle = fontStyle;
701 this._has_fontStyle = true;
705 * Sets the value of field 'height'.
708 * the value of field 'height'.
710 public void setHeight(final int height)
712 this._height = height;
713 this._has_height = true;
717 * Sets the value of field 'markUnlinked'.
719 * @param markUnlinked
720 * the value of field 'markUnlinked'.
722 public void setMarkUnlinked(final boolean markUnlinked)
724 this._markUnlinked = markUnlinked;
725 this._has_markUnlinked = true;
729 * Sets the value of field 'newick'.
732 * the value of field 'newick'.
734 public void setNewick(final java.lang.String newick)
736 this._newick = newick;
740 * Sets the value of field 'showBootstrap'.
742 * @param showBootstrap
743 * the value of field 'showBootstrap'.
745 public void setShowBootstrap(final boolean showBootstrap)
747 this._showBootstrap = showBootstrap;
748 this._has_showBootstrap = true;
752 * Sets the value of field 'showDistances'.
754 * @param showDistances
755 * the value of field 'showDistances'.
757 public void setShowDistances(final boolean showDistances)
759 this._showDistances = showDistances;
760 this._has_showDistances = true;
764 * Sets the value of field 'threshold'.
767 * the value of field 'threshold'.
769 public void setThreshold(final float threshold)
771 this._threshold = threshold;
772 this._has_threshold = true;
776 * Sets the value of field 'title'.
779 * the value of field 'title'.
781 public void setTitle(final java.lang.String title)
787 * Sets the value of field 'width'.
790 * the value of field 'width'.
792 public void setWidth(final int width)
795 this._has_width = true;
799 * Sets the value of field 'xpos'.
802 * the value of field 'xpos'.
804 public void setXpos(final int xpos)
807 this._has_xpos = true;
811 * Sets the value of field 'ypos'.
814 * the value of field 'ypos'.
816 public void setYpos(final int ypos)
819 this._has_ypos = true;
826 * @throws org.exolab.castor.xml.MarshalException
827 * if object is null or if any SAXException is thrown during
829 * @throws org.exolab.castor.xml.ValidationException
830 * if this object is an invalid instance according to the schema
831 * @return the unmarshaled jalview.binding.Tree
833 public static jalview.binding.Tree unmarshal(final java.io.Reader reader)
834 throws org.exolab.castor.xml.MarshalException,
835 org.exolab.castor.xml.ValidationException
837 return (jalview.binding.Tree) Unmarshaller.unmarshal(
838 jalview.binding.Tree.class, reader);
844 * @throws org.exolab.castor.xml.ValidationException
845 * if this object is an invalid instance according to the schema
847 public void validate() throws org.exolab.castor.xml.ValidationException
849 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
850 validator.validate(this);