Documentation of 'edu.uci.ics.jung.algorithms.layout.FRLayout2' Java class
FRLayout2
edu.uci.ics.jung.algorithms.layout

Class FRLayout2<V,E>

  • All Implemented Interfaces:
    com.google.common.base.Function<V,java.awt.geom.Point2D>, Layout<V,E>, IterativeContext


    public class FRLayout2<V,E>
    extends AbstractLayout<V,E>
    implements IterativeContext
    Implements the Fruchterman-Reingold force-directed algorithm for node layout. This is an experimental attempt at optimizing 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:

    • 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
    Each of the first two defaults to 0.75; the maximum number of iterations defaults to 700.
    See Also:
    "Fruchterman and Reingold, 'Graph Drawing by Force-directed Placement'", "http://i11www.ilkd.uni-karlsruhe.de/teaching/SS_04/visualisierung/papers/fruchterman91graph.pdf"
    • Constructor Detail

      • FRLayout2

        public FRLayout2(Graph<V,E> g)
      • FRLayout2

        public FRLayout2(Graph<V,E> g,
                         java.awt.Dimension d)
    • Method Detail

      • setSize

        public void setSize(java.awt.Dimension size)
        Description copied from class: AbstractLayout
        When 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.
        Specified by:
        setSize in interface Layout<V,E>
        Overrides:
        setSize in class AbstractLayout<V,E>
        Parameters:
        size - the space to use to lay out this graph
      • setAttractionMultiplier

        public void setAttractionMultiplier(double attraction)
      • setRepulsionMultiplier

        public void setRepulsionMultiplier(double repulsion)
      • reset

        public void reset()
        Specified by:
        reset in interface Layout<V,E>
      • initialize

        public void initialize()
        Description copied from interface: Layout
        Initializes fields in the node that may not have been set during the constructor. Must be called before the iterations begin.
        Specified by:
        initialize in interface Layout<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:
        step in interface IterativeContext
      • setMaxIterations

        public void setMaxIterations(int maxIterations)
      • isIncremental

        public boolean isIncremental()
        Returns:
        true
      • done

        public boolean done()
        Specified by:
        done in interface IterativeContext
        Returns:
        true once the current iteration has passed the maximum count.

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.