2 * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3 * Copyright (C) $$Year-Rel$$ The Jalview Authors
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
10 * of the License, or (at your option) any later version.
12 * Jalview is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty
14 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
19 * The Jalview Authors are detailed in the 'AUTHORS' file.
21 package jalview.datamodel;
23 import java.awt.Color;
31 public class SequenceNode extends BinaryNode
46 public Color color = Color.black;
49 public boolean dummy = false;
51 private boolean placeholder = false;
54 * Creates a new SequenceNode object.
62 * Creates a new SequenceNode object.
73 public SequenceNode(Object val, SequenceNode parent, double dist,
76 super(val, parent, name);
81 * Creates a new SequenceNode object.
96 public SequenceNode(Object val, SequenceNode parent, String name,
97 double dist, int bootstrap, boolean dummy)
99 super(val, parent, name);
101 this.bootstrap = bootstrap;
107 * true if node is created for the representation of polytomous trees
109 public boolean isDummy()
115 * @param placeholder is true if the sequence refered to in the element node
116 * is not actually present in the associated alignment
118 public boolean isPlaceholder()
129 * @return DOCUMENT ME!
131 public boolean setDummy(boolean newstate)
133 boolean oldstate = dummy;
145 public void setPlaceholder(boolean Placeholder)
147 this.placeholder = Placeholder;
151 * ascends the tree but doesn't stop until a non-dummy node is discovered.
152 * This will probably break if the tree is a mixture of BinaryNodes and
155 public SequenceNode AscendTree()
157 SequenceNode c = this;
161 c = (SequenceNode) c.parent();
162 } while ((c != null) && c.dummy);
168 * test if this node has a name that might be a label rather than a bootstrap
171 * @return true if node has a non-numeric label
173 public boolean isSequenceLabel()
175 if (name != null && name.length() > 0)
177 for (int c = 0, s = name.length(); c < s; c++)
179 char q = name.charAt(c);
180 if ('0' <= q && q <= '9')