/** * Convert the JList relative coordinate to the row that contains it, * based on the current layout. If y0 doesn't fall within any row, * return -1. * * @return The row that contains y0, or -1. * @see #getRowHeight * @see #updateLayoutState */ protected int convertYToRow(int y0) { return convertLocationToRow(0, y0, false); }
/** * Convert the JList relative coordinate to the row that contains it, * based on the current layout. If y0 doesn't fall within any row, * return -1. * * @return The row that contains y0, or -1. * @see #getRowHeight * @see #updateLayoutState */ protected int convertYToRow(int y0) { return convertLocationToRow(0, y0, false); }
/** * Convert the JList relative coordinate to the row that contains it, * based on the current layout. If y0 doesn't fall within any row, * return -1. * * @return The row that contains y0, or -1. * @see #getRowHeight * @see #updateLayoutState */ protected int convertYToRow(int y0) { return convertLocationToRow(0, y0, false); }
/** * Convert the JList relative coordinate to the row that contains it, * based on the current layout. If y0 doesn't fall within any row, * return -1. * * @return The row that contains y0, or -1. * @see #getRowHeight * @see #updateLayoutState */ protected int convertYToRow(int y0) { return convertLocationToRow(0, y0, false); }
/** * Returns the closest location to the model index of the passed in * location. */ private int convertLocationToModel(int x, int y) { int row = convertLocationToRow(x, y, true); int column = convertLocationToColumn(x, y); if (row >= 0 && column >= 0) { return getModelIndex(column, row); } return -1; }
/** * Returns the closest location to the model index of the passed in * location. */ private int convertLocationToModel(int x, int y) { int row = convertLocationToRow(x, y, true); int column = convertLocationToColumn(x, y); if (row >= 0 && column >= 0) { return getModelIndex(column, row); } return -1; }
/** * Returns the closest location to the model index of the passed in * location. */ private int convertLocationToModel(int x, int y) { int row = convertLocationToRow(x, y, true); int column = convertLocationToColumn(x, y); if (row >= 0 && column >= 0) { return getModelIndex(column, row); } return -1; }
/** * Returns the closest location to the model index of the passed in * location. */ private int convertLocationToModel(int x, int y) { int row = convertLocationToRow(x, y, true); int column = convertLocationToColumn(x, y); if (row >= 0 && column >= 0) { return getModelIndex(column, row); } return -1; }
/** * Returns the closest row that starts at the specified y-location * in the passed in column. */ private int convertLocationToRowInColumn(int y, int column) { int x = 0; if (layoutOrientation != JList.VERTICAL) { if (isLeftToRight) { x = column * cellWidth; } else { x = list.getWidth() - (column+1)*cellWidth - list.getInsets().right; } } return convertLocationToRow(x, y, true); }
/** * Returns the closest row that starts at the specified y-location * in the passed in column. */ private int convertLocationToRowInColumn(int y, int column) { int x = 0; if (layoutOrientation != JList.VERTICAL) { if (isLeftToRight) { x = column * cellWidth; } else { x = list.getWidth() - (column+1)*cellWidth - list.getInsets().right; } } return convertLocationToRow(x, y, true); }
/** * Returns the closest row that starts at the specified y-location * in the passed in column. */ private int convertLocationToRowInColumn(int y, int column) { int x = 0; if (layoutOrientation != JList.VERTICAL) { if (isLeftToRight) { x = column * cellWidth; } else { x = list.getWidth() - (column+1)*cellWidth - list.getInsets().right; } } return convertLocationToRow(x, y, true); }
/** * Returns the closest row that starts at the specified y-location * in the passed in column. */ private int convertLocationToRowInColumn(int y, int column) { int x = 0; if (layoutOrientation != JList.VERTICAL) { if (isLeftToRight) { x = column * cellWidth; } else { x = list.getWidth() - (column+1)*cellWidth - list.getInsets().right; } } return convertLocationToRow(x, y, true); }