Class FRLayout<V,E>
java.lang.Object
edu.uci.ics.jung.algorithms.layout.AbstractLayout<V,E>
edu.uci.ics.jung.algorithms.layout.FRLayout<V,E>
- All Implemented Interfaces:
com.google.common.base.Function<V,,Point2D> Layout<V,,E> IterativeContext,Function<V,Point2D>
Implements the Fruchterman-Reingold force-directed algorithm for node layout.
Behavior is determined by the following settable parameters:
- attraction multiplier: how much edges try to keep their vertices together
- repulsion multiplier: how much vertices try to push each other apart
- maximum iterations: how many iterations this algorithm will use before stopping
- Author:
- Scott White, Yan-Biao Boey, Danyel Fisher
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected com.google.common.cache.LoadingCache<V, FRLayout.FRVertexData> Fields inherited from class edu.uci.ics.jung.algorithms.layout.AbstractLayout
graph, initialized, locations, size -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcalcAttraction(E e) protected voidcalcPositions(V v) protected voidcalcRepulsion(V v1) booleandone()protected FRLayout.FRVertexDatavoidInitializes fields in the node that may not have been set during the constructor.booleanvoidreset()voidsetAttractionMultiplier(double attraction) voidsetMaxIterations(int maxIterations) voidsetRepulsionMultiplier(double repulsion) voidWhen a visualization is resized, it presumably wants to fix the locations of the vertices and possibly to reinitialize its data.voidstep()Moves the iteration forward one notch, calculation attraction and repulsion between vertices and edges and cooling the temperature.Methods inherited from class edu.uci.ics.jung.algorithms.layout.AbstractLayout
apply, getGraph, getSize, getX, getY, isLocked, lock, lock, offsetVertex, setGraph, setInitializer, setLocation, setLocationMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.google.common.base.Function
equals
-
Field Details
-
frVertexData
-
-
Constructor Details
-
FRLayout
-
FRLayout
-
-
Method Details
-
setSize
Description copied from class:AbstractLayoutWhen a visualization is resized, it presumably wants to fix the locations of the vertices and possibly to reinitialize its data. The current method calls initializeLocations followed by initialize_local. -
setAttractionMultiplier
public void setAttractionMultiplier(double attraction) -
setRepulsionMultiplier
public void setRepulsionMultiplier(double repulsion) -
reset
public void reset() -
initialize
public void initialize()Description copied from interface:LayoutInitializes fields in the node that may not have been set during the constructor. Must be called before the iterations begin.- Specified by:
initializein interfaceLayout<V,E>
-
step
public void step()Moves the iteration forward one notch, calculation attraction and repulsion between vertices and edges and cooling the temperature.- Specified by:
stepin interfaceIterativeContext
-
calcPositions
-
calcAttraction
-
calcRepulsion
-
setMaxIterations
public void setMaxIterations(int maxIterations) -
getFRData
-
isIncremental
public boolean isIncremental()- Returns:
- true
-
done
public boolean done()- Specified by:
donein interfaceIterativeContext- Returns:
- true once the current iteration has passed the maximum count.
-