fixes bootstrap bug noted by Chunlong Chen in email to jalview-help
[jalview.git] / src / jalview / gui / TreeCanvas.java
index ea2ef4d..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);
       }
     }
   }
@@ -682,8 +698,10 @@ public class TreeCanvas
       {
         Color col = JColorChooser.showDialog(this, "Select Sub-Tree Colour",
                                              highlightNode.color);
-
-        setColor(highlightNode, col);
+        if (col!=null)
+        {
+          setColor(highlightNode, col);
+        }
       }
       else
       if (evt.getClickCount() > 1)