public final class LayoutUtilities extends Object
IGraph
.LayoutGraphAdapter
,
LayoutExecutor
,
ILayoutAlgorithm
Modifier and Type | Method and Description |
---|---|
static void |
applyLayout(IGraph graph,
ILayoutAlgorithm layout)
Convenience method that runs a layout on a graph using
LayoutGraphAdapter.applyLayout(IGraph, ILayoutAlgorithm, LayoutData) . |
static void |
applyLayout(IGraph graph,
ILayoutAlgorithm layout,
LayoutData layoutData)
Convenience method that runs a layout on a graph using
LayoutGraphAdapter.applyLayout(IGraph, ILayoutAlgorithm, LayoutData) . |
static ILayerConstraintFactory |
createLayerConstraintFactory(HierarchicLayout layout,
IGraph graph)
Creates and registers an incremental layer constraint factory for an
IGraph . |
static IAnimation |
createLayoutAnimation(IGraph graph,
CopiedLayoutGraph layoutGraph,
Duration preferredDuration)
Creates a new
IAnimation instance that animates the current graph to the layout given by a CopiedLayoutGraph
instance. |
static ISequenceConstraintFactory |
createSequenceConstraintFactory(HierarchicLayout layout,
IGraph graph)
Creates and registers a sequencer constraint factory for an
IGraph . |
static void |
morphLayout(GraphControl graphControl,
ILayoutAlgorithm layout,
Duration morphDuration)
Convenience method that runs a layout on the graph of a given graph control, animates the transition, and calls the
given
doneHandler once the animation has finished. |
static void |
morphLayout(GraphControl graphControl,
ILayoutAlgorithm layout,
Duration morphDuration,
IEventHandler<LayoutEventArgs> doneHandler)
Convenience method that runs a layout on the graph of a given graph control, animates the transition, and calls the
given
doneHandler once the animation has finished. |
static void |
morphLayout(GraphControl control,
ILayoutAlgorithm layout,
Duration morphDuration,
LayoutData layoutData)
Convenience method that runs a layout on the graph of a given graph control, animates the transition, and calls the
given
doneHandler once the animation has finished. |
static void |
morphLayout(GraphControl control,
ILayoutAlgorithm layout,
Duration morphDuration,
LayoutData layoutData,
IEventHandler<LayoutEventArgs> doneHandler)
Convenience method that runs a layout on the graph of a given graph control, animates the transition, and calls the
given
doneHandler once the animation has finished. |
public static final void applyLayout(IGraph graph, ILayoutAlgorithm layout)
LayoutGraphAdapter.applyLayout(IGraph, ILayoutAlgorithm, LayoutData)
.graph
- The graph.layout
- The layout.IGraph.applyLayout(ILayoutAlgorithm, LayoutData)
,
GraphControl.morphLayout(ILayoutAlgorithm, Duration, IEventHandler)
,
GraphControl.morphLayout(ILayoutAlgorithm, Duration, LayoutData, IEventHandler)
public static final void applyLayout(IGraph graph, ILayoutAlgorithm layout, LayoutData layoutData)
LayoutGraphAdapter.applyLayout(IGraph, ILayoutAlgorithm, LayoutData)
.graph
- The graph.layout
- The layout.layoutData
- The layout data.IGraph.applyLayout(ILayoutAlgorithm, LayoutData)
,
GraphControl.morphLayout(ILayoutAlgorithm, Duration, IEventHandler)
,
GraphControl.morphLayout(ILayoutAlgorithm, Duration, LayoutData, IEventHandler)
public static final ILayerConstraintFactory createLayerConstraintFactory(HierarchicLayout layout, IGraph graph)
IGraph
.layout
- The IHL instance where the factory is created. This is a this
parameter, so that the method can be used as an
extension method.graph
- The graph for which the factory is createdpublic static final IAnimation createLayoutAnimation(IGraph graph, CopiedLayoutGraph layoutGraph, Duration preferredDuration)
IAnimation
instance that animates the current graph to the layout given by a CopiedLayoutGraph
instance.
The returned instance is suitable for morphing an IGraph
to a layout computed by one of the layout algorithms.
While it is usually recommended to use LayoutExecutor
to handle layout calculation and subsequent animation, the
IAnimation
produced by this method can be used manually, as well:
graph
- the graph for which the layout should be animatedlayoutGraph
- the CopiedLayoutGraph
that contains all target layout informationpreferredDuration
- the preferred duration of the animationpublic static final ISequenceConstraintFactory createSequenceConstraintFactory(HierarchicLayout layout, IGraph graph)
IGraph
.layout
- The IHL instance where the factory is created. This is a this
parameter, so that the method can be used as an
extension method.graph
- The graph.public static final void morphLayout(GraphControl graphControl, ILayoutAlgorithm layout, Duration morphDuration)
doneHandler
once the animation has finished.
The implementation simply delegates to a properly configured instance of LayoutExecutor
. In addition to the
default configuration, it enables ViewportAnimationEnabled
,
EasedAnimationEnabled
, and
ContentRectUpdatingEnabled
. For more fine-grained control of
the animation, use LayoutExecutor
directly.
graphControl
- The graph control.layout
- The layout to run.morphDuration
- The duration of the animation of the layout.GraphControl.morphLayout(ILayoutAlgorithm, Duration, LayoutData, IEventHandler)
,
IGraph.applyLayout(ILayoutAlgorithm, LayoutData)
public static final void morphLayout(GraphControl graphControl, ILayoutAlgorithm layout, Duration morphDuration, IEventHandler<LayoutEventArgs> doneHandler)
doneHandler
once the animation has finished.
The implementation simply delegates to a properly configured instance of LayoutExecutor
. In addition to the
default configuration, it enables ViewportAnimationEnabled
,
EasedAnimationEnabled
, and
ContentRectUpdatingEnabled
. For more fine-grained control of
the animation, use LayoutExecutor
directly.
graphControl
- The graph control.layout
- The layout to run.morphDuration
- The duration of the animation of the layout.doneHandler
- The handler that is called after the animation has finished. See
LayoutFinished
.GraphControl.morphLayout(ILayoutAlgorithm, Duration, LayoutData, IEventHandler)
,
IGraph.applyLayout(ILayoutAlgorithm, LayoutData)
public static final void morphLayout(GraphControl control, ILayoutAlgorithm layout, Duration morphDuration, LayoutData layoutData)
doneHandler
once the animation has finished.
The implementation simply delegates to a properly configured instance of LayoutExecutor
. In addition to the
default configuration, it enables ViewportAnimationEnabled
,
EasedAnimationEnabled
, and
ContentRectUpdatingEnabled
. For more fine-grained control of
the animation, use LayoutExecutor
directly.
control
- The graph control.layout
- The layout to run.morphDuration
- The duration of the animation of the layout.layoutData
- The layout data to apply.GraphControl.morphLayout(ILayoutAlgorithm, Duration, IEventHandler)
,
IGraph.applyLayout(ILayoutAlgorithm, LayoutData)
public static final void morphLayout(GraphControl control, ILayoutAlgorithm layout, Duration morphDuration, LayoutData layoutData, IEventHandler<LayoutEventArgs> doneHandler)
doneHandler
once the animation has finished.
The implementation simply delegates to a properly configured instance of LayoutExecutor
. In addition to the
default configuration, it enables ViewportAnimationEnabled
,
EasedAnimationEnabled
, and
ContentRectUpdatingEnabled
. For more fine-grained control of
the animation, use LayoutExecutor
directly.
control
- The graph control.layout
- The layout to run.morphDuration
- The duration of the animation of the layout.layoutData
- The layout data to apply.doneHandler
- The handler that is called after the animation has finished. See
LayoutFinished
.GraphControl.morphLayout(ILayoutAlgorithm, Duration, IEventHandler)
,
IGraph.applyLayout(ILayoutAlgorithm, LayoutData)