public interface GraphSelectionModel
A GraphSelectionModel can be configured to allow only one
cell (SINGLE_GRAPH_SELECTION
) or a number of
cells (MULTIPLE_GRAPH_SELECTION
).
Modifier and Type | Field and Description |
---|---|
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.
|
Modifier and Type | Method and Description |
---|---|
void |
addGraphSelectionListener(GraphSelectionListener x)
Adds x to the list of listeners that are notified each time the
set of selected Objects changes.
|
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds a PropertyChangeListener to the listener list.
|
void |
addSelectionCell(java.lang.Object cell)
Adds cell to the current selection.
|
void |
addSelectionCells(java.lang.Object[] cells)
Adds cells to the current selection.
|
void |
clearSelection()
Empties the current selection.
|
java.lang.Object[] |
getSelectables()
Returns the cells that are currently selectable.
|
java.lang.Object |
getSelectionCell()
Returns the first cell in the selection.
|
java.lang.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(java.lang.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(java.lang.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(java.beans.PropertyChangeListener listener)
Removes a PropertyChangeListener from the listener list.
|
void |
removeSelectionCell(java.lang.Object cell)
Removes cell from the selection.
|
void |
removeSelectionCells(java.lang.Object[] cells)
Removes cells from the selection.
|
void |
setChildrenSelectable(boolean flag)
Sets if the selection model allows the selection
of children.
|
void |
setSelectionCell(java.lang.Object cell)
Sets the selection to cell.
|
void |
setSelectionCells(java.lang.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.
|
static final int SINGLE_GRAPH_SELECTION
static final int MULTIPLE_GRAPH_SELECTION
void setSelectionMode(int mode)
This may change the selection if the current selection is not valid for the new mode.
void setChildrenSelectable(boolean flag)
boolean isChildrenSelectable()
int getSelectionMode()
SINGLE_GRAPH_SELECTION
or
MULTIPLE_GRAPH_SELECTION
.void setSelectionCell(java.lang.Object cell)
cell
is
null, this has the same effect as invoking clearSelection
.cell
- new cell to selectvoid setSelectionCells(java.lang.Object[] cells)
cells
is
null, this has the same effect as invoking clearSelection
.cells
- new selectionvoid addSelectionCell(java.lang.Object cell)
cell
is null.cell
- the new cell to add to the current selectionvoid addSelectionCells(java.lang.Object[] cells)
cells
is null.cells
- the new cells to add to the current selectionvoid removeSelectionCell(java.lang.Object cell)
cell
is null.cell
- the cell to remove from the selectionvoid removeSelectionCells(java.lang.Object[] cells)
cells
are in the selection, the
GraphSelectionListeners are notified. This method has no
effect if cells
is null.cells
- the cells to remove from the selectionjava.lang.Object[] getSelectables()
java.lang.Object getSelectionCell()
java.lang.Object[] getSelectionCells()
int getSelectionCount()
boolean isCellSelected(java.lang.Object cell)
cell
, is in the current
selection.boolean isChildrenSelected(java.lang.Object cell)
cell
,
has selected children.boolean isSelectionEmpty()
void clearSelection()
void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
A PropertyChangeEvent will get fired when the selection mode changes.
listener
- the PropertyChangeListener to be addedvoid removePropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
- the PropertyChangeListener to be removedvoid addGraphSelectionListener(GraphSelectionListener x)
x
- the new listener to be addedvoid removeGraphSelectionListener(GraphSelectionListener x)
x
- the listener to removeCopyright (C) 2001-2009 JGraph Ltd. All rights reserved.