|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object y.layout.AbstractLayoutStage com.yworks.yfiles.server.graphml.folding.FoldingLayoutStage
A layout stage that allows to calculate layouts for folded graph structures.
The layout stage will pass a temporary graph structure to the layout algorithm
that corresponds to the view defined by the graph's current
expansion state
,
node view states
, and
edge view states
.
The dummyEdgeMode
property determines how
dummy edges are created for edges whose source and/or target node are not
visible because either the source/target node itself or a parent group node
is collapsed.
The layout stage can be used to calculate layouts for a single view or
recursively
for inner graphs of collapsed
group nodes.
This stage uses its own graph buffering and should not be wrapped in a
BufferedLayouter
.
FoldingSupport
,
FoldedLayoutGraph
Field Summary | |
static byte |
DUMMY_EDGE_MODE_EXCLUDE
A dummy edge mode that prevents the creation of dummy edges. |
static byte |
DUMMY_EDGE_MODE_MERGE
A dummy edge mode that merges multiple dummy edges between the same source and target nodes to a single dummy edge. |
static byte |
DUMMY_EDGE_MODE_SEPARATE
The default dummy edge mode. |
Fields inherited from interface y.layout.Layouter |
EDGE_ID_DPKEY, NODE_ID_DPKEY, SELECTED_EDGES, SELECTED_NODES |
Constructor Summary | |
FoldingLayoutStage()
|
Method Summary | |
protected void |
applyEdgeLabelLayouts(LabelLayoutSetter labelLayoutSetter,
Edge dummyEdge,
YList labels)
|
protected void |
applyEdgeViewState(LayoutGraph graph,
Edge dummyEdge,
EdgeViewState edgeViewState)
|
protected void |
applyLabelLayouts(LayoutGraph graph,
LabelLayoutSetter labelLayoutSetter)
|
protected void |
applyNodeLabelLayouts(LabelLayoutSetter labelLayoutSetter,
Node node,
java.util.List labels)
|
protected void |
applyNodeViewState(LayoutGraph graph,
Node node,
NodeViewState nodeViewState)
|
boolean |
canLayout(LayoutGraph graph)
|
protected void |
commitEdgeLabelLayout(Edge edge,
EdgeLabelLayout dummyLayout,
Label label)
Commit the label layout that has been calculated by the layout algorithm to the dummy edge's label. |
protected void |
commitNodeLabelLayout(Node node,
NodeLabelLayout dummyLayout,
Label label)
Commit the label layout that has been calculated by the layout algorithm to the dummy node's label. |
protected void |
copyEdgeLabel(Label label,
EdgeLabelLayoutImpl layout)
Copy the label layout information of a dummy edge label to a label layout implementation that can be handled by the layout algorithm. |
protected void |
copyNodeLabel(Label label,
NodeLabelLayoutImpl layout)
Copy the label layout information of a dummy node label to a label layout implementation that can be handled by the layout algorithm. |
protected void |
createDummyEdge(LayoutGraph graph,
Edge masterEdge)
|
protected Edge |
createDummyEdgeCore(LayoutGraph graph,
Node sourceRepresentative,
Node targetRepresentative,
DummyEdgeId dummyEdgeId)
|
void |
doLayout(LayoutGraph graph)
Calculates a layout using the graph's current local root .
|
byte |
getDummyEdgeMode()
The strategy that determines how hidden edges are mapped to dummy edges. |
protected void |
handleCollapsedNode(LayoutGraph graph,
Node parentNode)
hide children and edges of a hidden node (also: create dummy edge), hide the node |
boolean |
isRecursive()
Whether the layout should be performed recursively for the inner graphs of collapsed group nodes. |
void |
prepare(LayoutGraph graph,
Node root)
|
void |
restore(LayoutGraph graph)
|
void |
setDummyEdgeMode(byte dummyEdgeMode)
The strategy that determines how hidden edges are mapped to dummy edges. |
void |
setRecursive(boolean recursive)
Whether the layout should be performed recursively for the inner graphs of collapsed group nodes. |
Methods inherited from class y.layout.AbstractLayoutStage |
canLayoutCore, doLayoutCore, getCoreLayouter, setCoreLayouter |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final byte DUMMY_EDGE_MODE_SEPARATE
For each edge whose source and/or target node is not visible because either the source/target node itself or a parent group node is collapsed, a separate dummy edge will be created.
setDummyEdgeMode(byte)
,
Constant Field Valuespublic static final byte DUMMY_EDGE_MODE_MERGE
setDummyEdgeMode(byte)
,
Constant Field Valuespublic static final byte DUMMY_EDGE_MODE_EXCLUDE
setDummyEdgeMode(byte)
,
Constant Field ValuesConstructor Detail |
public FoldingLayoutStage()
Method Detail |
public boolean canLayout(LayoutGraph graph)
public void setRecursive(boolean recursive)
If set to true
, the layout algorithm will be performed
for each inner graph of a collapsed group node that is a descendant of
the passed root node.
public boolean isRecursive()
If set to true
, the layout algorithm will be performed
for each inner graph of a collapsed group node that is a descendant of
the graph's root node
.
A recursive layout will result in valid layout results for all views that result from entering or exiting closed group nodes that are descendants of the local root.
public void setDummyEdgeMode(byte dummyEdgeMode)
In a client-server application, the chosen dummy edge mode should match the dummy edge converter that is used on the client.
Available dummy edge modes:
dummyEdgeMode
- One of the dummy edge mode constants defined in this
class.public byte getDummyEdgeMode()
In a client-server application, the chosen dummy edge mode should match the dummy edge converter that is used on the client.
Available dummy edge modes:
public void doLayout(LayoutGraph graph)
local root
.
Depending on the recursive
property, the layout
will be calculated only for the view defined by the current local root
and the current node expansion state, or the layout will be calculated
recursively by "entering" collapsed descendants of the local root.
protected void applyLabelLayouts(LayoutGraph graph, LabelLayoutSetter labelLayoutSetter)
public void prepare(LayoutGraph graph, Node root)
protected void applyNodeViewState(LayoutGraph graph, Node node, NodeViewState nodeViewState)
protected void applyNodeLabelLayouts(LabelLayoutSetter labelLayoutSetter, Node node, java.util.List labels)
protected void copyNodeLabel(Label label, NodeLabelLayoutImpl layout)
label
- A label of dummy NodeViewState
layout
- A node label layout instance that will be seen by the
layout algorithm.commitNodeLabelLayout(Node, NodeLabelLayout, Label)
protected void copyEdgeLabel(Label label, EdgeLabelLayoutImpl layout)
label
- A label of dummy EdgeViewState
layout
- An edge label layout instance that will be seen by the
layout algorithm.commitEdgeLabelLayout(Edge, EdgeLabelLayout, Label)
protected void handleCollapsedNode(LayoutGraph graph, Node parentNode)
protected void createDummyEdge(LayoutGraph graph, Edge masterEdge)
protected Edge createDummyEdgeCore(LayoutGraph graph, Node sourceRepresentative, Node targetRepresentative, DummyEdgeId dummyEdgeId)
protected void applyEdgeViewState(LayoutGraph graph, Edge dummyEdge, EdgeViewState edgeViewState)
protected void applyEdgeLabelLayouts(LabelLayoutSetter labelLayoutSetter, Edge dummyEdge, YList labels)
protected void commitNodeLabelLayout(Node node, NodeLabelLayout dummyLayout, Label label)
node
- The label's ownerdummyLayout
- The label layout instance that might have been modified
by the layout algorithm.label
- The dummy NodeViewState
's label.copyNodeLabel(Label, NodeLabelLayoutImpl)
protected void commitEdgeLabelLayout(Edge edge, EdgeLabelLayout dummyLayout, Label label)
edge
- The label's ownerdummyLayout
- The label layout instance that might have been modified
by the layout algorithm.label
- The dummy EdgeViewState
's label.copyEdgeLabel(Label, EdgeLabelLayoutImpl)
public void restore(LayoutGraph graph)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |