jbcl.model Package
com.borland.jbcl.model.MatrixSelection +----com.borland.jbcl.model.WritableMatrixSelection
Methods
Implemented by BasicMatrixSelection, ColumnMatrixSelection, CrossMatrixSelection, MultiColumnMatrixSelection, MultiRowMatrixSelection, NullMatrixSelection, RowMatrixSelection, SingleMatrixSelection
The MatrixSelection
interface provides read access to the set of selected locations within the matrix model. It contains a count
property that holds the number of selected locations. Use one of the contains()
methods to determine if a specific location is currently selected and use the getAll()
method to return all selected locations.
Classes that implement the MatrixSelection
interface are usually used to pass selection sets. Usually you will use one of the matrix-selection classes, such as BasicMatrixSelection
, NullMatrixSelection
, or SingleMatrixSelection
, but you can implement the MatrixSelection
interface directly.
If you need an interface that provides read-write access to the set of selected locations within the vector, use the WritableMatrixSelection
interface instead.
void addSelectionListener(MatrixSelectionListener listener)Adds a matrix selection-event listener to the set of selected locations.
Parameters:
listener
MatrixSelectionListener
interface and that responds to matrix-selection events.
boolean contains(MatrixLocation location)Determines whether a particular location where a data item is stored in the matrix is selected. If
contains()
is true, the specified location is in the selection set and is therefore selected. If contains()
is false, the location is not selected.
Parameters:
location
MatrixLocation
object that specifies where the data item is in the matrix.
boolean contains(int row, int column)Determines whether a particular location where a data item is stored in the matrix is selected. The location is specified with the
row
and column
parameters. If contains()
is true, the specified location is in the selection set and is therefore selected. If contains()
is false, the location is not selected.
Parameters:
row
column
MatrixLocation[] getAll()Returns the complete set of selected locations.
int getCount()Returns the number of selected locations.
void removeSelectionListener(MatrixSelectionListener listener)Removes a selection-event listener from the set of selected locations.
Parameters:
listener