public class SortableTableHeaderCellDecorator extends Object implements TableHeaderCellDecorator
Modifier and Type | Class and Description |
---|---|
protected class |
SortableTableHeaderCellDecorator.SortInfo
Sort information of a particular column.
|
Constructor and Description |
---|
SortableTableHeaderCellDecorator() |
Modifier and Type | Method and Description |
---|---|
protected TableCellRenderer |
getHeaderRenderer(JTableHeader header,
int columnIndex) |
Insets |
getInsets(Graphics g,
JTableHeader header,
int columnIndex,
Rectangle cellRect)
Gets the margin insets where this cell decorator will paint in.
|
protected SortableTableHeaderCellDecorator.SortInfo |
getSortInfo(JTableHeader header,
int columnIndex)
Gets the sort information of the specified column.
|
void |
paint(Graphics g,
JTableHeader header,
int columnIndex,
Rectangle cellRect,
boolean mouseOverPaintArea)
Paints the table header cell.
|
protected TableCellRenderer getHeaderRenderer(JTableHeader header, int columnIndex)
public Insets getInsets(Graphics g, JTableHeader header, int columnIndex, Rectangle cellRect)
TableHeaderCellDecorator
getInsets
in interface TableHeaderCellDecorator
g
- the Graphics instanceheader
- the table headercolumnIndex
- the view column index to be paintedcellRect
- the original cell rectangle for the columnpublic void paint(Graphics g, JTableHeader header, int columnIndex, Rectangle cellRect, boolean mouseOverPaintArea)
TableHeaderCellDecorator
TableHeaderCellDecorator.getInsets(java.awt.Graphics, javax.swing.table.JTableHeader,
int, java.awt.Rectangle)
, i.e., paint only in the area as specified in the insets. You do need to consider both
RTL and LTR orientations in your code when doing the painting.paint
in interface TableHeaderCellDecorator
g
- the Graphics instanceheader
- the table headercolumnIndex
- the view column index to be paintedcellRect
- the original cell rectangle for the columnmouseOverPaintArea
- the flag indicating if the mouse is over the paint area of this cell decoratorprotected SortableTableHeaderCellDecorator.SortInfo getSortInfo(JTableHeader header, int columnIndex)
header
- the headercolumnIndex
- the column index