|
|||||
| SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||
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. |
|
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. |
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. |
| Constructor Detail |
|---|
GraphSelection(/*Boolean*/ selectNodes, /*Boolean*/ selectEdges)
selectNodes - whether edges are allowed to be selected
| Method Detail |
|---|
Boolean add(/*String*/ id)
addAll(/*String[]*/ ids)
clear()
String[] get()
String[] getEdges()
String[] getNodes()
Number getSize()
Boolean isSelected(/*String*/ id)
onAddEdge(/*String*/ edgeId)
onAddNode(/*String*/ nodeId)
onRemoveEdge(/*String*/ edgeId)
onRemoveNode(/*String*/ nodeId)
Boolean remove(/*String*/ id)
removeAll(/*String[]*/ ids)
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)
toggleAll(/*String[]*/ ids)