|
JGraph |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This interface represents the current state of the selection for the graph component.
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. |
Field Detail |
public static final int SINGLE_GRAPH_SELECTION
public static final int MULTIPLE_GRAPH_SELECTION
Method Detail |
public void setSelectionMode(int mode)
This may change the selection if the current selection is not valid for the new mode.
public void setChildrenSelectable(boolean flag)
public boolean isChildrenSelectable()
public int getSelectionMode()
SINGLE_GRAPH_SELECTION
or
MULTIPLE_GRAPH_SELECTION
.
public void setSelectionCell(Object cell)
cell
is
null, this has the same effect as invoking clearSelection
.
cell
- new cell to selectpublic void setSelectionCells(Object[] cells)
cells
is
null, this has the same effect as invoking clearSelection
.
cells
- new selectionpublic void addSelectionCell(Object cell)
cell
is null.
cell
- the new cell to add to the current selectionpublic void addSelectionCells(Object[] cells)
cells
is null.
cells
- the new cells to add to the current selectionpublic void removeSelectionCell(Object cell)
cell
is null.
cell
- the cell to remove from the selectionpublic void removeSelectionCells(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 selectionpublic Object[] getSelectables()
public Object getSelectionCell()
public Object[] getSelectionCells()
public int getSelectionCount()
public boolean isCellSelected(Object cell)
cell
, is in the current
selection.
public boolean isChildrenSelected(Object cell)
cell
,
has selected children.
public boolean isSelectionEmpty()
public void clearSelection()
public void addPropertyChangeListener(PropertyChangeListener listener)
A PropertyChangeEvent will get fired when the selection mode changes.
listener
- the PropertyChangeListener to be addedpublic void removePropertyChangeListener(PropertyChangeListener listener)
listener
- the PropertyChangeListener to be removedpublic void addGraphSelectionListener(GraphSelectionListener x)
x
- the new listener to be addedpublic void removeGraphSelectionListener(GraphSelectionListener x)
x
- the listener to remove
|
JGraph |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |