|
|||||
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. |
|
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(bool 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)
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.
selectNodes
- whether edges are allowed to be selected
selectEdges
-
Method Detail |
---|
Boolean add(String id)
adds the given id to the selection and returns true on success.
Adding fails, if the given id belongs to a graph element which is already in the selection or which is not allowed to be selected.
id
- The id of the node or edge that should be selected.
addAll(String[] ids)
calls add() for all the given ids.
ids
- An array of ids of nodes or edges that should be selected.
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.
id
- The node or edge to test.
onAddEdge(String edgeId)
is called whenever an edge id is added to the selection.
edgeId
- The id of the edge.
onAddNode(String nodeId)
is called whenever a node id is added to the selection.
nodeId
- The id of the node.
onRemoveEdge(String edgeId)
is called whenever an edge id is removed from the selection.
edgeId
- The id of the edge.
onRemoveNode(String nodeId)
is called whenever a node id is removed from the selection.
nodeId
- The id of the node.
Boolean remove(String id)
removes the given id from the selection and returns true on success.
Removing fails, if the given id belongs to a graph element which does not belong to the selection.
id
- The id of the node or edge that should be removed from the selection.
removeAll(String[] ids)
calls remove() for all the given ids.
ids
- An array of ids of nodes or edges that should be deselected.
setSelectEdges(bool bool)
allow or do not allow the selection of edges.
bool
- whether edges are allowed to be selected
setSelectNodes(Boolean bool)
allow or do not allow the selection of nodes.
bool
- whether nodes are allowed to be selected
Boolean toggle(String id)
toggles the selection state for the given id.
The id is removed from the selection, if it belongs to the selection. It is added, if it does not belong to the selection and is allowed to be selected. True is returned on success.
id
- The id of the node or edge whose selection state should be toggled.
toggleAll(String[] ids)
calls toggle() for all the given ids.
ids
- An array of ids of nodes or edges whose selection state should be toggled.