- // Drawing leaf node
- float height = node.height;
- float dist = node.dist;
-
- int xstart = (int) ((height - dist) * scale) + offx;
- int xend = (int) (height * scale) + offx;
-
- int ypos = (int) (node.ycount * chunk) + offy;
-
- if (node.element() instanceof SequenceI)
- {
- SequenceI seq = (SequenceI)((SequenceNode) node).element();
-
- if (av.getSequenceColour(seq) == Color.white)
- {
- g.setColor(Color.black);
- }
- else
- {
- g.setColor(av.getSequenceColour(seq).darker());
- }
- }
- else
- {
- g.setColor(Color.black);
- }
-
- // Draw horizontal line
- g.drawLine(xstart, ypos, xend, ypos);
-
- String nodeLabel = "";
-
- if (showDistances && (node.dist > 0))
- {
- nodeLabel = new Format("%-.2f").form(node.dist);
- }
-
- if (showBootstrap)
- {
- if (showDistances)
- {
- nodeLabel = nodeLabel + " : ";
- }
-
- nodeLabel = nodeLabel + String.valueOf(node.getBootstrap());
- }
-
- if (!nodeLabel.equals(""))
- {
- 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 = font.getSize();
-
- Rectangle rect = new Rectangle(xend+10, ypos-charHeight/2,
- charWidth, charHeight);
-
- nameHash.put((SequenceI) node.element(), rect);
-
- // Colour selected leaves differently
- SequenceGroup selected = av.getSelectionGroup();
-
- if ((selected != null) &&
- selected.getSequences(false).contains((SequenceI) node.element()))
- {
- g.setColor(Color.gray);
-
- g.fillRect(xend + 10, ypos-charHeight/2, charWidth,
- charHeight);
- g.setColor(Color.white);
- }
-
- g.drawString(name, xend + 10, ypos+fm.getDescent());
- g.setColor(Color.black);