2 * Jalview - A Sequence Alignment Editor and Viewer
\r
3 * Copyright (C) 2005 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
24 public class SequenceNode extends BinaryNode {
\r
27 public float height;
\r
28 public float ycount;
\r
29 public Color color = Color.black;
\r
30 public boolean dummy = false;
\r
31 private boolean placeholder = false;
\r
33 public SequenceNode() {
\r
37 public SequenceNode(Object val, SequenceNode parent, float dist, String name) {
\r
38 super(val, parent, name);
\r
42 public SequenceNode(Object val, SequenceNode parent, String name,
\r
43 float dist, int bootstrap, boolean dummy) {
\r
44 super(val, parent, name);
\r
46 this.bootstrap = bootstrap;
\r
51 * @param dummy true if node is created for the representation of polytomous trees
\r
53 public boolean isDummy() {
\r
57 /* @param placeholder is true if the sequence refered to in the
\r
58 * element node is not actually present in the associated alignment
\r
60 public boolean isPlaceholder() {
\r
64 public boolean setDummy(boolean newstate) {
\r
65 boolean oldstate = dummy;
\r
71 public void setPlaceholder(boolean Placeholder) {
\r
72 this.placeholder = Placeholder;
\r
76 * ascends the tree but doesn't stop until a non-dummy node is discovered.
\r
77 * This will probably break if the tree is a mixture of BinaryNodes and SequenceNodes.
\r
79 public SequenceNode AscendTree() {
\r
80 SequenceNode c = this;
\r
83 c = (SequenceNode) c.parent();
\r
84 } while ((c != null) && c.dummy);
\r