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
20 package jalview.datamodel;
\r
24 public class SequenceNode extends BinaryNode {
\r
28 public float height;
\r
29 public float ycount;
\r
30 public Color color = Color.black;
\r
31 public boolean dummy = false;
\r
32 private boolean placeholder = false;
\r
34 public SequenceNode() {
\r
38 public SequenceNode(Object val, SequenceNode parent, float dist,String name) {
\r
39 super(val,parent,name);
\r
42 public SequenceNode(Object val, SequenceNode parent, String name, float dist, int bootstrap, boolean dummy) {
\r
43 super(val,parent,name);
\r
45 this.bootstrap = bootstrap;
\r
51 * @param dummy true if node is created for the representation of polytomous trees
\r
54 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
65 public boolean setDummy(boolean newstate) {
\r
66 boolean oldstate = dummy;
\r
71 public void setPlaceholder(boolean Placeholder)
\r
73 this.placeholder = Placeholder;
\r
77 * ascends the tree but doesn't stop until a non-dummy node is discovered.
\r
78 * This will probably break if the tree is a mixture of BinaryNodes and SequenceNodes.
\r
81 public SequenceNode AscendTree() {
\r
82 SequenceNode c = this;
\r
84 c = (SequenceNode) c.parent();
\r
85 } while (c!=null && c.dummy);
\r