X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FTreeCanvas.java;h=b4fd7465772d65d18cc40c69eaafbbce8d2016a4;hb=9da72d5bf92cb3cc4645d7b15bcf8e83fd885a09;hp=e89f4417cd4232ea2673a82c2628208e94f1e412;hpb=fdcfb775a9b255c4c09c9509bf35e7352b5d1f3a;p=jalview.git diff --git a/src/jalview/gui/TreeCanvas.java b/src/jalview/gui/TreeCanvas.java index e89f441..b4fd746 100755 --- a/src/jalview/gui/TreeCanvas.java +++ b/src/jalview/gui/TreeCanvas.java @@ -195,7 +195,7 @@ public class TreeCanvas extends JPanel implements MouseListener, Runnable, if (showDistances && (node.dist > 0)) { - nodeLabel = new Format("%5.2f").form(node.dist); + nodeLabel = new Format("%-.2f").form(node.dist); } if (showBootstrap) @@ -210,14 +210,14 @@ public class TreeCanvas extends JPanel implements MouseListener, Runnable, if (!nodeLabel.equals("")) { - g.drawString(nodeLabel, xstart, ypos - 10); + g.drawString(nodeLabel, xstart+2, ypos - 2); } String name = (markPlaceholders && node.isPlaceholder()) ? (PLACEHOLDER + node.getName()) : node.getName(); int charWidth = fm.stringWidth(name) + 3; - int charHeight = fm.getHeight(); + int charHeight = font.getSize(); Rectangle rect = new Rectangle(xend+10, ypos-charHeight/2, charWidth, charHeight); @@ -273,8 +273,8 @@ public class TreeCanvas extends JPanel implements MouseListener, Runnable, if (showDistances && (node.dist > 0)) { - g.drawString(new Format("%5.2f").form(node.dist), xstart, - ypos - 5); + g.drawString(new Format("%-.2f").form(node.dist).trim(), xstart+2, + ypos - 2); } } } @@ -587,7 +587,7 @@ public class TreeCanvas extends JPanel implements MouseListener, Runnable, g2.setFont(font); - offy = font.getSize()*2; + offy = font.getSize()+10; fm = g2.getFontMetrics(font);