@Override public void insert(Row row, int index) { if (row == null) { throw new IllegalArgumentException("row is null."); } if (row.tablePane != null) { throw new IllegalArgumentException ("row is already in use by another table pane."); } rows.insert(row, index); row.tablePane = TablePane.this; for (int i = 0, n = row.getLength(); i < n; i++) { Component component = row.get(i); TablePane.this.add(component); } // Notify listeners tablePaneListeners.rowInserted(TablePane.this, index); }
@Override public void insert(Row row, int index) { if (row == null) { throw new IllegalArgumentException("row is null."); } if (row.tablePane != null) { throw new IllegalArgumentException ("row is already in use by another table pane."); } rows.insert(row, index); row.tablePane = TablePane.this; for (int i = 0, n = row.getLength(); i < n; i++) { Component component = row.get(i); TablePane.this.add(component); } // Notify listeners tablePaneListeners.rowInserted(TablePane.this, index); }
Component component = row.get(j);
Component component = row.get(j);
Component component = row.get(j);
Component child = row.get(j);
Component child = row.get(j);
Component component = row.get(j);
Component component = row.get(j);
Component component = row.get(j);
Component component = row.get(j);
Component component = row.get(j);
/** * Gets the preferred width of a table pane column, which is defined as the * maximum preferred width of the column's visible components. * <p> * Because their preferred width relates to the preferred widths of other * columns, components that span multiple columns will not be considered in * this calculation (even if they live in the column directly). It is up to * the caller to factor such components into the column widths calculation. * * @param columnIndex * The index of the column whose preferred width we're calculating */ private int getPreferredColumnWidth(int columnIndex) { TablePane tablePane = (TablePane)getComponent(); TablePane.RowSequence rows = tablePane.getRows(); int preferredWidth = 0; for (int i = 0, n = rows.getLength(); i < n; i++) { TablePane.Row row = rows.get(i); if (row.getLength() > columnIndex) { Component component = row.get(columnIndex); if (component != null && component.isVisible() && TablePane.getColumnSpan(component) == 1) { preferredWidth = Math.max(preferredWidth, component.getPreferredWidth(-1)); } } } return preferredWidth; }
/** * Gets the preferred width of a table pane column, which is defined as the * maximum preferred width of the column's visible components. * <p> * Because their preferred width relates to the preferred widths of other * columns, components that span multiple columns will not be considered in * this calculation (even if they live in the column directly). It is up to * the caller to factor such components into the column widths calculation. * * @param columnIndex * The index of the column whose preferred width we're calculating */ private int getPreferredColumnWidth(int columnIndex) { TablePane tablePane = (TablePane)getComponent(); TablePane.RowSequence rows = tablePane.getRows(); int preferredWidth = 0; for (int i = 0, n = rows.getLength(); i < n; i++) { TablePane.Row row = rows.get(i); if (row.getLength() > columnIndex) { Component component = row.get(columnIndex); if (component != null && component.isVisible() && TablePane.getColumnSpan(component) == 1) { preferredWidth = Math.max(preferredWidth, component.getPreferredWidth(-1)); } } } return preferredWidth; }
/** * Gets the component at the specified cell in this table pane. * * @param rowIndex * The row index of the cell * * @param columnIndex * The column index of the cell * * @return * The component in the specified cell, or <tt>null</tt> if the cell is * empty */ public Component getCellComponent(int rowIndex, int columnIndex) { Row row = rows.get(rowIndex); Component component = null; if (row.getLength() > columnIndex) { component = row.get(columnIndex); } return component; }
/** * Gets the component at the specified cell in this table pane. * * @param rowIndex * The row index of the cell * * @param columnIndex * The column index of the cell * * @return * The component in the specified cell, or <tt>null</tt> if the cell is * empty */ public Component getCellComponent(int rowIndex, int columnIndex) { Row row = rows.get(rowIndex); Component component = null; if (row.getLength() > columnIndex) { component = row.get(columnIndex); } return component; }
@Override public Sequence<Row> remove(int index, int count) { Sequence<Row> removed = rows.remove(index, count); if (count > 0) { for (int i = 0, n = removed.getLength(); i < n; i++) { Row row = removed.get(i); row.tablePane = null; for (int j = 0, m = row.getLength(); j < m; j++) { Component component = row.get(j); TablePane.this.remove(component); } } tablePaneListeners.rowsRemoved(TablePane.this, index, removed); } return removed; }
@Override public Sequence<Row> remove(int index, int count) { Sequence<Row> removed = rows.remove(index, count); if (count > 0) { for (int i = 0, n = removed.getLength(); i < n; i++) { Row row = removed.get(i); row.tablePane = null; for (int j = 0, m = row.getLength(); j < m; j++) { Component component = row.get(j); TablePane.this.remove(component); } } tablePaneListeners.rowsRemoved(TablePane.this, index, removed); } return removed; }
@Override public void selectedIndexChanged(CardPane cardPane, int previousSelectedIndex) { if (previousSelectedIndex == IMAGE_CARD_INDEX) { editorRow.get(columnIndex).requestFocus(); } else { endEdit(false); } } });
@Override public void selectedIndexChanged(CardPane cardPaneArgument, int previousSelectedIndex) { if (previousSelectedIndex == IMAGE_CARD_INDEX) { editorRow.get(columnIndex).requestFocus(); } else { endEdit(false); } } });