public class BufferedLayout extends AbstractLayoutStage
BufferedLayout
is a hull algorithm that invokes its core layout algorithm
on a copy of the input graph.
After the layout process has finished, the calculated layout will be written back to the original 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 only provides a graph interface adapter to the yFiles graph layout machinery.
Constructor and Description |
---|
BufferedLayout()
Creates a new
BufferedLayout instance using the given
core layout algorithm . |
BufferedLayout(ILayoutAlgorithm coreLayouter)
Creates a new
BufferedLayout instance using the given
core layout algorithm . |
Modifier and Type | Method and Description |
---|---|
void |
applyLayout(LayoutGraph graph)
Applies the layout calculated by the
core layout algorithm to the input
graph. |
applyLayoutCore, getCoreLayout, setCoreLayout
public BufferedLayout()
BufferedLayout
instance using the given
core layout algorithm
.public BufferedLayout(ILayoutAlgorithm coreLayouter)
BufferedLayout
instance using the given
core layout algorithm
.coreLayouter
- the core layout routinepublic void applyLayout(LayoutGraph graph)
core layout algorithm
to the input
graph.
The layout calculation is invoked on a copy of the given graph. Then, the calculated layout will be written back to the given graph.
applyLayout
in interface ILayoutAlgorithm
applyLayout
in class AbstractLayoutStage
graph
- the input graph