2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.4)
3 * Copyright (C) 2008 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.datamodel;
29 public class SequenceNode extends BinaryNode
44 public Color color = Color.black;
47 public boolean dummy = false;
49 private boolean placeholder = false;
52 * Creates a new SequenceNode object.
60 * Creates a new SequenceNode object.
71 public SequenceNode(Object val, SequenceNode parent, float dist,
74 super(val, parent, name);
79 * Creates a new SequenceNode object.
94 public SequenceNode(Object val, SequenceNode parent, String name,
95 float dist, int bootstrap, boolean dummy)
97 super(val, parent, name);
99 this.bootstrap = bootstrap;
105 * true if node is created for the representation of polytomous
108 public boolean isDummy()
114 * @param placeholder is true if the sequence refered to in the element node
115 * is not actually present in the associated alignment
117 public boolean isPlaceholder()
128 * @return DOCUMENT ME!
130 public boolean setDummy(boolean newstate)
132 boolean oldstate = dummy;
144 public void setPlaceholder(boolean Placeholder)
146 this.placeholder = Placeholder;
150 * ascends the tree but doesn't stop until a non-dummy node is discovered.
151 * This will probably break if the tree is a mixture of BinaryNodes and
154 public SequenceNode AscendTree()
156 SequenceNode c = this;
160 c = (SequenceNode) c.parent();
161 } while ((c != null) && c.dummy);
167 * test if this node has a name that might be a label rather than a bootstrap
170 * @return true if node has a non-numeric label
172 public boolean isSequenceLabel()
174 if (name != null && name.length() > 0)
176 for (int c = 0, s = name.length(); c < s; c++)
178 char q = name.charAt(c);
179 if ('0' <= q && q <= '9')