Module imp2d

Class DavidsonHarelLayout

All Implemented Interfaces:
Manageable, Shareable

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

  • Constructor Details

    • DavidsonHarelLayout

      public DavidsonHarelLayout()
  • Method Details

    • setRandomPosition

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

      protected void computeForce(Node s, Node t, Vector2f force)
      Computes 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)
      Computes the attraction force of two nodes connected with 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()