Search this API

y.layout.router
Class GroupNodeRouterStage

java.lang.Object
  extended by y.layout.AbstractLayoutStage
      extended by y.layout.router.GroupNodeRouterStage
All Implemented Interfaces:
Layouter, LayoutStage

public class GroupNodeRouterStage
extends AbstractLayoutStage

GroupNodeRouterStage adds support for hierarchically grouped graphs to OrthogonalEdgeRouter.

Concept

Group nodes as well as normal nodes are considered as obstacles for OrthogonalEdgeRouter. Thus, they have to be avoided during the routing of edges which is counterproductive if one endpoint of an edge is contained in a group node.

To avoid such difficulties, this stage temporarily removes group nodes and inserts some placeholders instead. Thus, the obstacles are not present for the core layout algorithm but the information about the bounds of the group nodes is maintained. Also, edges can connect to group nodes. After invoking the core layout algorithm, the group nodes are reinserted.

Hierarchically grouped graph

 
GroupNodeRouterStage will not have an effect with edge routing algorithms other than OrthogonalEdgeRouter.
See Also:
OrthogonalEdgeRouter, Grouping, GroupingKeys
 

Field Summary
 
Fields inherited from interface y.layout.Layouter
EDGE_ID_DPKEY, NODE_ID_DPKEY, SELECTED_EDGES, SELECTED_NODES
 
Constructor Summary
GroupNodeRouterStage()
          Creates a new instance of GroupNodeRouterStage.
GroupNodeRouterStage(Layouter coreLayouter)
          Creates a new instance of GroupNodeRouterStage using the given core layout algorithm.
 
Method Summary
 boolean canLayout(LayoutGraph graph)
          Accepts all graphs that are accepted by the core layout algorithm.
 void doLayout(LayoutGraph graph)
          Handles hierarchically grouped graphs for the core layout algorithm.
 
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
 

Constructor Detail

GroupNodeRouterStage

public GroupNodeRouterStage()
Creates a new instance of GroupNodeRouterStage.

 
GroupNodeRouterStage will not have an effect with edge routing algorithms other than OrthogonalEdgeRouter. An according core layout algorithm must be set.

GroupNodeRouterStage

public GroupNodeRouterStage(Layouter coreLayouter)
Creates a new instance of GroupNodeRouterStage using the given core layout algorithm.

 
GroupNodeRouterStage provides an optimization step for OrthogonalEdgeRouter and will not work with other edge routing algorithms.
Parameters:
coreLayouter - the core layout algorithm
Method Detail

canLayout

public boolean canLayout(LayoutGraph graph)
Accepts all graphs that are accepted by the core layout algorithm.

Parameters:
graph - the input graph
Returns:
true if the core layout algorithm can handle the given graph, false otherwise
See Also:
Layouter.doLayout(LayoutGraph)

doLayout

public void doLayout(LayoutGraph graph)
Handles hierarchically grouped graphs for the core layout algorithm.

Precondition:
The core layout algorithm must be an instance of OrthogonalEdgeRouter or at least must have such an instance in its layout pipeline.
Parameters:
graph - the input graph
See Also:
Layouter.canLayout(LayoutGraph)

© Copyright 2000-2016,
yWorks GmbH.
All rights reserved.