Package org.jungrapht.visualization.util
Class AnimationLayoutAlgorithm<V>
- java.lang.Object
-
- org.jungrapht.visualization.layout.algorithms.AbstractLayoutAlgorithm<V>
-
- org.jungrapht.visualization.layout.algorithms.AbstractIterativeLayoutAlgorithm<V>
-
- org.jungrapht.visualization.util.AnimationLayoutAlgorithm<V>
-
- All Implemented Interfaces:
IterativeLayoutAlgorithm<V>,LayoutAlgorithm<V>,AfterRunnable,ExecutorConsumer,IterativeContext,Threaded
public class AnimationLayoutAlgorithm<V> extends AbstractIterativeLayoutAlgorithm<V> implements IterativeContext
- Author:
- Tom Nelson
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAnimationLayoutAlgorithm.Builder<V,T extends AnimationLayoutAlgorithm<V>,B extends AnimationLayoutAlgorithm.Builder<V,T,B>>-
Nested classes/interfaces inherited from interface org.jungrapht.visualization.layout.algorithms.LayoutAlgorithm
LayoutAlgorithm.NoOp<V>
-
Nested classes/interfaces inherited from interface org.jungrapht.visualization.layout.algorithms.util.Threaded
Threaded.NoOp
-
-
Field Summary
Fields Modifier and Type Field Description protected Runnableafterprotected intcountprotected intcounterprotected booleandone-
Fields inherited from class org.jungrapht.visualization.layout.algorithms.AbstractIterativeLayoutAlgorithm
afterRunnable, cancelled, executor, preRelaxDurationMs, random, shouldPreRelax, threaded
-
-
Constructor Summary
Constructors Modifier Constructor Description AnimationLayoutAlgorithm()protectedAnimationLayoutAlgorithm(AnimationLayoutAlgorithm.Builder<V,?,?> builder)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <V> AnimationLayoutAlgorithm.Builder<V,?,?>builder()booleandone()voidstep()each step of the animation moves every pouit 1/count of the distance from its old location to its new locationvoidvisit(LayoutModel<V> layoutModel)because the IterativeLayoutAlgorithms use multithreading to continuously update vertex positions, the layoutModel state is saved (during the visit method) so that it can be used continuously-
Methods inherited from class org.jungrapht.visualization.layout.algorithms.AbstractIterativeLayoutAlgorithm
cancel, getExecutor, isThreaded, preRelax, setExecutor, setRandomSeed, setThreaded
-
Methods inherited from class org.jungrapht.visualization.layout.algorithms.AbstractLayoutAlgorithm
computeAverageVertexDimension, computeLayoutExtent, expandToFill, runAfter, setAfter
-
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.util.AfterRunnable
runAfter, setAfter
-
Methods inherited from interface org.jungrapht.visualization.layout.algorithms.LayoutAlgorithm
constrained
-
-
-
-
Field Detail
-
done
protected boolean done
-
count
protected int count
-
counter
protected int counter
-
after
protected Runnable after
-
-
Constructor Detail
-
AnimationLayoutAlgorithm
public AnimationLayoutAlgorithm()
-
AnimationLayoutAlgorithm
protected AnimationLayoutAlgorithm(AnimationLayoutAlgorithm.Builder<V,?,?> builder)
-
-
Method Detail
-
builder
public static <V> AnimationLayoutAlgorithm.Builder<V,?,?> builder()
-
visit
public void visit(LayoutModel<V> layoutModel)
Description copied from class:AbstractIterativeLayoutAlgorithmbecause the IterativeLayoutAlgorithms use multithreading to continuously update vertex positions, the layoutModel state is saved (during the visit method) so that it can be used continuously- Specified by:
visitin interfaceLayoutAlgorithm<V>- Overrides:
visitin classAbstractIterativeLayoutAlgorithm<V>- Parameters:
layoutModel- the mediator between the container for vertices (the Graph) and the mapping from Vertex to Point
-
step
public void step()
each step of the animation moves every pouit 1/count of the distance from its old location to its new location- Specified by:
stepin interfaceIterativeContext
-
done
public boolean done()
- Specified by:
donein interfaceIterativeContext- Returns:
trueif this iterative process is finished, andfalseotherwise.
-
-