org.jgraph.graph
public interface GraphSelectionModel
A GraphSelectionModel can be configured to allow only one
cell (SINGLE_GRAPH_SELECTION) or a number of
cells (MULTIPLE_GRAPH_SELECTION).
| Field Summary | |
|---|---|
| static int | MULTIPLE_GRAPH_SELECTION Selection can contain any number of items. |
| static int | SINGLE_GRAPH_SELECTION Selection can only contain one cell at a time. |
| Method Summary | |
|---|---|
| void | addGraphSelectionListener(GraphSelectionListener x)
Adds x to the list of listeners that are notified each time the
set of selected Objects changes.
|
| void | addPropertyChangeListener(PropertyChangeListener listener)
Adds a PropertyChangeListener to the listener list.
|
| void | addSelectionCell(Object cell)
Adds cell to the current selection. |
| void | addSelectionCells(Object[] cells)
Adds cells to the current selection. |
| void | clearSelection()
Empties the current selection. |
| Object[] | getSelectables()
Returns the cells that are currently selectable. |
| Object | getSelectionCell()
Returns the first cell in the selection. |
| Object[] | getSelectionCells()
Returns the cells in the selection. |
| int | getSelectionCount()
Returns the number of cells that are selected. |
| int | getSelectionMode()
Returns the current selection mode, either
SINGLE_GRAPH_SELECTION or
MULTIPLE_GRAPH_SELECTION. |
| boolean | isCellSelected(Object cell)
Returns true if the cell, cell, is in the current
selection. |
| boolean | isChildrenSelectable()
Returns true if the selection model allows the selection
of children. |
| boolean | isChildrenSelected(Object cell)
Returns true if the cell, cell,
has selected children. |
| boolean | isSelectionEmpty()
Returns true if the selection is currently empty. |
| void | removeGraphSelectionListener(GraphSelectionListener x)
Removes x from the list of listeners that are notified each time
the set of selected Objects changes.
|
| void | removePropertyChangeListener(PropertyChangeListener listener)
Removes a PropertyChangeListener from the listener list.
|
| void | removeSelectionCell(Object cell)
Removes cell from the selection. |
| void | removeSelectionCells(Object[] cells)
Removes cells from the selection. |
| void | setChildrenSelectable(boolean flag)
Sets if the selection model allows the selection
of children. |
| void | setSelectionCell(Object cell)
Sets the selection to cell. |
| void | setSelectionCells(Object[] cells)
Sets the selection to cells. |
| void | setSelectionMode(int mode)
Sets the selection model, which must be either
SINGLE_GRAPH_SELECTION or MULTIPLE_GRAPH_SELECTION.
|
Parameters: x the new listener to be added
A PropertyChangeEvent will get fired when the selection mode changes.
Parameters: listener the PropertyChangeListener to be added
cell is null.
Parameters: cell the new cell to add to the current selection
cells is null.
Parameters: cells the new cells to add to the current selection
SINGLE_GRAPH_SELECTION or
MULTIPLE_GRAPH_SELECTION.cell, is in the current
selection.cell,
has selected children.Parameters: x the listener to remove
Parameters: listener the PropertyChangeListener to be removed
cell is null.
Parameters: cell the cell to remove from the selection
cells are in the selection, the
GraphSelectionListeners are notified. This method has no
effect if cells is null.
Parameters: cells the cells to remove from the selection
cell is
null, this has the same effect as invoking clearSelection.
Parameters: cell new cell to select
cells is
null, this has the same effect as invoking clearSelection.
Parameters: cells new selection
This may change the selection if the current selection is not valid for the new mode.