2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
\r
3 * Copyright (C) 2010 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
\r
5 * This file is part of Jalview.
\r
7 * Jalview is free software: you can redistribute it and/or
\r
8 * modify it under the terms of the GNU General Public License
\r
9 * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
\r
11 * Jalview is distributed in the hope that it will be useful, but
\r
12 * WITHOUT ANY WARRANTY; without even the implied warranty
\r
13 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
\r
14 * PURPOSE. See the GNU General Public License for more details.
\r
16 * You should have received a copy of the GNU General Public License along with Jalview. If not, see <http://www.gnu.org/licenses/>.
\r
18 package jalview.schemabinding.version2;
\r
20 //---------------------------------/
\r
21 //- Imported classes and packages -/
\r
22 //---------------------------------/
\r
24 import org.exolab.castor.xml.Marshaller;
\r
25 import org.exolab.castor.xml.Unmarshaller;
\r
30 * @version $Revision$ $Date$
\r
32 public class Tree implements java.io.Serializable
\r
35 // --------------------------/
\r
36 // - Class/Member Variables -/
\r
37 // --------------------------/
\r
45 * keeps track of state for field: _width
\r
47 private boolean _has_width;
\r
52 private int _height;
\r
55 * keeps track of state for field: _height
\r
57 private boolean _has_height;
\r
65 * keeps track of state for field: _xpos
\r
67 private boolean _has_xpos;
\r
75 * keeps track of state for field: _ypos
\r
77 private boolean _has_ypos;
\r
82 private java.lang.String _fontName;
\r
87 private int _fontSize;
\r
90 * keeps track of state for field: _fontSize
\r
92 private boolean _has_fontSize;
\r
97 private int _fontStyle;
\r
100 * keeps track of state for field: _fontStyle
\r
102 private boolean _has_fontStyle;
\r
105 * Field _threshold.
\r
107 private float _threshold;
\r
110 * keeps track of state for field: _threshold
\r
112 private boolean _has_threshold;
\r
115 * Field _showBootstrap.
\r
117 private boolean _showBootstrap;
\r
120 * keeps track of state for field: _showBootstrap
\r
122 private boolean _has_showBootstrap;
\r
125 * Field _showDistances.
\r
127 private boolean _showDistances;
\r
130 * keeps track of state for field: _showDistances
\r
132 private boolean _has_showDistances;
\r
135 * Field _markUnlinked.
\r
137 private boolean _markUnlinked;
\r
140 * keeps track of state for field: _markUnlinked
\r
142 private boolean _has_markUnlinked;
\r
145 * Field _fitToWindow.
\r
147 private boolean _fitToWindow;
\r
150 * keeps track of state for field: _fitToWindow
\r
152 private boolean _has_fitToWindow;
\r
155 * Field _currentTree.
\r
157 private boolean _currentTree;
\r
160 * keeps track of state for field: _currentTree
\r
162 private boolean _has_currentTree;
\r
165 * Tree ID added for binding tree visualization settings to vamsas document
\r
166 * trees in jalview 2.4.1
\r
168 private java.lang.String _id;
\r
173 private java.lang.String _title;
\r
178 private java.lang.String _newick;
\r
180 // ----------------/
\r
181 // - Constructors -/
\r
182 // ----------------/
\r
195 public void deleteCurrentTree()
\r
197 this._has_currentTree = false;
\r
202 public void deleteFitToWindow()
\r
204 this._has_fitToWindow = false;
\r
209 public void deleteFontSize()
\r
211 this._has_fontSize = false;
\r
216 public void deleteFontStyle()
\r
218 this._has_fontStyle = false;
\r
223 public void deleteHeight()
\r
225 this._has_height = false;
\r
230 public void deleteMarkUnlinked()
\r
232 this._has_markUnlinked = false;
\r
237 public void deleteShowBootstrap()
\r
239 this._has_showBootstrap = false;
\r
244 public void deleteShowDistances()
\r
246 this._has_showDistances = false;
\r
251 public void deleteThreshold()
\r
253 this._has_threshold = false;
\r
258 public void deleteWidth()
\r
260 this._has_width = false;
\r
265 public void deleteXpos()
\r
267 this._has_xpos = false;
\r
272 public void deleteYpos()
\r
274 this._has_ypos = false;
\r
278 * Returns the value of field 'currentTree'.
\r
280 * @return the value of field 'CurrentTree'.
\r
282 public boolean getCurrentTree()
\r
284 return this._currentTree;
\r
288 * Returns the value of field 'fitToWindow'.
\r
290 * @return the value of field 'FitToWindow'.
\r
292 public boolean getFitToWindow()
\r
294 return this._fitToWindow;
\r
298 * Returns the value of field 'fontName'.
\r
300 * @return the value of field 'FontName'.
\r
302 public java.lang.String getFontName()
\r
304 return this._fontName;
\r
308 * Returns the value of field 'fontSize'.
\r
310 * @return the value of field 'FontSize'.
\r
312 public int getFontSize()
\r
314 return this._fontSize;
\r
318 * Returns the value of field 'fontStyle'.
\r
320 * @return the value of field 'FontStyle'.
\r
322 public int getFontStyle()
\r
324 return this._fontStyle;
\r
328 * Returns the value of field 'height'.
\r
330 * @return the value of field 'Height'.
\r
332 public int getHeight()
\r
334 return this._height;
\r
338 * Returns the value of field 'id'. The field 'id' has the following
\r
339 * description: Tree ID added for binding tree visualization settings to
\r
340 * vamsas document trees in jalview 2.4.1
\r
342 * @return the value of field 'Id'.
\r
344 public java.lang.String getId()
\r
350 * Returns the value of field 'markUnlinked'.
\r
352 * @return the value of field 'MarkUnlinked'.
\r
354 public boolean getMarkUnlinked()
\r
356 return this._markUnlinked;
\r
360 * Returns the value of field 'newick'.
\r
362 * @return the value of field 'Newick'.
\r
364 public java.lang.String getNewick()
\r
366 return this._newick;
\r
370 * Returns the value of field 'showBootstrap'.
\r
372 * @return the value of field 'ShowBootstrap'.
\r
374 public boolean getShowBootstrap()
\r
376 return this._showBootstrap;
\r
380 * Returns the value of field 'showDistances'.
\r
382 * @return the value of field 'ShowDistances'.
\r
384 public boolean getShowDistances()
\r
386 return this._showDistances;
\r
390 * Returns the value of field 'threshold'.
\r
392 * @return the value of field 'Threshold'.
\r
394 public float getThreshold()
\r
396 return this._threshold;
\r
400 * Returns the value of field 'title'.
\r
402 * @return the value of field 'Title'.
\r
404 public java.lang.String getTitle()
\r
406 return this._title;
\r
410 * Returns the value of field 'width'.
\r
412 * @return the value of field 'Width'.
\r
414 public int getWidth()
\r
416 return this._width;
\r
420 * Returns the value of field 'xpos'.
\r
422 * @return the value of field 'Xpos'.
\r
424 public int getXpos()
\r
430 * Returns the value of field 'ypos'.
\r
432 * @return the value of field 'Ypos'.
\r
434 public int getYpos()
\r
440 * Method hasCurrentTree.
\r
442 * @return true if at least one CurrentTree has been added
\r
444 public boolean hasCurrentTree()
\r
446 return this._has_currentTree;
\r
450 * Method hasFitToWindow.
\r
452 * @return true if at least one FitToWindow has been added
\r
454 public boolean hasFitToWindow()
\r
456 return this._has_fitToWindow;
\r
460 * Method hasFontSize.
\r
462 * @return true if at least one FontSize has been added
\r
464 public boolean hasFontSize()
\r
466 return this._has_fontSize;
\r
470 * Method hasFontStyle.
\r
472 * @return true if at least one FontStyle has been added
\r
474 public boolean hasFontStyle()
\r
476 return this._has_fontStyle;
\r
480 * Method hasHeight.
\r
482 * @return true if at least one Height has been added
\r
484 public boolean hasHeight()
\r
486 return this._has_height;
\r
490 * Method hasMarkUnlinked.
\r
492 * @return true if at least one MarkUnlinked has been added
\r
494 public boolean hasMarkUnlinked()
\r
496 return this._has_markUnlinked;
\r
500 * Method hasShowBootstrap.
\r
502 * @return true if at least one ShowBootstrap has been added
\r
504 public boolean hasShowBootstrap()
\r
506 return this._has_showBootstrap;
\r
510 * Method hasShowDistances.
\r
512 * @return true if at least one ShowDistances has been added
\r
514 public boolean hasShowDistances()
\r
516 return this._has_showDistances;
\r
520 * Method hasThreshold.
\r
522 * @return true if at least one Threshold has been added
\r
524 public boolean hasThreshold()
\r
526 return this._has_threshold;
\r
532 * @return true if at least one Width has been added
\r
534 public boolean hasWidth()
\r
536 return this._has_width;
\r
542 * @return true if at least one Xpos has been added
\r
544 public boolean hasXpos()
\r
546 return this._has_xpos;
\r
552 * @return true if at least one Ypos has been added
\r
554 public boolean hasYpos()
\r
556 return this._has_ypos;
\r
560 * Returns the value of field 'currentTree'.
\r
562 * @return the value of field 'CurrentTree'.
\r
564 public boolean isCurrentTree()
\r
566 return this._currentTree;
\r
570 * Returns the value of field 'fitToWindow'.
\r
572 * @return the value of field 'FitToWindow'.
\r
574 public boolean isFitToWindow()
\r
576 return this._fitToWindow;
\r
580 * Returns the value of field 'markUnlinked'.
\r
582 * @return the value of field 'MarkUnlinked'.
\r
584 public boolean isMarkUnlinked()
\r
586 return this._markUnlinked;
\r
590 * Returns the value of field 'showBootstrap'.
\r
592 * @return the value of field 'ShowBootstrap'.
\r
594 public boolean isShowBootstrap()
\r
596 return this._showBootstrap;
\r
600 * Returns the value of field 'showDistances'.
\r
602 * @return the value of field 'ShowDistances'.
\r
604 public boolean isShowDistances()
\r
606 return this._showDistances;
\r
612 * @return true if this object is valid according to the schema
\r
614 public boolean isValid()
\r
619 } catch (org.exolab.castor.xml.ValidationException vex)
\r
630 * @throws org.exolab.castor.xml.MarshalException
\r
631 * if object is null or if any SAXException is thrown during
\r
633 * @throws org.exolab.castor.xml.ValidationException
\r
634 * if this object is an invalid instance according to the schema
\r
636 public void marshal(final java.io.Writer out)
\r
637 throws org.exolab.castor.xml.MarshalException,
\r
638 org.exolab.castor.xml.ValidationException
\r
640 Marshaller.marshal(this, out);
\r
647 * @throws java.io.IOException
\r
648 * if an IOException occurs during marshaling
\r
649 * @throws org.exolab.castor.xml.ValidationException
\r
650 * if this object is an invalid instance according to the schema
\r
651 * @throws org.exolab.castor.xml.MarshalException
\r
652 * if object is null or if any SAXException is thrown during
\r
655 public void marshal(final org.xml.sax.ContentHandler handler)
\r
656 throws java.io.IOException,
\r
657 org.exolab.castor.xml.MarshalException,
\r
658 org.exolab.castor.xml.ValidationException
\r
660 Marshaller.marshal(this, handler);
\r
664 * Sets the value of field 'currentTree'.
\r
666 * @param currentTree
\r
667 * the value of field 'currentTree'.
\r
669 public void setCurrentTree(final boolean currentTree)
\r
671 this._currentTree = currentTree;
\r
672 this._has_currentTree = true;
\r
676 * Sets the value of field 'fitToWindow'.
\r
678 * @param fitToWindow
\r
679 * the value of field 'fitToWindow'.
\r
681 public void setFitToWindow(final boolean fitToWindow)
\r
683 this._fitToWindow = fitToWindow;
\r
684 this._has_fitToWindow = true;
\r
688 * Sets the value of field 'fontName'.
\r
691 * the value of field 'fontName'.
\r
693 public void setFontName(final java.lang.String fontName)
\r
695 this._fontName = fontName;
\r
699 * Sets the value of field 'fontSize'.
\r
702 * the value of field 'fontSize'.
\r
704 public void setFontSize(final int fontSize)
\r
706 this._fontSize = fontSize;
\r
707 this._has_fontSize = true;
\r
711 * Sets the value of field 'fontStyle'.
\r
714 * the value of field 'fontStyle'.
\r
716 public void setFontStyle(final int fontStyle)
\r
718 this._fontStyle = fontStyle;
\r
719 this._has_fontStyle = true;
\r
723 * Sets the value of field 'height'.
\r
726 * the value of field 'height'.
\r
728 public void setHeight(final int height)
\r
730 this._height = height;
\r
731 this._has_height = true;
\r
735 * Sets the value of field 'id'. The field 'id' has the following description:
\r
736 * Tree ID added for binding tree visualization settings to vamsas document
\r
737 * trees in jalview 2.4.1
\r
740 * the value of field 'id'.
\r
742 public void setId(final java.lang.String id)
\r
748 * Sets the value of field 'markUnlinked'.
\r
750 * @param markUnlinked
\r
751 * the value of field 'markUnlinked'.
\r
753 public void setMarkUnlinked(final boolean markUnlinked)
\r
755 this._markUnlinked = markUnlinked;
\r
756 this._has_markUnlinked = true;
\r
760 * Sets the value of field 'newick'.
\r
763 * the value of field 'newick'.
\r
765 public void setNewick(final java.lang.String newick)
\r
767 this._newick = newick;
\r
771 * Sets the value of field 'showBootstrap'.
\r
773 * @param showBootstrap
\r
774 * the value of field 'showBootstrap'.
\r
776 public void setShowBootstrap(final boolean showBootstrap)
\r
778 this._showBootstrap = showBootstrap;
\r
779 this._has_showBootstrap = true;
\r
783 * Sets the value of field 'showDistances'.
\r
785 * @param showDistances
\r
786 * the value of field 'showDistances'.
\r
788 public void setShowDistances(final boolean showDistances)
\r
790 this._showDistances = showDistances;
\r
791 this._has_showDistances = true;
\r
795 * Sets the value of field 'threshold'.
\r
798 * the value of field 'threshold'.
\r
800 public void setThreshold(final float threshold)
\r
802 this._threshold = threshold;
\r
803 this._has_threshold = true;
\r
807 * Sets the value of field 'title'.
\r
810 * the value of field 'title'.
\r
812 public void setTitle(final java.lang.String title)
\r
814 this._title = title;
\r
818 * Sets the value of field 'width'.
\r
821 * the value of field 'width'.
\r
823 public void setWidth(final int width)
\r
825 this._width = width;
\r
826 this._has_width = true;
\r
830 * Sets the value of field 'xpos'.
\r
833 * the value of field 'xpos'.
\r
835 public void setXpos(final int xpos)
\r
838 this._has_xpos = true;
\r
842 * Sets the value of field 'ypos'.
\r
845 * the value of field 'ypos'.
\r
847 public void setYpos(final int ypos)
\r
850 this._has_ypos = true;
\r
854 * Method unmarshal.
\r
857 * @throws org.exolab.castor.xml.MarshalException
\r
858 * if object is null or if any SAXException is thrown during
\r
860 * @throws org.exolab.castor.xml.ValidationException
\r
861 * if this object is an invalid instance according to the schema
\r
862 * @return the unmarshaled jalview.schemabinding.version2.Tree
\r
864 public static jalview.schemabinding.version2.Tree unmarshal(
\r
865 final java.io.Reader reader)
\r
866 throws org.exolab.castor.xml.MarshalException,
\r
867 org.exolab.castor.xml.ValidationException
\r
869 return (jalview.schemabinding.version2.Tree) Unmarshaller.unmarshal(
\r
870 jalview.schemabinding.version2.Tree.class, reader);
\r
876 * @throws org.exolab.castor.xml.ValidationException
\r
877 * if this object is an invalid instance according to the schema
\r
879 public void validate() throws org.exolab.castor.xml.ValidationException
\r
881 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
\r
882 validator.validate(this);
\r