y25.layout
Class FlatLayouter

java.lang.Object
  extended byy25.layout.FlatLayouter
All Implemented Interfaces:
Layouter25D

public class FlatLayouter
extends Object
implements Layouter25D

First flattens a LayeredLayoutGraph, then applies a 2D layouter to it, then unflattens it.

The flattening and unflattening of the layered layout graph is done by a layout stage that is stored inside this class. This flattening/unflattening can be customized by the user.

If no flattening/unflattening stage is provided, a canonic flattening stage is used. This stage flattens all layers by combining the nodes and edges that have the same id. The resulting flattened graph has all node and edge id's that occur across all layers of the original layered layout graph. The flattened graph is then passed to the 2D layouter. After it has finished layouting, the unflattening stage simply copies all node and edge layout information to all layers of the original layered layout graph.


Nested Class Summary
protected  class FlatLayouter.CanonicFlatteningStage
          The canonic flatteing/unflattening stage used by FlatLayouter.
 
Field Summary
protected  CompositeLayouter25D layouter
          The composite layouter that does the flatteing, layout, unflattening.
 
Constructor Summary
FlatLayouter(Layouter coreLayouter)
          Creates a FlatLayouter with the canonic flattening/unflattening stage.
FlatLayouter(LayoutStage25D flattener, Layouter coreLayouter)
          Creates a FlatLayouter with a user supplied flattening/unflattening stage.
 
Method Summary
 boolean canLayout(LayeredLayoutGraph llg)
          Returns true, if this Layouter25D is capable of layouting the given graph.
 void doLayout(LayeredLayoutGraph llg)
          Performs the layout on the given graph.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

layouter

protected CompositeLayouter25D layouter
The composite layouter that does the flatteing, layout, unflattening.

Constructor Detail

FlatLayouter

public FlatLayouter(Layouter coreLayouter)
Creates a FlatLayouter with the canonic flattening/unflattening stage.


FlatLayouter

public FlatLayouter(LayoutStage25D flattener,
                    Layouter coreLayouter)
Creates a FlatLayouter with a user supplied flattening/unflattening stage.

Method Detail

canLayout

public boolean canLayout(LayeredLayoutGraph llg)
Description copied from interface: Layouter25D
Returns true, if this Layouter25D is capable of layouting the given graph.

Specified by:
canLayout in interface Layouter25D

doLayout

public void doLayout(LayeredLayoutGraph llg)
Description copied from interface: Layouter25D
Performs the layout on the given graph.

Specified by:
doLayout in interface Layouter25D