2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.4.0.b2)
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;
190 public void deleteCurrentTree()
192 this._has_currentTree = false;
197 public void deleteFitToWindow()
199 this._has_fitToWindow = false;
204 public void deleteFontSize()
206 this._has_fontSize = false;
211 public void deleteFontStyle()
213 this._has_fontStyle = false;
218 public void deleteHeight()
220 this._has_height = false;
225 public void deleteMarkUnlinked()
227 this._has_markUnlinked = false;
232 public void deleteShowBootstrap()
234 this._has_showBootstrap = false;
239 public void deleteShowDistances()
241 this._has_showDistances = false;
246 public void deleteThreshold()
248 this._has_threshold = false;
253 public void deleteWidth()
255 this._has_width = false;
260 public void deleteXpos()
262 this._has_xpos = false;
267 public void deleteYpos()
269 this._has_ypos = false;
273 * Returns the value of field 'currentTree'.
275 * @return the value of field 'CurrentTree'.
277 public boolean getCurrentTree()
279 return this._currentTree;
283 * Returns the value of field 'fitToWindow'.
285 * @return the value of field 'FitToWindow'.
287 public boolean getFitToWindow()
289 return this._fitToWindow;
293 * Returns the value of field 'fontName'.
295 * @return the value of field 'FontName'.
297 public java.lang.String getFontName()
299 return this._fontName;
303 * Returns the value of field 'fontSize'.
305 * @return the value of field 'FontSize'.
307 public int getFontSize()
309 return this._fontSize;
313 * Returns the value of field 'fontStyle'.
315 * @return the value of field 'FontStyle'.
317 public int getFontStyle()
319 return this._fontStyle;
323 * Returns the value of field 'height'.
325 * @return the value of field 'Height'.
327 public int getHeight()
333 * Returns the value of field 'markUnlinked'.
335 * @return the value of field 'MarkUnlinked'.
337 public boolean getMarkUnlinked()
339 return this._markUnlinked;
343 * Returns the value of field 'newick'.
345 * @return the value of field 'Newick'.
347 public java.lang.String getNewick()
353 * Returns the value of field 'showBootstrap'.
355 * @return the value of field 'ShowBootstrap'.
357 public boolean getShowBootstrap()
359 return this._showBootstrap;
363 * Returns the value of field 'showDistances'.
365 * @return the value of field 'ShowDistances'.
367 public boolean getShowDistances()
369 return this._showDistances;
373 * Returns the value of field 'threshold'.
375 * @return the value of field 'Threshold'.
377 public float getThreshold()
379 return this._threshold;
383 * Returns the value of field 'title'.
385 * @return the value of field 'Title'.
387 public java.lang.String getTitle()
393 * Returns the value of field 'width'.
395 * @return the value of field 'Width'.
397 public int getWidth()
403 * Returns the value of field 'xpos'.
405 * @return the value of field 'Xpos'.
413 * Returns the value of field 'ypos'.
415 * @return the value of field 'Ypos'.
423 * Method hasCurrentTree.
425 * @return true if at least one CurrentTree has been added
427 public boolean hasCurrentTree()
429 return this._has_currentTree;
433 * Method hasFitToWindow.
435 * @return true if at least one FitToWindow has been added
437 public boolean hasFitToWindow()
439 return this._has_fitToWindow;
443 * Method hasFontSize.
445 * @return true if at least one FontSize has been added
447 public boolean hasFontSize()
449 return this._has_fontSize;
453 * Method hasFontStyle.
455 * @return true if at least one FontStyle has been added
457 public boolean hasFontStyle()
459 return this._has_fontStyle;
465 * @return true if at least one Height has been added
467 public boolean hasHeight()
469 return this._has_height;
473 * Method hasMarkUnlinked.
475 * @return true if at least one MarkUnlinked has been added
477 public boolean hasMarkUnlinked()
479 return this._has_markUnlinked;
483 * Method hasShowBootstrap.
485 * @return true if at least one ShowBootstrap has been added
487 public boolean hasShowBootstrap()
489 return this._has_showBootstrap;
493 * Method hasShowDistances.
495 * @return true if at least one ShowDistances has been added
497 public boolean hasShowDistances()
499 return this._has_showDistances;
503 * Method hasThreshold.
505 * @return true if at least one Threshold has been added
507 public boolean hasThreshold()
509 return this._has_threshold;
515 * @return true if at least one Width has been added
517 public boolean hasWidth()
519 return this._has_width;
525 * @return true if at least one Xpos has been added
527 public boolean hasXpos()
529 return this._has_xpos;
535 * @return true if at least one Ypos has been added
537 public boolean hasYpos()
539 return this._has_ypos;
543 * Returns the value of field 'currentTree'.
545 * @return the value of field 'CurrentTree'.
547 public boolean isCurrentTree()
549 return this._currentTree;
553 * Returns the value of field 'fitToWindow'.
555 * @return the value of field 'FitToWindow'.
557 public boolean isFitToWindow()
559 return this._fitToWindow;
563 * Returns the value of field 'markUnlinked'.
565 * @return the value of field 'MarkUnlinked'.
567 public boolean isMarkUnlinked()
569 return this._markUnlinked;
573 * Returns the value of field 'showBootstrap'.
575 * @return the value of field 'ShowBootstrap'.
577 public boolean isShowBootstrap()
579 return this._showBootstrap;
583 * Returns the value of field 'showDistances'.
585 * @return the value of field 'ShowDistances'.
587 public boolean isShowDistances()
589 return this._showDistances;
595 * @return true if this object is valid according to the schema
597 public boolean isValid()
602 } catch (org.exolab.castor.xml.ValidationException vex)
613 * @throws org.exolab.castor.xml.MarshalException
614 * if object is null or if any SAXException is thrown during
616 * @throws org.exolab.castor.xml.ValidationException
617 * if this object is an invalid instance according to the
620 public void marshal(final java.io.Writer out)
621 throws org.exolab.castor.xml.MarshalException,
622 org.exolab.castor.xml.ValidationException
624 Marshaller.marshal(this, out);
631 * @throws java.io.IOException
632 * if an IOException occurs during marshaling
633 * @throws org.exolab.castor.xml.ValidationException
634 * if this object is an invalid instance according to the
636 * @throws org.exolab.castor.xml.MarshalException
637 * if object is null or if any SAXException is thrown during
640 public void marshal(final org.xml.sax.ContentHandler handler)
641 throws java.io.IOException,
642 org.exolab.castor.xml.MarshalException,
643 org.exolab.castor.xml.ValidationException
645 Marshaller.marshal(this, handler);
649 * Sets the value of field 'currentTree'.
652 * the value of field 'currentTree'.
654 public void setCurrentTree(final boolean currentTree)
656 this._currentTree = currentTree;
657 this._has_currentTree = true;
661 * Sets the value of field 'fitToWindow'.
664 * the value of field 'fitToWindow'.
666 public void setFitToWindow(final boolean fitToWindow)
668 this._fitToWindow = fitToWindow;
669 this._has_fitToWindow = true;
673 * Sets the value of field 'fontName'.
676 * the value of field 'fontName'.
678 public void setFontName(final java.lang.String fontName)
680 this._fontName = fontName;
684 * Sets the value of field 'fontSize'.
687 * the value of field 'fontSize'.
689 public void setFontSize(final int fontSize)
691 this._fontSize = fontSize;
692 this._has_fontSize = true;
696 * Sets the value of field 'fontStyle'.
699 * the value of field 'fontStyle'.
701 public void setFontStyle(final int fontStyle)
703 this._fontStyle = fontStyle;
704 this._has_fontStyle = true;
708 * Sets the value of field 'height'.
711 * the value of field 'height'.
713 public void setHeight(final int height)
715 this._height = height;
716 this._has_height = true;
720 * Sets the value of field 'markUnlinked'.
722 * @param markUnlinked
723 * the value of field 'markUnlinked'.
725 public void setMarkUnlinked(final boolean markUnlinked)
727 this._markUnlinked = markUnlinked;
728 this._has_markUnlinked = true;
732 * Sets the value of field 'newick'.
735 * the value of field 'newick'.
737 public void setNewick(final java.lang.String newick)
739 this._newick = newick;
743 * Sets the value of field 'showBootstrap'.
745 * @param showBootstrap
746 * the value of field 'showBootstrap'.
748 public void setShowBootstrap(final boolean showBootstrap)
750 this._showBootstrap = showBootstrap;
751 this._has_showBootstrap = true;
755 * Sets the value of field 'showDistances'.
757 * @param showDistances
758 * the value of field 'showDistances'.
760 public void setShowDistances(final boolean showDistances)
762 this._showDistances = showDistances;
763 this._has_showDistances = true;
767 * Sets the value of field 'threshold'.
770 * the value of field 'threshold'.
772 public void setThreshold(final float threshold)
774 this._threshold = threshold;
775 this._has_threshold = true;
779 * Sets the value of field 'title'.
782 * the value of field 'title'.
784 public void setTitle(final java.lang.String title)
790 * Sets the value of field 'width'.
793 * the value of field 'width'.
795 public void setWidth(final int width)
798 this._has_width = true;
802 * Sets the value of field 'xpos'.
805 * the value of field 'xpos'.
807 public void setXpos(final int xpos)
810 this._has_xpos = true;
814 * Sets the value of field 'ypos'.
817 * the value of field 'ypos'.
819 public void setYpos(final int ypos)
822 this._has_ypos = true;
829 * @throws org.exolab.castor.xml.MarshalException
830 * if object is null or if any SAXException is thrown during
832 * @throws org.exolab.castor.xml.ValidationException
833 * if this object is an invalid instance according to the
835 * @return the unmarshaled jalview.binding.Tree
837 public static jalview.binding.Tree unmarshal(final java.io.Reader reader)
838 throws org.exolab.castor.xml.MarshalException,
839 org.exolab.castor.xml.ValidationException
841 return (jalview.binding.Tree) Unmarshaller.unmarshal(
842 jalview.binding.Tree.class, reader);
848 * @throws org.exolab.castor.xml.ValidationException
849 * if this object is an invalid instance according to the
852 public void validate() throws org.exolab.castor.xml.ValidationException
854 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
855 validator.validate(this);