int near = ((visibleRect.y + delta + h / 2) / h) * h; int diff = visibleRect.y + delta - near; delta -= diff;
unit = getRowHeight();   if (rowHeights == null) { if (direction > 0) {   int exposed = (visibleRect.y + visibleRect.height) % unit; if (exposed > 0 && exposed < unit - 1) unit = unit - exposed - 1; } else {  int exposed = visibleRect.y % unit; if (exposed > 0 && exposed < unit) unit = exposed; }
  public int getScrollableUnitIncrement(Rectangle visibleRect, int orientation,                                        int direction)  {    int h = (rowHeight + rowMargin);    int delta = h * direction;    // Round so that the top would start from the row boundary    if (orientation == SwingConstants.VERTICAL)      {        // Completely expose the top row        int near = ((visibleRect.y + delta + h / 2) / h) * h;        int diff = visibleRect.y + delta - near;        delta -= diff;      }    return delta;    // TODO when scrollng horizontally, scroll into the column boundary.  }