2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
3 * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, 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.datamodel;
28 public class SequenceNode extends BinaryNode
43 public Color color = Color.black;
46 public boolean dummy = false;
48 private boolean placeholder = false;
51 * Creates a new SequenceNode object.
59 * Creates a new SequenceNode object.
70 public SequenceNode(Object val, SequenceNode parent, float dist,
73 super(val, parent, name);
78 * Creates a new SequenceNode object.
93 public SequenceNode(Object val, SequenceNode parent, String name,
94 float dist, int bootstrap, boolean dummy)
96 super(val, parent, name);
98 this.bootstrap = bootstrap;
104 * true if node is created for the representation of polytomous trees
106 public boolean isDummy()
112 * @param placeholder is true if the sequence refered to in the element node
113 * is not actually present in the associated alignment
115 public boolean isPlaceholder()
126 * @return DOCUMENT ME!
128 public boolean setDummy(boolean newstate)
130 boolean oldstate = dummy;
142 public void setPlaceholder(boolean Placeholder)
144 this.placeholder = Placeholder;
148 * ascends the tree but doesn't stop until a non-dummy node is discovered.
149 * This will probably break if the tree is a mixture of BinaryNodes and
152 public SequenceNode AscendTree()
154 SequenceNode c = this;
158 c = (SequenceNode) c.parent();
159 } while ((c != null) && c.dummy);
165 * test if this node has a name that might be a label rather than a bootstrap
168 * @return true if node has a non-numeric label
170 public boolean isSequenceLabel()
172 if (name != null && name.length() > 0)
174 for (int c = 0, s = name.length(); c < s; c++)
176 char q = name.charAt(c);
177 if ('0' <= q && q <= '9')