borland.jbcl Packages  borland.jbcl Class Hierarchy  borland.jbcl.model 

MatrixSelection interface

borland.jbcl.model.MatrixSelection
   +----borland.jbcl.model.WritableMatrixSelection

About the MatrixSelection interface

Methods  

Implemented by BasicMatrixSelection, ColumnMatrixSelection, CrossMatrixSelection, 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.


MatrixSelection methods

Methods defined in this interface


MatrixSelection methods

addSelectionListener(borland.jbcl.model.MatrixSelectionListener)

  void addSelectionListener(borland.jbcl.model.MatrixSelectionListener listener)
Adds a matrix selection-event listener to the set of selected locations.

Parameters:

listener
The object that implements the MatrixSelectionListener interface and that responds to matrix-selection events.

contains(borland.jbcl.model.MatrixLocation)

  boolean contains(borland.jbcl.model.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
The MatrixLocation object that specifies where the data item is in the matrix.

contains(int, int)

  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
A zero-based index that specifies the row of the location.
column
A zero-based index that specifies the column of the location.

getAll()

  MatrixLocation[] getAll()
Returns the complete set of selected locations.

getCount()

  int getCount()
Returns the number of selected locations.

removeSelectionListener(borland.jbcl.model.MatrixSelectionListener)

  void removeSelectionListener(borland.jbcl.model.MatrixSelectionListener listener)
Removes a selection-event listener from the set of selected locations.

Parameters:

listener
The listening object that is removed.