// No-op
}
@SuppressWarnings("unchecked")
public void paint(Graphics2D graphics) {
TableView tableView = (TableView)getComponent();
List<Object> tableData = (List<Object>)tableView.getTableData();
TableView.ColumnSequence columns = tableView.getColumns();
int width = getWidth();
int height = getHeight();
int rowHeight = getRowHeight();
Sequence<Integer> columnWidths = getColumnWidths();
// Paint the background
graphics.setPaint(backgroundColor);
graphics.fillRect(0, 0, width, height);
// Paint the list contents
int rowStart = 0;
int rowEnd = tableData.getLength() - 1;
// Ensure that we only paint items that are visible
Rectangle clipBounds = graphics.getClipBounds();
if (clipBounds != null) {
rowStart = Math.max(rowStart, (int)Math.floor(clipBounds.y
/ (double)rowHeight));
rowEnd = Math.min(rowEnd, (int)Math.ceil((clipBounds.y
+ clipBounds.height) / (double)rowHeight) - 1);
}
int rowY = rowStart * rowHeight;
for (int rowIndex = rowStart; rowIndex <= rowEnd; rowIndex++) {
Object rowData = tableData.get(rowIndex);
boolean rowHighlighted = (rowIndex == highlightedIndex
&& tableView.getSelectMode() != TableView.SelectMode.NONE);
boolean rowSelected = tableView.isRowSelected(rowIndex);
boolean rowDisabled = tableView.isRowDisabled(rowIndex);
Color rowBackgroundColor = null;
if (rowSelected) {
rowBackgroundColor = (tableView.isFocused())
? this.selectionBackgroundColor : inactiveSelectionBackgroundColor;
} else {
if (rowHighlighted && showHighlight && !rowDisabled) {
rowBackgroundColor = highlightBackgroundColor;
} else {