2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.1)
3 * Copyright (C) 2014 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 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/>.
17 * The Jalview Authors are detailed in the 'AUTHORS' file.
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 trees
107 public boolean isDummy()
113 * @param placeholder is true if the sequence refered to in the element node
114 * is not actually present in the associated alignment
116 public boolean isPlaceholder()
127 * @return DOCUMENT ME!
129 public boolean setDummy(boolean newstate)
131 boolean oldstate = dummy;
143 public void setPlaceholder(boolean Placeholder)
145 this.placeholder = Placeholder;
149 * ascends the tree but doesn't stop until a non-dummy node is discovered.
150 * This will probably break if the tree is a mixture of BinaryNodes and
153 public SequenceNode AscendTree()
155 SequenceNode c = this;
159 c = (SequenceNode) c.parent();
160 } while ((c != null) && c.dummy);
166 * test if this node has a name that might be a label rather than a bootstrap
169 * @return true if node has a non-numeric label
171 public boolean isSequenceLabel()
173 if (name != null && name.length() > 0)
175 for (int c = 0, s = name.length(); c < s; c++)
177 char q = name.charAt(c);
178 if ('0' <= q && q <= '9')