Search this API

y.layout.grouping
Class ParentEdgeAugmentationStage

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

public class ParentEdgeAugmentationStage
extends AbstractLayoutStage

This class can be used as a decorating stage for layout algorithms that cannot handle hierarchically grouped graphs.

Before calling the core layout algorithm, this stage will augment the graph structure. For each node that belongs to a group, a so-called parent-edge connecting the node with its parent group node will be temporarily inserted into the graph. After the core layout algorithm was executed, these temporary edges will be removed again.

 

Field Summary
 
Fields inherited from interface y.layout.Layouter
EDGE_ID_DPKEY, NODE_ID_DPKEY, NODE_TYPE_DPKEY, SELECTED_EDGES, SELECTED_NODES
 
Constructor Summary
ParentEdgeAugmentationStage()
          Creates a new instance of ParentEdgeAugmentationStage.
 
Method Summary
 boolean canLayout(LayoutGraph graph)
          Accepts all graphs that are accepted by the core layout algorithm after the insertion of the parent-edges.
 void doLayout(LayoutGraph graph)
          Calculates the layout based on the specified 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

ParentEdgeAugmentationStage

public ParentEdgeAugmentationStage()
Creates a new instance of ParentEdgeAugmentationStage.

Method Detail

canLayout

public boolean canLayout(LayoutGraph graph)
Accepts all graphs that are accepted by the core layout algorithm after the insertion of the parent-edges.

Parameters:
graph - the input graph
Returns:
true if the core layout algorithm accepts the augmented graph or is null, false otherwise.
See Also:
Layouter.doLayout(LayoutGraph)

doLayout

public void doLayout(LayoutGraph graph)
Calculates the layout based on the specified core layout algorithm.

Before calling the core layout algorithm, the graph will be augmented with the parent-edges.

 
The given graph will not be copied during the layout process and the layout will be immediately applied to the given graph.
Parameters:
graph - the input graph
See Also:
Layouter.canLayout(LayoutGraph)

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