package jalview.datamodel; import java.awt.Color; public class SequenceNode extends BinaryNode { public float dist; public int count; public float height; public float ycount; public Color color = Color.black; public boolean dummy = false; public SequenceNode() { super(); } public SequenceNode(Object val, SequenceNode parent, float dist,String name) { super(val,parent,name); this.dist = dist; } public SequenceNode(Object val, SequenceNode parent, String name, float dist, int bootstrap, boolean dummy) { super(val,parent,name); this.dist = dist; this.bootstrap = bootstrap; this.dummy = dummy; } /** * @param dummy true if node is created for the representation of polytomous trees */ public boolean isDummy() { return dummy; } public boolean setDummy(boolean newstate) { boolean oldstate = dummy; dummy = newstate; return oldstate; } /** * ascends the tree but doesn't stop until a non-dummy node is discovered. * This will probably break if the tree is a mixture of BinaryNodes and SequenceNodes. */ public SequenceNode AscendTree() { SequenceNode c = this; do { c = (SequenceNode) c.parent(); } while (c!=null && c.dummy); return c; } }