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 WritableMatrixSelection
interface provides read-write access to the set of selected locations within a matrix model. Usually it is used to manage the selection set.
Most of the time you will use classes that implement WritableMatrixSelection
, such as BasicMatrixSelection
, RowMatrixSelection
, and SingleMatrixSelection
. You can implement the interface directly, however.
If you need read access only to a set of selected locations, you can use the MatrixSelection
interface instead.
To add locations to the set of selected locations, use one of the add()
methods or the addRange()
method. To delete locations, call one of the remove()
methods, the removeRange()
method, or the removeAll()
method.
Set the selection pool to a given set of locations with the set()
method.
void add(MatrixLocation location)Adds the location of a data item in the matrix to the set of selected locations.
Parameters:
location
MatrixLocation
object that identifes the location of the data item.
void add(MatrixLocation[] locations)Adds multiple locations to the set of selected locations in the matrix.
Parameters:
locations
MatrixLocation
objects that specify the locations of data items in the matrix.
void add(int row, int column)Adds the data item at the specified row and column in the matrix to the set of selection locations.
Parameters:
row
column
void addRange(MatrixLocation begin, MatrixLocation end)Adds a range of locations to the set of selected locations. The locations are specified as
MatrixLocation
objects.
Parameters:
begin
end
void addRange(int beginRow, int beginColumn, int endRow, int endColumn)Adds a range of locations to the set of selected locations. The locations are specified as row and column coordinates.
Parameters:
beginRow
beginColumn
endRow
endColumn
void enableSelectionEvents(boolean enable)Determines whether the broadcasting of matrix-selection events is enabled or disabled based on the value of the
enable
parameter.
Parameters:
enable
enable
is true, matrix-selection events are enabled and a SELECTION_CHANGED event is fired to all matrix-selection listeners. If enable
is false, all matrix-selection events are disabled.
void remove(MatrixLocation location)Removes the specified location from the set of selected locations. The location is specified as a
MatrixLocation
object.
Parameters:
location
MatrixLocation
object that specifies the location of the data object to be removed from the set of selected locations.
void remove(MatrixLocation[] locations)Removes a specified array of locations from the set of selected locations.
Parameters:
locations
MatrixLocation
objects that specify the locations of the selected data objects in the matrix.void remove(int row, int column)Removes the specified location from the set of selected locations. The location is specified using row and column coordinates.
Parameters:
row
column
void removeAll()Removes all locations from the set of selected locations.
void removeRange(MatrixLocation begin, MatrixLocation end)Removes a specified range of locations from the set of selected locations.
Parameters:
begin
end
void removeRange(int beginRow, int beginColumn, int endRow, int endColumn)
Parameters:
beginRow
beginColumn
endRow
endColumn
void set(MatrixLocation[] locations)Sets the selection pool to a given set of locations.
Parameters:
locations
MatrixLocation
objects that becomes the new set of selected locations.