Module imp2d

Class SpringLayout

All Implemented Interfaces:
Manageable, Shareable

public class SpringLayout extends ForceBasedLayout
  • Field Details

  • Constructor Details

    • SpringLayout

      public SpringLayout()
  • Method Details

    • setRandomPosition

      protected void setRandomPosition(Node nodeTemp, Random rnd)
      Specified by:
      setRandomPosition in class ForceBasedLayout
    • computeForce

      protected void computeForce(Edge e, Vector2f force)
      Description copied from class: ForceBasedLayout
      Computes the force contribution of an edge. This method is invoked for every edge of the graph.
      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
    • computeForce

      protected void computeForce(Node s, Node t, Vector2f force)
      Description copied from class: ForceBasedLayout
      Computes the force contribution of a pair of nodes. This method is invoked for every pair of nodes, whether they are connected or not. The computed force should be anti-symmetric with respect to s and t, i.e., if these parameters are exchanged, the resulting force should be the negative of the original force.
      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
    • getManageableType

      public ManageableType getManageableType()