Class AbstractIterativeLayoutAlgorithm<V>
- java.lang.Object
 - 
- org.jungrapht.visualization.layout.algorithms.AbstractLayoutAlgorithm<V>
 - 
- org.jungrapht.visualization.layout.algorithms.AbstractIterativeLayoutAlgorithm<V>
 
 
 
- 
- All Implemented Interfaces:
 IterativeLayoutAlgorithm<V>,LayoutAlgorithm<V>,AfterRunnable,ExecutorConsumer,IterativeContext,Threaded
- Direct Known Subclasses:
 AnimationLayoutAlgorithm,ForceAtlas2LayoutAlgorithm,FRLayoutAlgorithm,GEMLayoutAlgorithm,ISOMLayoutAlgorithm,KKLayoutAlgorithm,SpringLayoutAlgorithm
public abstract class AbstractIterativeLayoutAlgorithm<V> extends AbstractLayoutAlgorithm<V> implements IterativeLayoutAlgorithm<V>, AfterRunnable, Threaded
For Iterative algorithms that perform delayed operations on a Thread, save off the layoutModel so that it can be accessed by the threaded code. The layoutModel could be removed and instead passed via all of the iterative methods (for example step(layoutModel) instead of step() )- Author:
 - Tom Nelson
 
 
- 
- 
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAbstractIterativeLayoutAlgorithm.Builder<V,T extends AbstractIterativeLayoutAlgorithm<V>,B extends AbstractIterativeLayoutAlgorithm.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 RunnableafterRunnableprotected booleancancelledprotected Executorexecutorprotected LayoutModel<V>layoutModelbecause the IterativeLayoutAlgorithms use multithreading to continuously update vertex positions, the layoutModel state is saved (during the visit method) so that it can be used continuouslyprotected intpreRelaxDurationMsprotected Randomrandomprotected booleanshouldPreRelaxprotected booleanthreaded- 
Fields inherited from class org.jungrapht.visualization.layout.algorithms.AbstractLayoutAlgorithm
after 
 - 
 
- 
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractIterativeLayoutAlgorithm(AbstractIterativeLayoutAlgorithm.Builder builder) 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcancel()ExecutorgetExecutor()booleanisThreaded()booleanpreRelax()may be a no-op depending on how the algorithm instance is createdvoidsetExecutor(Executor executor)voidsetRandomSeed(long randomSeed)voidsetThreaded(boolean threaded)voidvisit(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.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.util.IterativeContext
done, step 
- 
Methods inherited from interface org.jungrapht.visualization.layout.algorithms.LayoutAlgorithm
constrained 
 - 
 
 - 
 
- 
- 
Field Detail
- 
layoutModel
protected 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 
- 
executor
protected Executor executor
 
- 
shouldPreRelax
protected boolean shouldPreRelax
 
- 
preRelaxDurationMs
protected int preRelaxDurationMs
 
- 
random
protected Random random
 
- 
afterRunnable
protected Runnable afterRunnable
 
- 
threaded
protected boolean threaded
 
- 
cancelled
protected boolean cancelled
 
 - 
 
- 
Constructor Detail
- 
AbstractIterativeLayoutAlgorithm
protected AbstractIterativeLayoutAlgorithm(AbstractIterativeLayoutAlgorithm.Builder builder)
 
 - 
 
- 
Method Detail
- 
setRandomSeed
public void setRandomSeed(long randomSeed)
 
- 
preRelax
public final boolean preRelax()
Description copied from interface:IterativeLayoutAlgorithmmay be a no-op depending on how the algorithm instance is created- Specified by:
 preRelaxin interfaceIterativeLayoutAlgorithm<V>- Returns:
 - true if a prerelax was done, false otherwise
 
 
- 
setExecutor
public void setExecutor(Executor executor)
- Specified by:
 setExecutorin interfaceExecutorConsumer
 
- 
getExecutor
public Executor getExecutor()
- Specified by:
 getExecutorin interfaceExecutorConsumer
 
- 
visit
public void visit(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- Specified by:
 visitin interfaceLayoutAlgorithm<V>- Parameters:
 layoutModel- the mediator between the container for vertices (the Graph) and the mapping from Vertex to Point
 
- 
isThreaded
public boolean isThreaded()
- Specified by:
 isThreadedin interfaceThreaded
 
- 
setThreaded
public void setThreaded(boolean threaded)
- Specified by:
 setThreadedin interfaceThreaded
 
- 
cancel
public void cancel()
- Specified by:
 cancelin interfaceLayoutAlgorithm<V>- Specified by:
 cancelin interfaceThreaded
 
 - 
 
 -