Copyright © 2005 Scientific Applications. All Rights Reserved.

com.sciapp.table
Class NonContiguousSelectionModel

java.lang.Object
  extended by com.sciapp.table.NonContiguousSelectionModel
All Implemented Interfaces:
EventListener, TableColumnModelListener

public class NonContiguousSelectionModel
extends Object
implements TableColumnModelListener

NonContiguousSelectionModel enables non-contiguous cell selection for a JTable.


Constructor Summary
NonContiguousSelectionModel()
          Creates a NonContiguousSelectionModel.
 
Method Summary
 void columnAdded(TableColumnModelEvent e)
          Tells listeners that a column was added to the model.
 void columnMarginChanged(ChangeEvent e)
          Tells listeners that a column was moved due to a margin change.
 void columnMoved(TableColumnModelEvent e)
          Tells listeners that a column was repositioned.
 void columnRemoved(TableColumnModelEvent e)
          Tells listeners that a column was removed from the model.
 void columnSelectionChanged(ListSelectionEvent e)
          Tells listeners that the selection model of the TableColumnModel changed.
 boolean isCellSelected(int row, int column)
          Returns true if the cell at the specified position is selected.
 void register(JTable table)
          Registers a table to be used with this model.
 void unregister(JTable table)
          Unregisters a table that was previously registered with this model
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NonContiguousSelectionModel

public NonContiguousSelectionModel()
Creates a NonContiguousSelectionModel.

Method Detail

columnAdded

public void columnAdded(TableColumnModelEvent e)
Tells listeners that a column was added to the model.

Specified by:
columnAdded in interface TableColumnModelListener

columnMarginChanged

public void columnMarginChanged(ChangeEvent e)
Tells listeners that a column was moved due to a margin change.

Specified by:
columnMarginChanged in interface TableColumnModelListener

columnMoved

public void columnMoved(TableColumnModelEvent e)
Tells listeners that a column was repositioned.

Specified by:
columnMoved in interface TableColumnModelListener

columnRemoved

public void columnRemoved(TableColumnModelEvent e)
Tells listeners that a column was removed from the model.

Specified by:
columnRemoved in interface TableColumnModelListener

columnSelectionChanged

public void columnSelectionChanged(ListSelectionEvent e)
Tells listeners that the selection model of the TableColumnModel changed.

Specified by:
columnSelectionChanged in interface TableColumnModelListener

isCellSelected

public boolean isCellSelected(int row,
                              int column)
Returns true if the cell at the specified position is selected.

Returns:
true if the cell at index (row, column) is selected, where the first row and first column are at index 0
Throws:
IllegalArgumentException - if row or column are not in the valid range

register

public void register(JTable table)
Registers a table to be used with this model.

Parameters:
table - the table to associate to this model

unregister

public void unregister(JTable table)
Unregisters a table that was previously registered with this model

Parameters:
table - the table to unregister

Copyright © 2005 Scientific Applications. All Rights Reserved.