Module imp2d

Class FruchtermanReingoldLayout

All Implemented Interfaces:
Manageable, Shareable

public class FruchtermanReingoldLayout extends ForceBasedLayout
A FruchtermanReingoldLayout computes a graph layout based on the force based FruchtermanReingold model.
  • Field Details

  • Constructor Details

    • FruchtermanReingoldLayout

      public FruchtermanReingoldLayout()
  • Method Details

    • setRandomPosition

      protected void setRandomPosition(Node nodeTemp, Random rnd)
      Calculating and setting the inital positions of the nodes
      Specified by:
      setRandomPosition in class ForceBasedLayout
    • computeForce

      protected void computeForce(Node s, Node t, Vector2f force)
      Calculating the repelling force of two nodes s and t
      Specified by:
      computeForce in class ForceBasedLayout
      Parameters:
      s - the source node
      t - the target node
      force - the force in the direction from s to t has to be placed in here
    • computeForce

      protected void computeForce(Edge e, Vector2f force)
      Calculating the attraction force of two nodes connected by an edge e
      Specified by:
      computeForce in class ForceBasedLayout
      Parameters:
      e - an edge
      force - the force in the direction from edge.source to edge.target has to be placed in here
    • getManageableType

      public ManageableType getManageableType()