X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fdatamodel%2FSequenceNode.java;h=2f9563b0d5333a2d129386da2da0b2e488acf11c;hb=47168f025aefdaa044802bd5f8f510ffe43a4808;hp=ca0930158ef1b96d104c11dafa1e7108c882f614;hpb=06dfe875fdbe1c3f2042cb8842f5a620b5901c2e;p=jalview.git diff --git a/src/jalview/datamodel/SequenceNode.java b/src/jalview/datamodel/SequenceNode.java index ca09301..2f9563b 100755 --- a/src/jalview/datamodel/SequenceNode.java +++ b/src/jalview/datamodel/SequenceNode.java @@ -1,20 +1,22 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer - * Copyright (C) 2007 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 + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2) + * Copyright (C) 2014 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. - * - * 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. - * + * + * 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 this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * along with Jalview. If not, see . + * The Jalview Authors are detailed in the 'AUTHORS' file. */ package jalview.datamodel; @@ -22,12 +24,11 @@ import java.awt.*; /** * DOCUMENT ME! - * + * * @author $author$ * @version $Revision$ */ -public class SequenceNode - extends BinaryNode +public class SequenceNode extends BinaryNode { /** DOCUMENT ME!! */ public float dist; @@ -46,6 +47,7 @@ public class SequenceNode /** DOCUMENT ME!! */ public boolean dummy = false; + private boolean placeholder = false; /** @@ -58,13 +60,18 @@ public class SequenceNode /** * Creates a new SequenceNode object. - * - * @param val DOCUMENT ME! - * @param parent DOCUMENT ME! - * @param dist DOCUMENT ME! - * @param name DOCUMENT ME! + * + * @param val + * DOCUMENT ME! + * @param parent + * DOCUMENT ME! + * @param dist + * DOCUMENT ME! + * @param name + * DOCUMENT ME! */ - public SequenceNode(Object val, SequenceNode parent, float dist, String name) + public SequenceNode(Object val, SequenceNode parent, float dist, + String name) { super(val, parent, name); this.dist = dist; @@ -72,16 +79,22 @@ public class SequenceNode /** * Creates a new SequenceNode object. - * - * @param val DOCUMENT ME! - * @param parent DOCUMENT ME! - * @param name DOCUMENT ME! - * @param dist DOCUMENT ME! - * @param bootstrap DOCUMENT ME! - * @param dummy DOCUMENT ME! + * + * @param val + * DOCUMENT ME! + * @param parent + * DOCUMENT ME! + * @param name + * DOCUMENT ME! + * @param dist + * DOCUMENT ME! + * @param bootstrap + * DOCUMENT ME! + * @param dummy + * DOCUMENT ME! */ public SequenceNode(Object val, SequenceNode parent, String name, - float dist, int bootstrap, boolean dummy) + float dist, int bootstrap, boolean dummy) { super(val, parent, name); this.dist = dist; @@ -90,15 +103,17 @@ public class SequenceNode } /** - * @param dummy true if node is created for the representation of polytomous trees + * @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 + /* + * @param placeholder is true if the sequence refered to in the element node + * is not actually present in the associated alignment */ public boolean isPlaceholder() { @@ -107,9 +122,10 @@ public class SequenceNode /** * DOCUMENT ME! - * - * @param newstate DOCUMENT ME! - * + * + * @param newstate + * DOCUMENT ME! + * * @return DOCUMENT ME! */ public boolean setDummy(boolean newstate) @@ -122,8 +138,9 @@ public class SequenceNode /** * DOCUMENT ME! - * - * @param Placeholder DOCUMENT ME! + * + * @param Placeholder + * DOCUMENT ME! */ public void setPlaceholder(boolean Placeholder) { @@ -132,7 +149,8 @@ public class SequenceNode /** * 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. + * This will probably break if the tree is a mixture of BinaryNodes and + * SequenceNodes. */ public SequenceNode AscendTree() { @@ -141,23 +159,25 @@ public class SequenceNode do { c = (SequenceNode) c.parent(); - } - while ( (c != null) && c.dummy); + } while ((c != null) && c.dummy); return c; } + /** - * test if this node has a name that might be a label rather than a bootstrap value + * 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) + if (name != null && name.length() > 0) { - for (int c=0,s=name.length(); c