boolean between = false;
if (layoutOrientation == HORIZONTAL_WRAP) {
boolean ltr = getComponentOrientation().isLeftToRight();
Section section = SwingUtilities2.liesInHorizontal(rect, p, ltr, true);
if (section == TRAILING) {
index++;
between = true;
// special case for below all cells
} else if (index == getModel().getSize() - 1 && p.y >= rect.y + rect.height) {
index++;
between = true;
} else if (section == LEADING) {
between = true;
}
} else {
Section section = SwingUtilities2.liesInVertical(rect, p, true);
if (section == LEADING) {
between = true;
} else if (section == TRAILING) {
index++;
between = true;