|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecty.base.Graph
y.layout.LayoutGraph
y.layout.DefaultLayoutGraph
com.yworks.yfiles.server.graphml.flexio.data.StyledLayoutGraph
com.yworks.yfiles.server.graphml.folding.FoldedLayoutGraph
A LayoutGraph that supports folding operations.
This graph implementation supports folding through the
collapse(Node) operation and provides access to dummy states
for nodes and edges.
Distinct layouts and styles can be assigned to dummy states.
Access to the dummy states is provided through
getEdgeViewState(DummyEdgeId) and getNodeViewState(DummyNodeId).
The folded graph also supports the notion of a
local root, which is relevant for
layout calculations.
| Field Summary |
| Fields inherited from class y.layout.DefaultLayoutGraph |
edgeLabelFeatureMap, edgeLabelMap, nodeLabelFeatureMap, nodeLabelMap |
| Fields inherited from class y.layout.LayoutGraph |
z |
| Fields inherited from class y.base.Graph |
AFTER, BEFORE |
| Constructor Summary | |
FoldedLayoutGraph()
Creates a new instance of a folded layout graph. |
|
| Method Summary | |
void |
collapse(Node node)
Collapse a group node, hiding its children from the current view. |
EdgeViewState |
createEdgeViewState(DummyEdgeId edgeId)
Creates an edge view state instance for the provided edge id. |
protected DataMap |
createEdgeViewStateMap()
Create the DataMap that stores the EdgeViewState instances
for dummy edges.
|
protected DataMap |
createExpansionStateMap()
Create the DataMap that stores the node expansion state.
|
Node |
createNode()
Creates a new node, applying the default node size.
|
NodeViewState |
createNodeViewState(DummyNodeId nodeId)
Creates a node view state instance for the provided node id. |
protected DataMap |
createNodeViewStateMap()
Create the DataMap that stores the NodeViewState instances
for the collapsed state of group nodes.
|
void |
doLayout(Layouter layouter)
Calculates a layout for the folded graph view defined by this instance. |
void |
doLayout(Layouter layouter,
Node root,
boolean recursive,
byte dummyEdgeMode)
Calculates a layout for the folded graph view defined by this instance. |
void |
expand(Node node)
Expands a collapsed group node, revealing its children in the folded graph view defined by this graph. |
EdgeViewState |
getEdgeViewState(DummyEdgeId edgeId)
Returns the view state of a dummy edge defined by the provided dummy edge id. |
Node |
getLocalRoot()
A non-leaf node that is considered the virtual root node of this graph. |
NodeViewState |
getNodeViewState(DummyNodeId nodeId)
Returns the view state of a collapsed group node. |
boolean |
isExpanded(Node node)
Returns whether the provided node is currently in expanded state. |
void |
setEdgeViewState(DummyEdgeId edgeId,
EdgeViewState viewState)
Sets a view state of a dummy edge identified by the provided dummy edge id. |
void |
setLocalRoot(Node node)
A non-leaf node that is considered the virtual root node of this graph. |
void |
setNodeViewState(DummyNodeId dummyNodeId,
NodeViewState viewState)
Sets the view state of a collapsed group node. |
| Methods inherited from class com.yworks.yfiles.server.graphml.flexio.data.StyledLayoutGraph |
addLabel, addLabel, getDefaultNodeSize, getLabels, getLabels, getNodeHierarchy, getStyle, getStyle, getUserTag, setDefaultNodeSize, setStyle, setStyle, setUserTag, syncLabels, syncLabels |
| Methods inherited from class y.layout.DefaultLayoutGraph |
createEdgeLayout, createGraphCopyFactory, createNodeLayout, getFeature, getFeature, getLabelLayout, getLabelLayout, getLayout, getLayout, setLabelLayout, setLabelLayout, setLabelLayout, setLayout, setLayout |
| Methods inherited from class y.layout.LayoutGraph |
getBoundingBox, getCenter, getCenterX, getCenterY, getEdgeLabelLayout, getEdgeLayout, getEdgeList, getHeight, getLocation, getNodeLabelLayout, getNodeLayout, getPath, getPathList, getPointList, getPoints, getRectangle, getSize, getSourcePointAbs, getSourcePointRel, getTargetPointAbs, getTargetPointRel, getWidth, getX, getY, moveBy, setCenter, setCenter, setEndPointsAbs, setLocation, setLocation, setPath, setPath, setPoints, setPoints, setSize, setSize, setSourcePointAbs, setSourcePointRel, setTargetPointAbs, setTargetPointRel |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public FoldedLayoutGraph()
Creates and registers the data providers required for maintaining the expansion state, node- and edge view states and the local root.
{@inheritDoc}
| Method Detail |
public void setLocalRoot(Node node)
The local root is considered when a layout is calculated for a folded graph.
node - A group node that will be set as the virtual root node of
this graph.public Node getLocalRoot()
The local root is considered when a layout is calculated for a folded graph.
protected DataMap createExpansionStateMap()
DataMap that stores the node expansion state.
The map will be registered as a data provider
with this graph, using the FoldedGraphKeys.EXPANSION_STATE_DPKEY key.
protected DataMap createNodeViewStateMap()
DataMap that stores the NodeViewState instances
for the collapsed state of group nodes.
The map will be registered as a data provider
with this graph, using the FoldedGraphKeys.NODE_VIEW_STATES_DPKEY key.
protected DataMap createEdgeViewStateMap()
DataMap that stores the EdgeViewState instances
for dummy edges.
The map will be registered as a data provider
with this graph, using the FoldedGraphKeys.EDGE_VIEW_STATES_DPKEY key.
public NodeViewState getNodeViewState(DummyNodeId nodeId)
If no view state has been defined for the provided dummy node id yet,
a new instance will be created
and associated with the id.
public void setNodeViewState(DummyNodeId dummyNodeId,
NodeViewState viewState)
dummyNodeId - A dummy node id that identifies the collapsed state of
a group node.viewState - The node view state that describes the appearance
of the collapsed group node.public NodeViewState createNodeViewState(DummyNodeId nodeId)
This implementation will use the current
style and layout of the
master node for the dummy node state.
createNodeViewState in interface ViewStateCreatorpublic EdgeViewState getEdgeViewState(DummyEdgeId edgeId)
If no view state has been defined for the provided dummy edge id yet,
a new instance will be created
and associated with the id.
public void setEdgeViewState(DummyEdgeId edgeId,
EdgeViewState viewState)
edgeId - A dummy edge id that identifies a dummy state of
a master edge in a folded graph.viewState - The edge view state that describes the visual
appearance of the dummy edge.public EdgeViewState createEdgeViewState(DummyEdgeId edgeId)
This implementation will use the current
style of the
master edge for the dummy edge state.
The source and target port of the edge view state are set to the center
of the source and target nodes (i.e., Port instances with
offsets (0,0) are used.
createEdgeViewState in interface ViewStateCreatorpublic void collapse(Node node)
node - A group node that will be collapsed.public void expand(Node node)
node - A collapsed group node. If the group node is already expanded,
this method does nothing.public boolean isExpanded(Node node)
collapse(Node),
expand(Node)public Node createNode()
default node size.
public void doLayout(Layouter layouter)
A FoldingLayoutStage is used to apply the provided layout algorithm
to the folded graph view.
doLayout in class StyledLayoutGraphlayouter - The layout algorithm the will be applied to the folded
graph.doLayout(Layouter, Node, boolean, byte)
public void doLayout(Layouter layouter,
Node root,
boolean recursive,
byte dummyEdgeMode)
A FoldingLayoutStage is used to apply the provided layout algorithm
to the folded graph view.
layouter - The layout algorithm the will be applied to the folded
graph.root - The node that should be considered the virtual local root
for the layout calculation. A different local root than local root that
is currently set for this graph can be used here.recursive - Whether to apply a
recursive layout
calculation to the inner graphs defined by collapsed group nodes.dummyEdgeMode - The
dummy edge mode that
should be used for dummy edges created by the folding layout stage.doLayout(Layouter)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||