if ((nd.left() == null) && (nd.right() == null))
{
- nd.height = ((BinaryNode) nd.parent()).height + nd.dist;
+ nd.height = nd.parent().height + nd.dist;
if (nd.height > maxheight)
{
{
if (nd.parent() != null)
{
- nd.height = ((BinaryNode) nd.parent()).height + nd.dist;
+ nd.height = nd.parent().height + nd.dist;
}
else
{
}
int ystart = (node.left() == null ? 0
- : (int) (((BinaryNode) node.left()).ycount * chunk)) + offy;
+ : (int) (node.left().ycount * chunk)) + offy;
int yend = (node.right() == null ? 0
- : (int) (((BinaryNode) node.right()).ycount * chunk)) + offy;
+ : (int) (node.right().ycount * chunk)) + offy;
Rectangle pos = new Rectangle(xend - 2, ypos - 2, 5, 5);
nodeHash.put(node, pos);
if (top.count == 0)
{
- top.count = ((BinaryNode) top.left()).count
- + ((BinaryNode) top.right()).count;
+ top.count = top.left().count
+ + top.right().count;
}
- double chunk = (double) (height - (offy)) / (double)top.count;
+ float chunk = (float) (height - (offy)) / top.count;
drawNode(g2, tree.getTopNode(), chunk, wscale, width, offx, offy);