2 * Jalview - A Sequence Alignment Editor and Viewer
\r
3 * Copyright (C) 2007 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
\r
5 * This program is free software; you can redistribute it and/or
\r
6 * modify it under the terms of the GNU General Public License
\r
7 * as published by the Free Software Foundation; either version 2
\r
8 * of the License, or (at your option) any later version.
\r
10 * This program is distributed in the hope that it will be useful,
\r
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
13 * GNU General Public License for more details.
\r
15 * You should have received a copy of the GNU General Public License
\r
16 * along with this program; if not, write to the Free Software
\r
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
\r
19 package jalview.datamodel;
\r
27 * @version $Revision$
\r
29 public class SequenceNode
\r
32 /** DOCUMENT ME!! */
\r
35 /** DOCUMENT ME!! */
\r
38 /** DOCUMENT ME!! */
\r
39 public float height;
\r
41 /** DOCUMENT ME!! */
\r
42 public float ycount;
\r
44 /** DOCUMENT ME!! */
\r
45 public Color color = Color.black;
\r
47 /** DOCUMENT ME!! */
\r
48 public boolean dummy = false;
\r
49 private boolean placeholder = false;
\r
52 * Creates a new SequenceNode object.
\r
54 public SequenceNode()
\r
60 * Creates a new SequenceNode object.
\r
62 * @param val DOCUMENT ME!
\r
63 * @param parent DOCUMENT ME!
\r
64 * @param dist DOCUMENT ME!
\r
65 * @param name DOCUMENT ME!
\r
67 public SequenceNode(Object val, SequenceNode parent, float dist, String name)
\r
69 super(val, parent, name);
\r
74 * Creates a new SequenceNode object.
\r
76 * @param val DOCUMENT ME!
\r
77 * @param parent DOCUMENT ME!
\r
78 * @param name DOCUMENT ME!
\r
79 * @param dist DOCUMENT ME!
\r
80 * @param bootstrap DOCUMENT ME!
\r
81 * @param dummy DOCUMENT ME!
\r
83 public SequenceNode(Object val, SequenceNode parent, String name,
\r
84 float dist, int bootstrap, boolean dummy)
\r
86 super(val, parent, name);
\r
88 this.bootstrap = bootstrap;
\r
93 * @param dummy true if node is created for the representation of polytomous trees
\r
95 public boolean isDummy()
\r
100 /* @param placeholder is true if the sequence refered to in the
\r
101 * element node is not actually present in the associated alignment
\r
103 public boolean isPlaceholder()
\r
105 return placeholder;
\r
111 * @param newstate DOCUMENT ME!
\r
113 * @return DOCUMENT ME!
\r
115 public boolean setDummy(boolean newstate)
\r
117 boolean oldstate = dummy;
\r
126 * @param Placeholder DOCUMENT ME!
\r
128 public void setPlaceholder(boolean Placeholder)
\r
130 this.placeholder = Placeholder;
\r
134 * ascends the tree but doesn't stop until a non-dummy node is discovered.
\r
135 * This will probably break if the tree is a mixture of BinaryNodes and SequenceNodes.
\r
137 public SequenceNode AscendTree()
\r
139 SequenceNode c = this;
\r
143 c = (SequenceNode) c.parent();
\r
145 while ( (c != null) && c.dummy);
\r