X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fdatamodel%2FSequenceNode.java;h=9d00fa5ac820c0adcc6fdb9304229cc31c344ac4;hb=a7169b1c72607f3c9357195b4999869650a2a891;hp=74776ea5ddb237765a1aa15cce1b9762861d7b4e;hpb=99c58ee0ae2a848f982552e53feaf6d5cb9925e5;p=jalview.git
diff --git a/src/jalview/datamodel/SequenceNode.java b/src/jalview/datamodel/SequenceNode.java
index 74776ea..9d00fa5 100755
--- a/src/jalview/datamodel/SequenceNode.java
+++ b/src/jalview/datamodel/SequenceNode.java
@@ -1,88 +1,101 @@
-/*
-* Jalview - A Sequence Alignment Editor and Viewer
-* Copyright (C) 2005 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
-*
-* This program is free software; you can redistribute it and/or
-* modify it under the terms of the GNU General Public License
-* as published by the Free Software Foundation; either version 2
-* of the License, or (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
-*/
-
-package jalview.datamodel;
-
-import java.awt.*;
-
-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;
- private boolean placeholder = 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;
- }
- /* @param placeholder is true if the sequence refered to in the
- * element node is not actually present in the associated alignment
- */
- public boolean isPlaceholder()
- {
- return placeholder;
- }
-
- public boolean setDummy(boolean newstate) {
- boolean oldstate = dummy;
- dummy = newstate;
- return oldstate;
- }
-
- public void setPlaceholder(boolean Placeholder)
- {
- this.placeholder = Placeholder;
- }
-
- /**
- * 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;
- }
-}
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
+ *
+ * This file is part of Jalview.
+ *
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * Jalview is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview. If not, see .
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
+ */
+package jalview.datamodel;
+
+/**
+ * DOCUMENT ME!
+ *
+ * @author $author$
+ * @version $Revision$
+ */
+public class SequenceNode extends BinaryNode
+{
+ private boolean placeholder = false;
+
+ /**
+ * Creates a new SequenceNode object.
+ */
+ public SequenceNode()
+ {
+ super();
+ }
+
+ public SequenceNode(SequenceI val, BinaryNode parent,
+ String name, double dist, int bootstrap, boolean dummy)
+ {
+ super(val, parent, name, dist, bootstrap, dummy);
+ }
+
+ public SequenceNode(SequenceI element, BinaryNode parent,
+ String name, double dist, int bootstrap)
+ {
+ super(element, parent, name, dist, bootstrap);
+ }
+
+ public SequenceNode(SequenceI element, BinaryNode parent,
+ String name, double dist)
+ {
+ super(element, parent, name, dist);
+ }
+
+ /*
+ * @param placeholder is true if the sequence refered to in the element node
+ * is not actually present in the associated alignment
+ */
+ public boolean isPlaceholder()
+ {
+ return placeholder;
+ }
+
+ /**
+ * DOCUMENT ME!
+ *
+ * @param Placeholder
+ * DOCUMENT ME!
+ */
+ public void setPlaceholder(boolean Placeholder)
+ {
+ this.placeholder = Placeholder;
+ }
+
+ /**
+ * test if this node has a name that might be a label rather than a bootstrap
+ * value
+ *
+ * @return true if node has a non-numeric label
+ */
+ public boolean isSequenceLabel()
+ {
+ if (name != null && name.length() > 0)
+ {
+ for (int c = 0, s = name.length(); c < s; c++)
+ {
+ char q = name.charAt(c);
+ if ('0' <= q && q <= '9')
+ {
+ continue;
+ }
+ return true;
+ }
+ }
+ return false;
+ }
+}