|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object y.layout.AbstractLayoutStage y.layout.grouping.FixedGroupLayoutStage
public class FixedGroupLayoutStage
A layout stage
that can handle fixed nodes in hierarchically grouped graphs.
This stage guarantees that a core layout algorithm
will maintain
the relative positions of nodes within the same group.
Also, this stage is responsible for routing edges that connect nodes belonging to hierarchically unrelated groups.
More precisely, the stage temporarily replaces fixed group nodes (see FIXED_GROUP_NODES_DPKEY
) with normal
nodes of the same size while the content of the groups is removed from the graph during layout.
The nodes are used as placeholders and are responsible for keeping the relations to the remaining graph elements. Edges that originate from the outside of the group node and terminate in its interior (inter-edges) are redirected such that they connect to the node that replaces the group.
After the layout process, the group nodes are restored and the
stage inserts the content at the new group position (derived from the position of the associated node). The content
itself (including the edges between content nodes) remains unchanged and is only relocated. Furthermore,
the inter-edges are connected to their original source/target and the stage reroutes them using the
specified inter-edge routing algorithm (see setOrthogonalEdgeRouter(Layouter)
).
FixedGroupLayoutStage
with OrthogonalGroupLayouter
. Nodes inside groups did not change relative positions.
Field Summary | |
---|---|
static java.lang.Object |
FIXED_GROUP_NODES_DPKEY
A DataProvider key for selecting group nodes whose contents should keep their relative positions.
|
static java.lang.Object |
INTER_EDGES_DPKEY
A DataProvider key for marking edges as inter-edges.
|
static byte |
ROUTING_STYLE_ADOPT
An inter-edge routing style based on which the edge layout of inter-edges will be adopted from the core layout algorithm . |
static byte |
ROUTING_STYLE_ORTHOGONAL
An inter-edge routing style based on which inter-edges are routed in an orthogonal style. |
static byte |
ROUTING_STYLE_STRAIGHTLINE
An inter-edge routing style based on which inter-edges are routed as straight lines. |
Fields inherited from interface y.layout.Layouter |
---|
EDGE_ID_DPKEY, NODE_ID_DPKEY, NODE_TYPE_DPKEY, SELECTED_EDGES, SELECTED_NODES |
Constructor Summary | |
---|---|
FixedGroupLayoutStage()
Creates a new instance of FixedGroupLayoutStage . |
|
FixedGroupLayoutStage(Layouter core)
Creates a new instance of FixedGroupLayoutStage with the given algorithm as
core layout algorithm . |
Method Summary | |
---|---|
boolean |
canLayout(LayoutGraph graph)
Accepts all graphs that are accepted by the specified core layout algorithm . |
void |
doLayout(LayoutGraph graph)
Calculates the layout for the given graph, that is, prepares the graph by hiding the content of fixed group nodes for the core layout algorithm , executes it and, finally, restores the graph and
routes inter-edges. |
byte |
getInterEdgeRoutingStyle()
Returns the inter-edge routing style used by this layout stage. |
Layouter |
getOrthogonalEdgeRouter()
Returns the edge routing algorithm that is applied to route the inter-edges. |
void |
setInterEdgeRoutingStyle(byte routingStyle)
Specifies the inter-edge routing style used by this layout stage. |
void |
setOrthogonalEdgeRouter(Layouter edgeRouter)
Specifies the edge routing algorithm that is applied to route the inter-edges. |
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 java.lang.Object FIXED_GROUP_NODES_DPKEY
DataProvider
key for selecting group nodes whose contents should keep their relative positions.
A group node is considered selected in this context, if the corresponding DataProvider
returns true
for the group node or any of its ancestor (group) nodes.
DataProvider
registered with this key, all group nodes are considered to be selected.public static final java.lang.Object INTER_EDGES_DPKEY
DataProvider
key for marking edges as inter-edges.
The inter-edges will automatically be marked by this stage during the post-processing step.
public static final byte ROUTING_STYLE_ADOPT
core layout algorithm
.
public static final byte ROUTING_STYLE_ORTHOGONAL
public static final byte ROUTING_STYLE_STRAIGHTLINE
Constructor Detail |
---|
public FixedGroupLayoutStage()
FixedGroupLayoutStage
.
public FixedGroupLayoutStage(Layouter core)
FixedGroupLayoutStage
with the given algorithm as
core layout algorithm
.
core
- the core layout algorithm used by this stageMethod Detail |
---|
public void setInterEdgeRoutingStyle(byte routingStyle)
ROUTING_STYLE_ADOPT
. Inter-edge routes will be adopted from the core layout algorithm.routingStyle
- one of the predefined routing styles for inter-edges
java.lang.IllegalArgumentException
- if the given routing style is unknownpublic byte getInterEdgeRoutingStyle()
setInterEdgeRoutingStyle(byte)
public void setOrthogonalEdgeRouter(Layouter edgeRouter)
If no routing algorithm is set, a new instance of CompositeLayouter
associated
with a GroupNodeHider
and an EdgeRouter
will be used.
CompositeLayouter
. A CompositeLayouter
associated with a GroupNodeHider
and an
EdgeRouter
.edgeRouter
- the edge routing algorithm for inter-edgespublic Layouter getOrthogonalEdgeRouter()
If no routing algorithm is set, a new instance of CompositeLayouter
associated
with a GroupNodeHider
and an EdgeRouter
will be used.
setOrthogonalEdgeRouter(Layouter)
public boolean canLayout(LayoutGraph graph)
core layout algorithm
.
graph
- the input graph
true
if the core layout algorithm
accepts this
graph or is null
, false
otherwiseLayouter.doLayout(LayoutGraph)
public void doLayout(LayoutGraph graph)
core layout algorithm
, executes it and, finally, restores the graph and
routes inter-edges.
graph
- the input graphLayouter.canLayout(LayoutGraph)
|
© Copyright 2000-2022, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |