Class ForceAtlas2LayoutAlgorithm<V>
- java.lang.Object
-
- org.jungrapht.visualization.layout.algorithms.AbstractLayoutAlgorithm<V>
-
- org.jungrapht.visualization.layout.algorithms.AbstractIterativeLayoutAlgorithm<V>
-
- org.jungrapht.visualization.layout.algorithms.ForceAtlas2LayoutAlgorithm<V>
-
- Type Parameters:
V-
- All Implemented Interfaces:
Consumer<Function<V,Rectangle>>,IterativeLayoutAlgorithm<V>,LayoutAlgorithm<V>,AfterRunnable,ExecutorConsumer,IterativeContext,Threaded,VertexBoundsFunctionConsumer<V>
public class ForceAtlas2LayoutAlgorithm<V> extends AbstractIterativeLayoutAlgorithm<V> implements VertexBoundsFunctionConsumer<V>, IterativeContext
Implementation of ForceAtlas2 algorithm.- See Also:
- "ForceAtlas2, a Continuous Graph Layout Algorithm for Handy Network Visualization Designed for the Gephi Software", "https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0098679"
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classForceAtlas2LayoutAlgorithm.Builder<V,T extends ForceAtlas2LayoutAlgorithm<V>,B extends ForceAtlas2LayoutAlgorithm.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 inherited from class org.jungrapht.visualization.layout.algorithms.AbstractIterativeLayoutAlgorithm
afterRunnable, cancelled, executor, layoutModel, preRelaxDurationMs, random, shouldPreRelax, threaded
-
Fields inherited from class org.jungrapht.visualization.layout.algorithms.AbstractLayoutAlgorithm
after
-
-
Constructor Summary
Constructors Modifier Constructor Description ForceAtlas2LayoutAlgorithm()protectedForceAtlas2LayoutAlgorithm(ForceAtlas2LayoutAlgorithm.Builder<V,?,?> builder)Create instance with the configured builder.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <V> ForceAtlas2LayoutAlgorithm.Builder<V,?,?>builder()booleandone()voidsetVertexBoundsFunction(Function<V,Rectangle> vertexBoundsFunction)voidstep()Advances one step.StringtoString()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.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, 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
-
Methods inherited from interface org.jungrapht.visualization.layout.algorithms.util.VertexBoundsFunctionConsumer
accept
-
-
-
-
Constructor Detail
-
ForceAtlas2LayoutAlgorithm
public ForceAtlas2LayoutAlgorithm()
-
ForceAtlas2LayoutAlgorithm
protected ForceAtlas2LayoutAlgorithm(ForceAtlas2LayoutAlgorithm.Builder<V,?,?> builder)
Create instance with the configured builder. Note that layoutModel is null until the visit method is called.- Parameters:
builder-
-
-
Method Detail
-
builder
public static <V> ForceAtlas2LayoutAlgorithm.Builder<V,?,?> builder()
-
setVertexBoundsFunction
public void setVertexBoundsFunction(Function<V,Rectangle> vertexBoundsFunction)
- Specified by:
setVertexBoundsFunctionin interfaceVertexBoundsFunctionConsumer<V>
-
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
-
done
public boolean done()
- Specified by:
donein interfaceIterativeContext- Returns:
trueif this iterative process is finished, andfalseotherwise.
-
step
public void step()
Description copied from interface:IterativeContextAdvances one step.- Specified by:
stepin interfaceIterativeContext
-
-