Class AbstractLayoutAlgorithm<V>
- java.lang.Object
-
- org.jungrapht.visualization.layout.algorithms.AbstractLayoutAlgorithm<V>
-
- All Implemented Interfaces:
LayoutAlgorithm<V>,AfterRunnable
- Direct Known Subclasses:
AbstractIterativeLayoutAlgorithm,AbstractTreeLayoutAlgorithm
public abstract class AbstractLayoutAlgorithm<V> extends Object implements LayoutAlgorithm<V>
For Layout algorithms that can run an 'after' function- Author:
- Tom Nelson
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAbstractLayoutAlgorithm.Builder<V,T extends AbstractLayoutAlgorithm<V>,B extends AbstractLayoutAlgorithm.Builder<V,T,B>>-
Nested classes/interfaces inherited from interface org.jungrapht.visualization.layout.algorithms.LayoutAlgorithm
LayoutAlgorithm.NoOp<V>
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractLayoutAlgorithm(AbstractLayoutAlgorithm.Builder builder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected <E> DimensioncomputeAverageVertexDimension(org.jgrapht.Graph<V,E> graph, Function<V,Rectangle> shapeFunction)protected RectanglecomputeLayoutExtent(LayoutModel<V> layoutModel)Compute the smallest Rectangle in the layout area containing verticesprotected voidexpandToFill(LayoutModel<V> layoutModel, Rectangle occupiedRegion)voidrunAfter()voidsetAfter(Runnable after)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jungrapht.visualization.layout.algorithms.LayoutAlgorithm
cancel, constrained, visit
-
-
-
-
Field Detail
-
after
protected Runnable after
-
-
Constructor Detail
-
AbstractLayoutAlgorithm
protected AbstractLayoutAlgorithm(AbstractLayoutAlgorithm.Builder builder)
-
-
Method Detail
-
setAfter
public void setAfter(Runnable after)
- Specified by:
setAfterin interfaceAfterRunnable
-
runAfter
public void runAfter()
- Specified by:
runAfterin interfaceAfterRunnable
-
computeAverageVertexDimension
protected <E> Dimension computeAverageVertexDimension(org.jgrapht.Graph<V,E> graph, Function<V,Rectangle> shapeFunction)
-
computeLayoutExtent
protected Rectangle computeLayoutExtent(LayoutModel<V> layoutModel)
Compute the smallest Rectangle in the layout area containing vertices- Parameters:
layoutModel-- Returns:
-
expandToFill
protected void expandToFill(LayoutModel<V> layoutModel, Rectangle occupiedRegion)
- Parameters:
layoutModel-occupiedRegion-
-
-