if (row < 0) return null;
int dist = Integer.MAX_VALUE;  while (en.hasMoreElements() && dist > 0) { r = (NodeRecord) en.nextElement(); if (best == null) { best = r; dist = distance(r.getBounds(), x, y); } else { int rr = distance(r.getBounds(), x, y); if (rr < dist) { best = r; dist = rr; } } }
  public TreePath getPathClosestTo(int x, int y)	{    if (dirty)      update();    // We do not need to iterate because all rows have the same height.    int row = y / rowHeight;    if (row < 0)      row = 0;    if (row > getRowCount())      row = getRowCount() - 1;        if (row < 0)      return null; // Empty tree - nothing to return.        Object node = row2node.get(new Integer(row));    NodeRecord nr = (NodeRecord) nodes.get(node);    return nr.getPath();  } 