|
|||||
| SUMMARY: FIELD | CONSTR | METHOD| EVENT | DETAIL: FIELD | CONSTR | METHOD| EVENT | ||||
This class realizes a client list of node and/or edge ids.
It is independent of the server side. It does not provide highlighting of selected nodes and edges (see the graph canvas for this). The selectable types of graph elements (nodes and/or edges) are configurable for each instance.
| Constructor Summary | |
|---|---|
GraphSelection(/*Boolean*/ selectNodes, /*Boolean*/ selectEdges)
This class realizes a client list of node and/or edge ids. |
|
| Method Summary | |
|---|---|
Boolean |
add(/*String*/ id)
adds the given id to the selection and returns true on success. |
|
addAll(/*String[]*/ ids)
calls add() for all the given ids. |
|
clear()
clears the current selection. |
String[] |
get()
returns an array of ids of all selected graph elements. |
String[] |
getEdges()
returns an array of ids of selected edges. |
String[] |
getNodes()
returns an array of ids of selected nodes. |
Number |
getSize()
returns the number of selected elements. |
Boolean |
isSelected(/*String*/ id)
returns true if the given id belongs to the selection and false otherwise. |
Boolean |
remove(/*String*/ id)
removes the given id from the selection and returns true on success. |
|
removeAll(/*String[]*/ ids)
calls remove() for all the given ids. |
|
setSelectEdges(/*Boolean*/ bool)
allow or do not allow the selection of edges. |
|
setSelectNodes(/*Boolean*/ bool)
allow or do not allow the selection of nodes. |
Boolean |
toggle(/*String*/ id)
toggles the selection state for the given id. |
|
toggleAll(/*String[]*/ ids)
calls toggle() for all the given ids. |
| Event Summary | |
|---|---|
|
onAddEdge(/*String*/ edgeId)
is called whenever an edge id is added to the selection. |
|
onAddNode(/*String*/ nodeId)
is called whenever a node id is added to the selection. |
|
onRemoveEdge(/*String*/ edgeId)
is called whenever an edge id is removed from the selection. |
|
onRemoveNode(/*String*/ nodeId)
is called whenever a node id is removed from the selection. |
| Constructor Detail |
|---|
GraphSelection(/*Boolean*/ selectNodes, /*Boolean*/ selectEdges)
selectNodes - whether edges are allowed to be selected
selectEdges -
| Method Detail |
|---|
Boolean add(/*String*/ id)
id - The id of the node or edge that should be selected.
addAll(/*String[]*/ ids)
ids - An array of ids of nodes or edges that should be selected.
clear()
String[] get()
String[] getEdges()
String[] getNodes()
Number getSize()
Boolean isSelected(/*String*/ id)
id - The node or edge to test.
Boolean remove(/*String*/ id)
id - The id of the node or edge that should be removed from the selection.
removeAll(/*String[]*/ ids)
ids - An array of ids of nodes or edges that should be deselected.
setSelectEdges(/*Boolean*/ bool)
bool - whether edges are allowed to be selected
setSelectNodes(/*Boolean*/ bool)
bool - whether nodes are allowed to be selected
Boolean toggle(/*String*/ id)
id - The id of the node or edge whose selection state should be toggled.
toggleAll(/*String[]*/ ids)
ids - An array of ids of nodes or edges whose selection state should be toggled.
| Event Detail |
|---|
onAddEdge(/*String*/ edgeId)
edgeId - The id of the edge.
onAddNode(/*String*/ nodeId)
nodeId - The id of the node.
onRemoveEdge(/*String*/ edgeId)
edgeId - The id of the edge.
onRemoveNode(/*String*/ nodeId)
nodeId - The id of the node.