/** * {@inheritDoc} */ @Override public Rectangle getCellBounds() { return table.getCellRect(row, column, false); }
/** * {@inheritDoc} */ @Override public Rectangle getCellBounds() { return table.getCellRect(row, column, false); }
/** * {@inheritDoc} */ @Override public Rectangle getCellBounds() { return table.getCellRect(row, column, false); }
/** * {@inheritDoc} */ @Override public Rectangle getCellBounds() { return table.getCellRect(row, column, false); }
/** * Scrolls to make the cell at row and column visible. This might not have * any effect if the table isn't contained in a <code>JViewport</code>. * <p> * * Note: this method has no precondition as it internally uses * <code>getCellRect</code> which is lenient to off-range coordinates. * * @param row the view row index of the cell * @param column the view column index of the cell * * @see #scrollColumnToVisible(int) * @see #scrollRowToVisible(int) * @see #scrollRectToVisible(Rectangle) */ public void scrollCellToVisible(int row, int column) { Rectangle cellRect = getCellRect(row, column, false); scrollRectToVisible(cellRect); }
/** * Scrolls to make the cell at row and column visible. This might not have * any effect if the table isn't contained in a <code>JViewport</code>. * <p> * * Note: this method has no precondition as it internally uses * <code>getCellRect</code> which is lenient to off-range coordinates. * * @param row the view row index of the cell * @param column the view column index of the cell * * @see #scrollColumnToVisible(int) * @see #scrollRowToVisible(int) * @see #scrollRectToVisible(Rectangle) */ public void scrollCellToVisible(int row, int column) { Rectangle cellRect = getCellRect(row, column, false); scrollRectToVisible(cellRect); }
/** * Scrolls to make the cell at row and column visible. This might not have * any effect if the table isn't contained in a <code>JViewport</code>. * <p> * * Note: this method has no precondition as it internally uses * <code>getCellRect</code> which is lenient to off-range coordinates. * * @param row the view row index of the cell * @param column the view column index of the cell * * @see #scrollColumnToVisible(int) * @see #scrollRowToVisible(int) * @see #scrollRectToVisible(Rectangle) */ public void scrollCellToVisible(int row, int column) { Rectangle cellRect = getCellRect(row, column, false); scrollRectToVisible(cellRect); }
/** * Scrolls to make the cell at row and column visible. This might not have * any effect if the table isn't contained in a <code>JViewport</code>. * <p> * * Note: this method has no precondition as it internally uses * <code>getCellRect</code> which is lenient to off-range coordinates. * * @param row the view row index of the cell * @param column the view column index of the cell * * @see #scrollColumnToVisible(int) * @see #scrollRowToVisible(int) * @see #scrollRectToVisible(Rectangle) */ public void scrollCellToVisible(int row, int column) { Rectangle cellRect = getCellRect(row, column, false); scrollRectToVisible(cellRect); }
/** * Scrolls to make the cell at row and column visible. This might not have * any effect if the table isn't contained in a <code>JViewport</code>. * <p> * * Note: this method has no precondition as it internally uses * <code>getCellRect</code> which is lenient to off-range coordinates. * * @param row the view row index of the cell * @param column the view column index of the cell * * @see #scrollColumnToVisible(int) * @see #scrollRowToVisible(int) * @see #scrollRectToVisible(Rectangle) */ public void scrollCellToVisible(int row, int column) { Rectangle cellRect = getCellRect(row, column, false); scrollRectToVisible(cellRect); }
public void scrollToFirstElementSelected() { int row = table.getSelectedRow(); if (row != -1) { Rectangle rect = table.getCellRect(row, 0, true); table.scrollRectToVisible(rect); } }
/** * Scrolls vertically to make the given row visible. This might not have any * effect if the table isn't contained in a <code>JViewport</code>. * <p> * * Note: this method has no precondition as it internally uses * <code>getCellRect</code> which is lenient to off-range coordinates. * * @param row the view row index of the cell * * @see #scrollColumnToVisible(int) * @see #scrollCellToVisible(int, int) * @see #scrollRectToVisible(Rectangle) */ public void scrollRowToVisible(int row) { Rectangle cellRect = getCellRect(row, 0, false); Rectangle visibleRect = getVisibleRect(); cellRect.x = visibleRect.x; cellRect.width = visibleRect.width; scrollRectToVisible(cellRect); }
/** * Scrolls vertically to make the given row visible. This might not have any * effect if the table isn't contained in a <code>JViewport</code>. * <p> * * Note: this method has no precondition as it internally uses * <code>getCellRect</code> which is lenient to off-range coordinates. * * @param row the view row index of the cell * * @see #scrollColumnToVisible(int) * @see #scrollCellToVisible(int, int) * @see #scrollRectToVisible(Rectangle) */ public void scrollRowToVisible(int row) { Rectangle cellRect = getCellRect(row, 0, false); Rectangle visibleRect = getVisibleRect(); cellRect.x = visibleRect.x; cellRect.width = visibleRect.width; scrollRectToVisible(cellRect); }
/** * Scrolls horizontally to make the given column visible. This might not * have any effect if the table isn't contained in a <code>JViewport</code>. * <p> * * Note: this method has no precondition as it internally uses * <code>getCellRect</code> which is lenient to off-range coordinates. * * @param column the view column index of the cell * * @see #scrollRowToVisible(int) * @see #scrollCellToVisible(int, int) * @see #scrollRectToVisible(Rectangle) */ public void scrollColumnToVisible(int column) { Rectangle cellRect = getCellRect(0, column, false); Rectangle visibleRect = getVisibleRect(); cellRect.y = visibleRect.y; cellRect.height = visibleRect.height; scrollRectToVisible(cellRect); }
@Override public void tableChanged(final TableModelEvent e) { if (TableUtilities.isInsert(e)) { final int currentRowCount = myTableModel.getRowCount(); if (currentRowCount != lastRowCountScrolledTo) { lastRowCountScrolledTo = currentRowCount; SwingUtilities.invokeLater(() -> table.scrollRectToVisible(table.getCellRect(myTableModel.getRowCount() - 1, 0, false))); } } } });
public void propertyChange(PropertyChangeEvent event) { String prop = event.getPropertyName(); if (prop.equalsIgnoreCase(GrammarVizMessage.MAIN_CHART_CLICKED_MESSAGE)) { String rule = (String) event.getNewValue(); for (int row = 0; row <= sequiturTable.getRowCount() - 1; row++) { for (int col = 0; col <= sequiturTable.getColumnCount() - 1; col++) { if (rule.equals(this.session.chartData.convert2OriginalSAXAlphabet('1', sequiturTable.getValueAt(row, col).toString()))) { sequiturTable.scrollRectToVisible(sequiturTable.getCellRect(row, 0, true)); sequiturTable.setRowSelectionInterval(row, row); } } } } }
private void selectRowAndEnsureVisible(int row) { if (row != -1) { breakpointsTable.getSelectionModel().setSelectionInterval(row, row); breakpointsTable.scrollRectToVisible(breakpointsTable.getCellRect(row, 0, true)); } }
@Override public void tableChanged(final TableModelEvent e) { if (TableUtilities.isInsert(e)) { final int currentRowCount = myTableModel.getRowCount(); if (currentRowCount != lastRowCountScrolledTo) { lastRowCountScrolledTo = currentRowCount; SwingUtilities.invokeLater(() -> table.scrollRectToVisible(table.getCellRect(myTableModel.getRowCount() - 1, 0, false))); } } } });
@Override public void tableChanged(final TableModelEvent e) { if (TableUtilities.isInsert(e)) { final int currentRowCount = myTableModel.getRowCount(); if (currentRowCount != lastRowCountScrolledTo) { lastRowCountScrolledTo = currentRowCount; SwingUtilities.invokeLater(() -> table.scrollRectToVisible(table.getCellRect(myTableModel.getRowCount() - 1, 0, false))); } } } });
/** * Moves the row selection to the matching cell and ensures its visibility, * if any. Does nothing if there is no match. * */ protected void moveMatchBySelection() { if (!hasMatch()) { return; } int row = lastSearchResult.foundRow; int column = lastSearchResult.foundColumn; table.changeSelection(row, column, false, false); if (!table.getAutoscrolls()) { // scrolling not handled by moving selection Rectangle cellRect = table.getCellRect(row, column, true); if (cellRect != null) { table.scrollRectToVisible(cellRect); } } }
/** * Moves the row selection to the matching cell and ensures its visibility, * if any. Does nothing if there is no match. * */ protected void moveMatchBySelection() { if (!hasMatch()) { return; } int row = lastSearchResult.foundRow; int column = lastSearchResult.foundColumn; table.changeSelection(row, column, false, false); if (!table.getAutoscrolls()) { // scrolling not handled by moving selection Rectangle cellRect = table.getCellRect(row, column, true); if (cellRect != null) { table.scrollRectToVisible(cellRect); } } }