|
|||||
| SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||
This class adds support for nesting using group and folder nodes to a graph.
| Constructor Summary | |
|---|---|
HierarchyManager(/*Graph*/ graph)
This class adds support for nesting using group and folder nodes to a graph. |
|
| Method Summary | |
|---|---|
|
closeGroup(/*String*/ groupNodeId)
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)
Conveniance method that moves all given nodes a hierarchy level up, if possible. |
|
moveToSubgraph(/*String[]*/ subNodeIds, /*String?*/ parentNodeId)
assigns the nodes with the given subNodeIds to the group node with the given parentNodeId. |
|
onCloseGroup(/*String*/ id, /*Object*/ newBounds)
is called if a group node was successfully closed, i.e. converted to a folder node. |
|
onCloseGroupFailed(/*String*/ name, /*String*/ id)
is called if closing a group node failed. |
|
onCreateGroup(/*String*/ id, /*Object*/ newBounds, /*String*/ name)
is called, if a new group node was successfully created. |
|
onCreateGroupFailed(/*String*/ name)
is called, if the creation of a new group node failed. |
|
onMoveToParent(/*String*/ parentNodeId, /*Object*/ newBounds, /*String[]*/ subNodeIds)
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)
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)
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)
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)
is called if a folder node was successfully opened, i.e. converted to a group node. |
|
onOpenGroupFailed(/*String*/ name, /*String*/ id)
is called if opening a folder node failed. |
|
onSwitchToParent(/*String*/ id, /*Object*/ newBounds)
is called if the graph was successfully switched to its parent graph. |
|
onSwitchToParentFailed(/*String*/ name)
is called if switching the graph to its parent graph failed. |
|
onSwitchToSubgraph(/*String*/ id, /*Object*/ newBounds)
is called if the graph was successfully switched to a subgraph. |
|
onSwitchToSubgraphFailed(/*String*/ name, /*String*/ id)
is called if switching the graph to a subgraph failed. |
|
openGroup(/*String*/ groupNodeId)
converts the folder node with the given id into a group node. |
|
refresh()
refreshes the cached hierarchy information by means of a server call. |
|
switchToParent()
returns to the parent of the current subgraph. |
|
switchToSubgraph(/*String?*/ parentNodeId)
enters the subgraph (group or folder) of the node with the given id. |
| Constructor Detail |
|---|
HierarchyManager(/*Graph*/ graph)
graph - the graph to be used for grouping and folding
| Method Detail |
|---|
closeGroup(/*String*/ groupNodeId)
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)
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)
String getParent(/*String*/ nodeId)
String getVisibleGraphParent()
Boolean isFolderNode(/*String*/ nodeId)
Boolean isGroupNode(/*String*/ nodeId)
Boolean isInStateLabelBox(/*String*/ nodeId, /*Number*/ x, /*Number*/ y)
Boolean isNormalNode(/*String*/ nodeId)
moveToParent(/*String[]*/ subNodeIds)
moveToSubgraph(/*String[]*/ subNodeIds, /*String?*/ parentNodeId)
onCloseGroup(/*String*/ id, /*Object*/ newBounds)
id - id of the new folder node
newBounds - new bounds of the graph
onCloseGroupFailed(/*String*/ name, /*String*/ id)
name - symbolic name of the graph
id - id the node, which was not closed
onCreateGroup(/*String*/ id, /*Object*/ newBounds, /*String*/ name)
id - id of the new node
newBounds - new bounds of the graph
name - symbolic name of the graph
onCreateGroupFailed(/*String*/ name)
name - symbolic name of the graph
onMoveToParent(/*String*/ parentNodeId, /*Object*/ newBounds, /*String[]*/ subNodeIds)
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
onMoveToParentFailed(/*String*/ name, /*String[]*/ subNodeIds)
name - symbolic name of the graph
subNodeIds - ids of the nodes which were requested to be moved
onMoveToSubgraph(/*String*/ parentNodeId, /*Object*/ newBounds, /*String[]*/ subNodeIds)
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
onMoveToSubgraphFailed(/*String*/ name, /*String*/ parentNodeId, /*String[]*/ subNodeIds)
name - symbolic name of the graph
newBounds: bounds of the parent graph
subNodeIds - ids of the nodes which were requested to be moved
onNewHierarchyInfo(/*String*/ name)
name - symbolic name of the graph
onOpenGroup(/*String*/ id, /*Object*/ newBounds)
id - id of the new group node
newBounds - new bounds of the graph
onOpenGroupFailed(/*String*/ name, /*String*/ id)
name - symbolic name of the graph
id - id the node, which was not opened
onSwitchToParent(/*String*/ id, /*Object*/ newBounds)
id - id of the parent node of the new graph
newBounds - bounds of the parent graph
onSwitchToParentFailed(/*String*/ name)
name - symbolic name of the graph
onSwitchToSubgraph(/*String*/ id, /*Object*/ newBounds)
id - id of the parent node of the subgraph, null for the root graph
newBounds - bounds of the switched graph
onSwitchToSubgraphFailed(/*String*/ name, /*String*/ id)
name - symbolic name of the graph
id - id the parent node of the subgraph, to which switching failed
openGroup(/*String*/ groupNodeId)
refresh()
switchToParent()
switchToSubgraph(/*String?*/ parentNodeId)
parentNodeId - is given, then the graph is switched to its top level. If the parent node
is a group node, it is converted to a folder node, since yFiles only supports switching
to the contents of a folder node or the root graph.