int (final RadContainer container, final int coord, final boolean isRow) { int[] coords = getGridCellCoords(container, isRow); int[] sizes = getGridCellSizes(container, isRow); for (int i = 0; i < coords.length; i++) { if (coords[i] <= coord && coord <= coords[i] + sizes[i]) { return i; } } return -1; }