fixes bootstrap bug noted by Chunlong Chen in email to jalview-help
[jalview.git] / src / jalview / gui / TreeCanvas.java
index 328f02a..ead2a71 100755 (executable)
@@ -211,7 +211,7 @@ public class TreeCanvas
           nodeLabel = nodeLabel + " : ";
         }
 
-        nodeLabel = nodeLabel + String.valueOf(node.getBootstrap());
+        nodeLabel = nodeLabel + String.valueOf(node.bootstrap);
       }
 
       if (!nodeLabel.equals(""))
@@ -284,10 +284,26 @@ public class TreeCanvas
       g.drawLine( (int) (height * scale) + offx, ystart,
                  (int) (height * scale) + offx, yend);
 
+      String nodeLabel = "";
+
       if (showDistances && (node.dist > 0))
       {
-        g.drawString(new Format("%-.2f").form(node.dist).trim(), xstart + 2,
-                     ypos - 2);
+        nodeLabel = new Format("%-.2f").form(node.dist);
+      }
+
+      if (showBootstrap)
+      {
+        if (showDistances)
+        {
+          nodeLabel = nodeLabel + " : ";
+        }
+
+        nodeLabel = nodeLabel + String.valueOf(node.bootstrap);
+      }
+
+      if (!nodeLabel.equals(""))
+      {
+        g.drawString(nodeLabel, xstart + 2, ypos - 2);
       }
     }
   }