com.jrefinery.ui
Class SortButtonRenderer
java.lang.Object
|
+--com.jrefinery.ui.SortButtonRenderer
- All Implemented Interfaces:
- javax.swing.table.TableCellRenderer
- public class SortButtonRenderer
- extends java.lang.Object
- implements javax.swing.table.TableCellRenderer
A table cell renderer for table headings - uses one of three JButton instances to indicate the
sort order for the table column.
This class (and also BevelArrowIcon) is adapted from original code by Nobuo Tamemasa (version
1.0, 26-Feb-1999) posted on www.codeguru.com.
- Author:
- NT
Field Summary |
static int |
DOWN
Useful constant indicating ASCENDING (that is, arrow pointing down) sorting in the table. |
static int |
NONE
Useful constant indicating NO sorting. |
static int |
UP
Useful constant indicating DESCENDING (that is, arrow pointing up) sorting in the table. |
Method Summary |
java.awt.Component |
getTableCellRendererComponent(javax.swing.JTable table,
java.lang.Object value,
boolean isSelected,
boolean hasFocus,
int row,
int column)
Returns the renderer component. |
void |
setPressedColumn(int column)
Sets the pressed column. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NONE
public static final int NONE
- Useful constant indicating NO sorting.
DOWN
public static final int DOWN
- Useful constant indicating ASCENDING (that is, arrow pointing down) sorting in the table.
UP
public static final int UP
- Useful constant indicating DESCENDING (that is, arrow pointing up) sorting in the table.
SortButtonRenderer
public SortButtonRenderer()
- Constructs a SortButtonRenderer.
getTableCellRendererComponent
public java.awt.Component getTableCellRendererComponent(javax.swing.JTable table,
java.lang.Object value,
boolean isSelected,
boolean hasFocus,
int row,
int column)
- Returns the renderer component.
- Specified by:
getTableCellRendererComponent
in interface javax.swing.table.TableCellRenderer
- Parameters:
table
- the table.value
- the value.isSelected
- selected?hasFocus
- focussed?row
- the row.column
- the column.- Returns:
- the renderer.
setPressedColumn
public void setPressedColumn(int column)
- Sets the pressed column.
- Parameters:
column
- the column.