Search this API

y.layout.organic
Class GroupedShuffleLayouter

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

public class GroupedShuffleLayouter
extends AbstractLayoutStage

This algorithm recursively removes node overlaps from a graph with a hierarchic group structure.

Basically, this algorithm combines a RecursiveGroupLayouter with a specific customizable shuffle algorithm as its core layout algorithm. The shuffle algorithm will be recursively applied to all groups of the input graph to remove node overlaps.


Input graph (left) and result (right) after executing this algorithm with default settings

Since this algorithm is a LayoutStage, a core layout algorithm can be specified. In consequence, this algorithm will perform its work after the core algorithm was executed.

See Also:
ShuffleLayouter, RecursiveGroupLayouter
 

Field Summary
 
Fields inherited from interface y.layout.Layouter
EDGE_ID_DPKEY, NODE_ID_DPKEY, NODE_TYPE_DPKEY, SELECTED_EDGES, SELECTED_NODES
 
Constructor Summary
GroupedShuffleLayouter()
          Creates a new GroupedShuffleLayouter instance with default settings.
GroupedShuffleLayouter(Layouter core)
          Creates a new GroupedShuffleLayouter instance using the given core layout algorithm.
 
Method Summary
 boolean canLayout(LayoutGraph graph)
          Accepts all graphs that the specified core layout algorithm accepts.
 void doLayout(LayoutGraph graph)
          Removes all node overlaps in the given graph, after executing the specified core layout algorithm.
 GroupBoundsCalculator getGroupBoundsCalculator()
          Returns the GroupBoundsCalculator instance that computes the sizes of all group nodes.
 Layouter getShuffleLayouter()
          Returns the Layouter instance that is used for removing node overlaps.
 void setGroupBoundsCalculator(GroupBoundsCalculator groupBoundsCalculator)
          Specifies the GroupBoundsCalculator instance that computes the sizes of all group nodes.
 void setShuffleLayouter(Layouter shuffleLayouter)
          Specifies the Layouter instance that is used for removing node overlaps.
 
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

GroupedShuffleLayouter

public GroupedShuffleLayouter()
Creates a new GroupedShuffleLayouter instance with default settings.


GroupedShuffleLayouter

public GroupedShuffleLayouter(Layouter core)
Creates a new GroupedShuffleLayouter instance using the given core layout algorithm.

Parameters:
core - the core layout algorithm
Method Detail

canLayout

public boolean canLayout(LayoutGraph graph)
Accepts all graphs that the specified core layout algorithm accepts.

Furthermore, the current shuffle layout algorithm is not allowed to be null.

Parameters:
graph - the input graph
Returns:
true if the core layouter accepts the given graph and the shuffle layout algorithm is not null, false otherwise
See Also:
Layouter.doLayout(LayoutGraph)

doLayout

public void doLayout(LayoutGraph graph)
Removes all node overlaps in the given graph, after executing the specified core layout algorithm.

Parameters:
graph - the input graph
See Also:
Layouter.canLayout(LayoutGraph)

getGroupBoundsCalculator

public GroupBoundsCalculator getGroupBoundsCalculator()
Returns the GroupBoundsCalculator instance that computes the sizes of all group nodes.

Returns:
the current GroupBoundsCalculator instance
See Also:
setGroupBoundsCalculator(GroupBoundsCalculator)

setGroupBoundsCalculator

public void setGroupBoundsCalculator(GroupBoundsCalculator groupBoundsCalculator)
Specifies the GroupBoundsCalculator instance that computes the sizes of all group nodes.

Default Value:
The default value is MinimumSizeGroupBoundsCalculator
Parameters:
groupBoundsCalculator - the GroupBoundsCalculator instance that should be used

getShuffleLayouter

public Layouter getShuffleLayouter()
Returns the Layouter instance that is used for removing node overlaps.

This instance will be applied recursively to all group nodes of the graph.

Default Value:
The default value is ShuffleLayouter
Returns:
the Layouter instance for removing node overlaps
See Also:
setShuffleLayouter(Layouter)

setShuffleLayouter

public void setShuffleLayouter(Layouter shuffleLayouter)
Specifies the Layouter instance that is used for removing node overlaps.

This instance will be applied recursively to all group nodes of the graph.

Parameters:
shuffleLayouter - the Layouter instance for removing node overlaps

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