com.sciapp.table
Class SortTableButtonRenderer

java.lang.Object
  extended by com.sciapp.table.SortTableRenderer
      extended by com.sciapp.table.SortTableButtonRenderer
All Implemented Interfaces:
TableCellRenderer

public class SortTableButtonRenderer
extends SortTableRenderer

A SortTableRenderer implementation that uses JButtons in order to render the table header. This class shows the column sorting order as a number next to the column name.


Constructor Summary
SortTableButtonRenderer()
          Constructs a SortTableButtonRenderer.
 
Method Summary
 Component getAscSortComponent()
          Returns the component used when ascending sorting is being used.
 Component getDescSortComponent()
          Returns the component used when descending sorting is being used.
 Component getNoSortComponent()
          Returns the component used when no sorting is being used.
 boolean getShowButtonPress()
          Returns true if the button should be pressed when clicked.
 void prepareRenderer(int sortIndex, Object value, int column, Component comp)
          Prepares the component used for drawing the header.
 void setShowButtonPress(boolean showButtonPress)
          Sets a flag that is true if the button should be pressed when clicked.
 
Methods inherited from class com.sciapp.table.SortTableRenderer
getTableCellRendererComponent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SortTableButtonRenderer

public SortTableButtonRenderer()
Constructs a SortTableButtonRenderer.

Method Detail

getAscSortComponent

public Component getAscSortComponent()
Returns the component used when ascending sorting is being used.

Specified by:
getAscSortComponent in class SortTableRenderer
Returns:
the component used when ascending sorting is being used.

getDescSortComponent

public Component getDescSortComponent()
Returns the component used when descending sorting is being used.

Specified by:
getDescSortComponent in class SortTableRenderer
Returns:
the component used when descending sorting is being used.

getNoSortComponent

public Component getNoSortComponent()
Returns the component used when no sorting is being used.

Specified by:
getNoSortComponent in class SortTableRenderer
Returns:
the component used when no sorting is being used.

getShowButtonPress

public boolean getShowButtonPress()
Returns true if the button should be pressed when clicked.

Returns:
the showButtonPress flag

prepareRenderer

public void prepareRenderer(int sortIndex,
                            Object value,
                            int column,
                            Component comp)
Prepares the component used for drawing the header.

Specified by:
prepareRenderer in class SortTableRenderer
Parameters:
sortIndex - the sorting order of the column being drawn
value - the value of the header column
column - the column being drawn
comp - the component being drawn

setShowButtonPress

public void setShowButtonPress(boolean showButtonPress)
Sets a flag that is true if the button should be pressed when clicked.

Parameters:
showButtonPress - the showButtonPress flag