public class FRLayout2<V,E> extends AbstractLayout<V,E> implements IterativeContext
FRLayout
; if it is successful
it will be folded back into FRLayout
(and this class will disappear).
Behavior is determined by the following settable parameters:
graph, initialized, locations, size
Constructor and Description |
---|
FRLayout2()
Creates an instance which does not initialize the vertex locations.
|
FRLayout2(Graph<V,E> g)
Creates an instance for the specified graph.
|
FRLayout2(Graph<V,E> g,
java.awt.Dimension d)
Creates an instance of size
d for the specified graph. |
Modifier and Type | Method and Description |
---|---|
protected void |
calcAttraction(E e) |
protected void |
calcPositions(V v) |
protected void |
calcRepulsion(V v1) |
boolean |
done()
Returns true once the current iteration has passed the maximum count,
MAX_ITERATIONS.
|
void |
initialize()
Initializes fields in the node that may not have
been set during the constructor.
|
boolean |
isIncremental()
This one is an incremental visualization.
|
void |
reset() |
void |
setAttractionMultiplier(double attraction)
Sets the attraction multiplier.
|
void |
setMaxIterations(int maxIterations)
Sets the maximum number of iterations.
|
void |
setRepulsionMultiplier(double repulsion)
Sets the repulsion multiplier.
|
void |
setSize(java.awt.Dimension size)
When a visualization is resized, it presumably wants to fix the
locations of the vertices and possibly to reinitialize its data.
|
void |
step()
Moves the iteration forward one notch, calculation attraction and
repulsion between vertices and edges and cooling the temperature.
|
getGraph, getSize, getX, getY, isLocked, lock, lock, offsetVertex, setGraph, setInitializer, setLocation, setLocation, transform
public FRLayout2()
public void setSize(java.awt.Dimension size)
AbstractLayout
public void setAttractionMultiplier(double attraction)
public void setRepulsionMultiplier(double repulsion)
public void initialize()
Layout
initialize
in interface Layout<V,E>
public void step()
step
in interface IterativeContext
protected void calcPositions(V v)
protected void calcAttraction(E e)
protected void calcRepulsion(V v1)
public void setMaxIterations(int maxIterations)
public boolean isIncremental()
public boolean done()
done
in interface IterativeContext
Copyright © 2021, 2022 Herve Girod. All Rights Reserved. Documentation and source under the BSD 3-Clause licence