com.sciapp.table
Class TableReorder

java.lang.Object
  extended by com.sciapp.table.TableReorder
All Implemented Interfaces:
ReorderListener, EventListener
Direct Known Subclasses:
TreeTableReorder

public class TableReorder
extends Object
implements ReorderListener

TableReorder acts on a JTable in order to ensure that the same rows are selected after the ReorderEvent is generated.


Field Summary
protected  int[] changedIndices
          an int array showing how the rows have changed place
protected  int[] selectedRows
          the selected rows of the table
protected  JTable table
          the table
 
Constructor Summary
TableReorder(JTable table)
          Constructs a TableReorder object acting on table.
 
Method Summary
 void reselectTableRows()
          Uses the values stored when the rowsReordered method was called in order to update the table selection.
 void reselectTableRows(int[] selRows, int[] mapIndex)
          Updates the table selection.
 void rowsReordered(ReorderEvent e)
          Called whenever the rows of a JTable have been restructured.
 void setTable(JTable newTable)
          Sets the table to newTable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

table

protected JTable table
the table


selectedRows

protected int[] selectedRows
the selected rows of the table


changedIndices

protected int[] changedIndices
an int array showing how the rows have changed place

Constructor Detail

TableReorder

public TableReorder(JTable table)
Constructs a TableReorder object acting on table.

Method Detail

reselectTableRows

public void reselectTableRows()
Uses the values stored when the rowsReordered method was called in order to update the table selection.


reselectTableRows

public void reselectTableRows(int[] selRows,
                              int[] mapIndex)
Updates the table selection.

Parameters:
selRows - the table's selected rows before an update to the table data was made
mapIndex - an int array showing how the rows have changed place

rowsReordered

public void rowsReordered(ReorderEvent e)
Called whenever the rows of a JTable have been restructured.

Specified by:
rowsReordered in interface ReorderListener
Parameters:
e - the ReorderEvent object

setTable

public void setTable(JTable newTable)
Sets the table to newTable

Parameters:
newTable - the JTable to set