jbcl.model Package
com.borland.jbcl.model.VectorSelection +----com.borland.jbcl.model.WritableVectorSelection
Methods
Implemented by BasicVectorSelection, NullVectorSelection, SingleVectorSelection
The WritableVectorSelection
interface provides read-write access to the set of selected locations within a vector model. Usually it is used to manage the selection set.
Most of the time you will use classes that implement WritableVectorSelection
, such as BasicVectorSelection
, NullVectorSelection
, and SingleVectorSelection
. You can implement the interface directly, however.
If you need read access only to a set of selected locations, you can use the VectorSelection
interface instead.
To add locations to the set of selected locations, call one of the add()
methods or use the addRange()
method. To delete locations from the selection pool, call one of the remove()
methods, the removeRange()
method, or the removeAll()
method. Set a selection pool all at once with the set()
method.
void add(int location)Adds the location of a data item in the vector to the set of selected locations.
Parameters:
location
void add(int[] locations)Adds multiple locations to the set of selected locations.
Parameters:
locations
void addRange(int begin, int end)Adds a range of locations to the set of selected locations.
Parameters:
begin
end
void enableSelectionEvents(boolean enable)Determines whether the broadcasting of vector-selection events is enabled or disabled based on the value of the
enable
parameter.
Parameters:
enable
enable
is true, vector-selection events are enabled and a SELECTION_CHANGED event is fired to all vector-selection listeners. If enable
is false, all vector-selection events are disabled.
void remove(int location)Removes the specified location from the set of selected locations.
Parameters:
location
void remove(int[] locations)Removes a specified array of locations from the set of selected locations.
Parameters:
locations
void removeAll()Removes all locations from the set of selected locations.
void removeRange(int begin, int end)Removes a specified range of locations from the set of selected locations.
Parameters:
begin
end
void set(int[] locations)Sets the selection pool to a given set of locations
Parameters:
locations