jbcl.model Package
com.borland.jbcl.model.GraphSelection +----com.borland.jbcl.model.WritableGraphSelection
Properties Methods Event Listeners
Implemented by BasicGraphSelection, NullGraphSelection, SingleGraphSelection
The WritableGraphSelection
interface provides read-write access to the set of selected nodes within a graph model. Usually it is used to manage the selection set.
Most of the time you will use classes that implement WritableGraphSelection
, such as BasicGraphSelection
. You can implement the interface directly, however.
If you need read access only to a set of selected nodes, you can use the GraphSelection
interface instead.
To add a node or an array of nodes, call one of the add()
methods. To delete one or more nodes, call one of the remove()
methods. You can set the data object of a specified node with the set()
method.
public void add(GraphLocation location)Adds a node in the graph to the set of selected nodes.
Parameters:
location
GraphLocation
object that identifes the location of the node.
public void add(GraphLocation[] location)Adds multiple nodes to the set of selected nodes in the graph.
Parameters:
locations
GraphLocation
objects that specify the locations of nodes in the graph.
public void enableSelectionEvents(boolean enable)Determines whether the broadcasting of graph-selection events is enabled or disabled based on the value of the
enable
parameter.
Parameters:
enable
enable
is true, graph-selection events are enabled and a SELECTION_CHANGED event is fired to all graph-selection listeners. If enable
is false, all graph-selection events are disabled.
public void remove(GraphLocation location)Removes the specified node from the set of selected nodes. The node is specified as a
GraphLocation
object.
Parameters:
location
GraphLocation
object that specifies the location of the node in the set of selected nodes.
public void remove(GraphLocation[] location)Removes a specified array of nodes from the set of selected nodes.
Parameters:
locations
GraphLocation
objects that specify the nodes that are to be removed from the set of selected nodes.public void removeAll()Removes all nodes from the set of selected nodes.
public void set(GraphLocation[] locations)Sets the selection pool to a given set of nodes.
Parameters:
locations
GraphLocation
objects that becomes the new sets of selected nodes.
public void addSelectionListener(GraphSelectionListener listener) public void removeSelectionListener(GraphSelectionListener listener)