com.jidesoft.grid
Class SortableTableHeaderCellDecorator
java.lang.Object
com.jidesoft.grid.SortableTableHeaderCellDecorator
- All Implemented Interfaces:
- TableHeaderCellDecorator
public class SortableTableHeaderCellDecorator
- extends Object
- implements TableHeaderCellDecorator
This class is to paint sort icon and sort index.
- Since:
- 3.1.0
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SortableTableHeaderCellDecorator
public SortableTableHeaderCellDecorator()
getHeaderRenderer
protected TableCellRenderer getHeaderRenderer(JTableHeader header,
int columnIndex)
getInsets
public Insets getInsets(Graphics g,
JTableHeader header,
int columnIndex,
Rectangle cellRect)
- Description copied from interface:
TableHeaderCellDecorator
- Gets the margin insets where this cell decorator will paint in. Even though the table header could be in RTL or
LTR orientation, we require you return the insets as in LTR orientation and we will properly adjust it based on
the actual table header orientation.
- Specified by:
getInsets in interface TableHeaderCellDecorator
- Parameters:
g - the Graphics instanceheader - the table headercolumnIndex - the view column index to be paintedcellRect - the original cell rectangle for the column
- Returns:
- the margin area so the original header cell will not paint over this margin. Null if you don't need to
restrict the painting of original header.
paint
public void paint(Graphics g,
JTableHeader header,
int columnIndex,
Rectangle cellRect,
boolean mouseOverPaintArea)
- Description copied from interface:
TableHeaderCellDecorator
- Paints the table header cell. This paint method will be called after the original table header cell is painted.
Theoretically, you can paint whatever you want but in most cases, you probably want to make sure the painting
code is consistent with insets returned from
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.
- Specified by:
paint in interface TableHeaderCellDecorator
- Parameters:
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 decorator