|
JGraph X 1.0.2.8 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.mxgraph.util.mxEventSource
com.mxgraph.view.mxGraphSelectionModel
public class mxGraphSelectionModel
To add a change listener to the graph selection model:
addListener(
mxEvent.CHANGE, new mxEventListener()
{
public void invoke(Object source, Object[] args)
{
selectionChanged((mxSelectionModel) source, (Collection) args[0],
(Collection) args[1]);
}
});
Nested Class Summary | |
---|---|
static class |
mxGraphSelectionModel.mxSelectionChange
|
Nested classes/interfaces inherited from class com.mxgraph.util.mxEventSource |
---|
mxEventSource.mxIEventListener |
Field Summary | |
---|---|
protected Set |
cells
Holds the selection cells. |
protected mxGraph |
graph
Reference to the enclosing graph. |
protected boolean |
singleSelection
Specifies if only one selected item at a time is allowed. |
Fields inherited from class com.mxgraph.util.mxEventSource |
---|
eventListeners, eventsEnabled, eventSource |
Constructor Summary | |
---|---|
mxGraphSelectionModel(mxGraph graph)
Constructs a new selection model for the specified graph. |
Method Summary | |
---|---|
void |
addCell(Object cell)
Adds the given cell to the selection. |
void |
addCells(Object[] cells)
|
protected void |
cellAdded(Object cell)
|
protected void |
cellRemoved(Object cell)
|
protected void |
changeSelection(Collection added,
Collection removed)
|
void |
clear()
Clears the selection. |
Object |
getCell()
Returns the first selected cell. |
Object[] |
getCells()
Returns the selection cells. |
protected Object |
getFirstSelectableCell(Object[] cells)
Returns the first selectable cell in the given array of cells. |
boolean |
isEmpty()
Returns true if no cells are selected. |
boolean |
isSelected(Object cell)
Returns true if the given cell is selected. |
boolean |
isSingleSelection()
|
void |
removeCell(Object cell)
Removes the given cell from the selection. |
void |
removeCells(Object[] cells)
|
void |
setCell(Object cell)
Clears the selection and adds the given cell to the selection. |
void |
setCells(Object[] cells)
Clears the selection and adds the given cells. |
void |
setSingleSelection(boolean singleSelection)
|
int |
size()
Returns the number of selected cells. |
Methods inherited from class com.mxgraph.util.mxEventSource |
---|
addListener, fireEvent, fireEvent, fireEvent, getEventSource, isEventsEnabled, removeListener, removeListener, setEventsEnabled, setEventSource |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected mxGraph graph
protected boolean singleSelection
protected Set cells
Constructor Detail |
---|
public mxGraphSelectionModel(mxGraph graph)
graph
- Method Detail |
---|
public boolean isSingleSelection()
public void setSingleSelection(boolean singleSelection)
singleSelection
- the singleSelection to setpublic boolean isSelected(Object cell)
cell
-
public boolean isEmpty()
public int size()
public void clear()
public Object getCell()
public Object[] getCells()
public void setCell(Object cell)
public void setCells(Object[] cells)
protected Object getFirstSelectableCell(Object[] cells)
cells
- Array of cells to return the first selectable cell for.
public void addCell(Object cell)
public void addCells(Object[] cells)
public void removeCell(Object cell)
public void removeCells(Object[] cells)
protected void changeSelection(Collection added, Collection removed)
protected void cellAdded(Object cell)
protected void cellRemoved(Object cell)
|
JGraph X 1.0.2.8 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |