|
|||||
| SUMMARY: FIELD | CONSTR | METHOD| EVENT | DETAIL: FIELD | CONSTR | METHOD| EVENT | ||||
Manages hierarchic graphs.
| Constructor Summary | |
|---|---|
HierarchyManager(/*Graph*/ graph)
This class adds support for nesting using group and folder nodes to a graph. |
|
| Method Summary | |
|---|---|
|
closeGroup(/*String*/ groupNodeId, /*anything*/ customData)
converts the group node with the given id into a folder node. |
|
createGroup(/*Object*/ args)
returns a newly created group node according to the given arguments. |
Graph |
getGraph()
returns the graph managed by this instance. |
String[] |
getNodes(/*Object*/ args)
returns node ids according to the criteria defined in the arguments object. |
String |
getParent(/*String*/ nodeId)
returns the id of the parent node of the node with the given id. |
String |
getVisibleGraphParent()
returns the id of parent node for the currently visible graph or null. |
Boolean |
isFolderNode(/*String*/ nodeId)
returns true, if the node with the given id is a folder node. |
Boolean |
isGroupNode(/*String*/ nodeId)
returns true, if the node with the given id is a group node. |
Boolean |
isInStateLabelBox(/*String*/ nodeId, /*Number*/ x, /*Number*/ y)
returns true, if (x,y) in world coordinates is inside the bounds of the state label of the group or folder node with the given id. |
Boolean |
isNormalNode(/*String*/ nodeId)
returns true, if the node with the given id is neither a group nor a folder node. |
|
moveToParent(/*String[]*/ subNodeIds, /*anything*/ customData)
Conveniance method that moves all given nodes a hierarchy level up, if possible. |
|
moveToSubgraph(/*String[]*/ subNodeIds, /*String*/ parentNodeId, /*anything*/ customData)
assigns the nodes with the given subNodeIds to the group node with the given parentNodeId. |
|
openGroup(/*String*/ groupNodeId, /*anything*/ customData)
converts the folder node with the given id into a group node. |
|
refresh()
refreshes the cached hierarchy information by means of a server call. |
|
setData(/*Object*/ hierarchyData)
set the hierarchy data. |
|
switchToParent(/*anything*/ customData)
returns to the parent of the current subgraph. |
|
switchToSubgraph(/*String*/ parentNodeId, /*anything*/ customData)
enters the subgraph (group or folder) of the node with the given id. |
| Event Summary | |
|---|---|
|
onCloseGroup(/*String*/ id, /*Object*/ newBounds, /*anything*/ customData)
is called if a group node was successfully closed, i.e. converted to a folder node. |
|
onCloseGroupFailed(/*String*/ name, /*String*/ id, /*anything*/ customData)
is called if closing a group node failed. |
|
onCreateGroup(/*String*/ id, /*Object*/ newBounds, /*String*/ name, /*anything*/ customData)
is called, if a new group node was successfully created. |
|
onCreateGroupFailed(/*String*/ name, /*anything*/ customData)
is called, if the creation of a new group node failed. |
|
onMoveToParent(/*String*/ parentNodeId, /*Object*/ newBounds, /*String[]*/ subNodeIds, /*anything*/ customData)
is called if the nodes with the given ids were successfully moved to the parent graph of the current graph. |
|
onMoveToParentFailed(/*String*/ name, /*String[]*/ subNodeIds, /*anything*/ customData)
is called if moving the nodes with the given ids to the parent graph of the current graph failed. |
|
onMoveToSubgraph(/*String*/ parentNodeId, /*Object*/ newBounds, /*String[]*/ subNodeIds, /*anything*/ customData)
is called if the nodes with the given ids were successfully moved to the subgraph of the node with the given parentNodeId. |
|
onMoveToSubgraphFailed(/*String*/ name, /*String*/ parentNodeId, /*String[]*/ subNodeIds, /*anything*/ customData)
is called if moving the nodes with the given ids to the subgraph of the node with the given parentNodeId failed. |
|
onNewHierarchyInfo(/*String*/ name)
is called, if new info on the nesting structure of the graph is available. |
|
onOpenGroup(/*String*/ id, /*Object*/ newBounds, /*anything*/ customData)
is called if a folder node was successfully opened, i.e. converted to a group node. |
|
onOpenGroupFailed(/*String*/ name, /*String*/ id, /*anything*/ customData)
is called if opening a folder node failed. |
|
onSwitchToParent(/*String*/ id, /*Object*/ newBounds, /*anything*/ customData)
is called if the graph was successfully switched to its parent graph. |
|
onSwitchToParentFailed(/*String*/ name, /*anything*/ customData)
is called if switching the graph to its parent graph failed. |
|
onSwitchToSubgraph(/*String*/ id, /*Object*/ newBounds, /*anything*/ customData)
is called if the graph was successfully switched to a subgraph. |
|
onSwitchToSubgraphFailed(/*String*/ name, /*String*/ id, /*anything*/ customData)
is called if switching the graph to a subgraph failed. |
| Constructor Detail |
|---|
HierarchyManager(/*Graph*/ graph)
graph - the graph to be used for grouping and folding
| Method Detail |
|---|
closeGroup(/*String*/ groupNodeId, /*anything*/ customData)
groupNodeId - The id of the group node that should be converted into a folder node.
customData - Any data that should be passed forward to the onCloseGroup and onCloseGroupFailed callbacks.
createGroup(/*Object*/ args)
x -> x coordinate of the center of the new node (in world coordinates, default 0) y -> y coordinate of the center of the new node (in world coordinates, default 0) closed -> if true, create a closed group node (folder), if false create an open group node (default) type -> name of the node realizer to use (String, optional) subNodeIds -> the corresponding nodes become part of the new group (String[], optional) parentNodeId -> id of the parent group or folder node for the new group node, if null and no subnode ids are given use the currently visible subgraph, if null and subnode ids are given, their nearest common ancestor becomes the parent of the new group (String, optional) customData -> optional parameter which is not sent to the server, but passed to the callback for the success or failure case.
args - An object that has any of the described properties.
Graph getGraph()
String[] getNodes(/*Object*/ args)
excludeNormalNodes -> do not return normal nodes (default false) excludeFolderNodes -> do not return folder nodes (default false) excludeGroupNodes -> do not return group nodes (default false) onlyChildrenOf -> only return children of the given node (String, optional)
args - An object that defines any of the described properties.
String getParent(/*String*/ nodeId)
nodeId - The id of the node that should be tested.
String getVisibleGraphParent()
Boolean isFolderNode(/*String*/ nodeId)
nodeId - The id of the node that should be tested.
Boolean isGroupNode(/*String*/ nodeId)
nodeId - The id of the node that should be tested.
Boolean isInStateLabelBox(/*String*/ nodeId, /*Number*/ x, /*Number*/ y)
nodeId - The id of the node that owns the state label.
x - The x coordinate that should be contained in the state label box.
y - The y coordinate that should be contained in the state label box.
Boolean isNormalNode(/*String*/ nodeId)
nodeId - The id of the node that should be tested.
moveToParent(/*String[]*/ subNodeIds, /*anything*/ customData)
subNodeIds - The ids of the nodes that should be assigned to the parent of their group.
customData - Any data that should be passed forward to the onMoveToParent and onMoveToParentFailed callbacks.
moveToSubgraph(/*String[]*/ subNodeIds, /*String*/ parentNodeId, /*anything*/ customData)
subNodeIds - The ids of the nodes that should be assigned to the specified parentNodeId.
parentNodeId - The id of the group node that the nodes specified in the subNodeIds should be assigned to.
customData - Any data that should be passed forward to the onMoveToSubgraph and onMoveToSubgraphFailed callbacks.
openGroup(/*String*/ groupNodeId, /*anything*/ customData)
groupNodeId - The id of the folder node that should be converted into a group node.
customData - Any data that should be passed forward to the onOpenGroup and onOpenGroupFailed callbacks.
refresh()
setData(/*Object*/ hierarchyData)
hierarchyData - the hierarchy data as an object in the format which is also returned
by the server
switchToParent(/*anything*/ customData)
customData - Any data that should be passed forward to the onSwitchToParent and onSwitchToParentFailed callbacks.
switchToSubgraph(/*String*/ parentNodeId, /*anything*/ customData)
parentNodeId - The id of the group or folder node that should be entered.
customData - Any data that should be passed forward to the onSwitchToSubgraph and onSwitchToSubgraphFailed callbacks.
| Event Detail |
|---|
onCloseGroup(/*String*/ id, /*Object*/ newBounds, /*anything*/ customData)
id - id of the new folder node
newBounds - new bounds of the graph
customData - custom data from the request
onCloseGroupFailed(/*String*/ name, /*String*/ id, /*anything*/ customData)
name - symbolic name of the graph
id - id the node, which was not closed
customData - custom data from the request
onCreateGroup(/*String*/ id, /*Object*/ newBounds, /*String*/ name, /*anything*/ customData)
id - id of the new node
newBounds - new bounds of the graph
name - symbolic name of the graph
customData - custom data from the request
onCreateGroupFailed(/*String*/ name, /*anything*/ customData)
name - symbolic name of the graph
customData - custom data from the request
onMoveToParent(/*String*/ parentNodeId, /*Object*/ newBounds, /*String[]*/ subNodeIds, /*anything*/ customData)
parentNodeId - id of the parent node of the new graph, null for the root graph
newBounds - bounds of the parent graph
subNodeIds - ids of the nodes which were moved
customData - custom data from the request
onMoveToParentFailed(/*String*/ name, /*String[]*/ subNodeIds, /*anything*/ customData)
name - symbolic name of the graph
subNodeIds - ids of the nodes which were requested to be moved
customData - custom data from the request
onMoveToSubgraph(/*String*/ parentNodeId, /*Object*/ newBounds, /*String[]*/ subNodeIds, /*anything*/ customData)
parentNodeId - id of the parent node of the new graph, null for the root graph
newBounds - bounds of the parent graph
subNodeIds - ids of the nodes which were moved
customData - custom data from the request
onMoveToSubgraphFailed(/*String*/ name, /*String*/ parentNodeId, /*String[]*/ subNodeIds, /*anything*/ customData)
name - symbolic name of the graph
parentNodeId - id of the parent node of the requested subgraph, null for the root graph
newBounds: bounds of the parent graph
subNodeIds - ids of the nodes which were requested to be moved
customData - custom data from the request
onNewHierarchyInfo(/*String*/ name)
name - symbolic name of the graph
onOpenGroup(/*String*/ id, /*Object*/ newBounds, /*anything*/ customData)
id - id of the new group node
newBounds - new bounds of the graph
customData - custom data from the request
onOpenGroupFailed(/*String*/ name, /*String*/ id, /*anything*/ customData)
name - symbolic name of the graph
id - id the node, which was not opened
customData - custom data from the request
onSwitchToParent(/*String*/ id, /*Object*/ newBounds, /*anything*/ customData)
id - id of the parent node of the new graph
newBounds - bounds of the parent graph
customData - custom data from the request
onSwitchToParentFailed(/*String*/ name, /*anything*/ customData)
name - symbolic name of the graph
customData - custom data from the request
onSwitchToSubgraph(/*String*/ id, /*Object*/ newBounds, /*anything*/ customData)
id - id of the parent node of the subgraph, null for the root graph
newBounds - bounds of the switched graph
customData - custom data from the request
onSwitchToSubgraphFailed(/*String*/ name, /*String*/ id, /*anything*/ customData)
name - symbolic name of the graph
id - id the parent node of the subgraph, to which switching failed
customData - custom data from the request