Class GEMLayoutAlgorithm<V,E>
- java.lang.Object
-
- org.jungrapht.visualization.layout.algorithms.AbstractLayoutAlgorithm<V>
-
- org.jungrapht.visualization.layout.algorithms.AbstractIterativeLayoutAlgorithm<V>
-
- org.jungrapht.visualization.layout.algorithms.GEMLayoutAlgorithm<V,E>
-
- All Implemented Interfaces:
IterativeLayoutAlgorithm<V>,LayoutAlgorithm<V>,AfterRunnable,ExecutorConsumer,IterativeContext,Threaded
public class GEMLayoutAlgorithm<V,E> extends AbstractIterativeLayoutAlgorithm<V> implements IterativeContext
Java implementation of the gem 2D layout.
The algorithm needs to get various subgraphs and traversals. The recursive nature of the algorithm is totally captured within those subgraphs and traversals. The main loop of the algorithm is then expressed using the iterator feature, which makes it look like a simple flat iteration over nodes.- Author:
- David Duke, Hacked by Eytan Adar for Guess, Hacked by taubertj for OVTK2, Hacked by Tom Nelson
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classGEMLayoutAlgorithm.Builder<V,E,T extends GEMLayoutAlgorithm<V,E>,B extends GEMLayoutAlgorithm.Builder<V,E,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 booleanadjustToFitinthorizontalSpacingprotected intmaxIterationsintmultiintverticalSpacing-
Fields inherited from class org.jungrapht.visualization.layout.algorithms.AbstractIterativeLayoutAlgorithm
afterRunnable, executor, layoutModel, preRelaxDurationMs, random, shouldPreRelax, threaded
-
Fields inherited from class org.jungrapht.visualization.layout.algorithms.AbstractLayoutAlgorithm
after
-
-
Constructor Summary
Constructors Modifier Constructor Description GEMLayoutAlgorithm()protectedGEMLayoutAlgorithm(GEMLayoutAlgorithm.Builder<V,E,?,?> builder)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<org.jgrapht.Graph<V,E>>clusterGraph(org.jgrapht.Graph<V,E> original)Clusters given graph into subgraphs.booleandone()static <V,E>
GEMLayoutAlgorithm.Builder<V,E,?,?>edgeAwareBuilder()voidinitialize()Runs the layout.voidrunClustered(Set<org.jgrapht.Graph<V,E>> subgraphs)Layout subgraphs on separate places.voidstep()Advances one step.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, 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
-
-
-
-
Constructor Detail
-
GEMLayoutAlgorithm
public GEMLayoutAlgorithm()
-
GEMLayoutAlgorithm
protected GEMLayoutAlgorithm(GEMLayoutAlgorithm.Builder<V,E,?,?> builder)
-
-
Method Detail
-
edgeAwareBuilder
public static <V,E> GEMLayoutAlgorithm.Builder<V,E,?,?> edgeAwareBuilder()
-
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()
Description copied from interface:IterativeContextAdvances one step.- Specified by:
stepin interfaceIterativeContext
-
done
public boolean done()
- Specified by:
donein interfaceIterativeContext- Returns:
trueif this iterative process is finished, andfalseotherwise.
-
clusterGraph
public Set<org.jgrapht.Graph<V,E>> clusterGraph(org.jgrapht.Graph<V,E> original)
Clusters given graph into subgraphs.
-
initialize
public void initialize()
Runs the layout.
-
-