Search this API

y.layout
Class BufferedLayouter

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

public class BufferedLayouter
extends AbstractLayoutStage

A hull layouter that invokes another layout algorithm on a copy of its input graph.

After the layout process has finished the calculated layout will be either written back to the original graph or will be provided as a separate graph layout information in terms of the original input graph.

This class also provides the possibility to perform arbitrary layout algorithms merely on a graph interface plus associated graph layout. This comes in handy if an application has its own graph and merely provides an graph interface adapter to the yFiles graph layout machinery.


Field Summary
 
Fields inherited from interface y.layout.Layouter
EDGE_ID_DPKEY, NODE_ID_DPKEY, SELECTED_EDGES, SELECTED_NODES
 
Constructor Summary
BufferedLayouter()
          Instantiates a new BufferedLayouter.
BufferedLayouter(Layouter coreLayouter)
          Instantiates a new BufferedLayouter that wraps the given core layouter.
 
Method Summary
 GraphLayout calcLayout(GraphInterface graph, GraphLayout layout)
          Invokes the core Layouter on a copy of the given graph.
 GraphLayout calcLayout(LayoutGraph layoutGraph)
          Invokes the core Layouter on a copy of the given graph.
 boolean canLayout(LayoutGraph graph)
          Whether or not this layouter can layout the given graph.
 void doLayout(GraphInterface graph, GraphLayout layout)
          Invokes the core Layouter on a copy of the given graph.
 void doLayout(LayoutGraph layoutGraph)
          Invokes the core Layouter on a copy of the given graph.
 
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

BufferedLayouter

public BufferedLayouter()
Instantiates a new BufferedLayouter. No core layouter will be bound this layouter yet.


BufferedLayouter

public BufferedLayouter(Layouter coreLayouter)
Instantiates a new BufferedLayouter that wraps the given core layouter.

Method Detail

calcLayout

public GraphLayout calcLayout(LayoutGraph layoutGraph)
Invokes the core Layouter on a copy of the given graph.

Returns:
the calculated graph layout for the given graph

calcLayout

public GraphLayout calcLayout(GraphInterface graph,
                              GraphLayout layout)
Invokes the core Layouter on a copy of the given graph.

Returns:
the calculated graph layout for the given graph

doLayout

public void doLayout(LayoutGraph layoutGraph)
Invokes the core Layouter on a copy of the given graph. The calculated layout will be written back to the given graph.


doLayout

public void doLayout(GraphInterface graph,
                     GraphLayout layout)
Invokes the core Layouter on a copy of the given graph. The calculated layout will be written back to the given graph.


canLayout

public boolean canLayout(LayoutGraph graph)
Whether or not this layouter can layout the given graph. The result of this method will be provided by the associated core layouter.


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