lv.lumii.layoutengine.springembedder

## Class TimedSpringEmbedder

- java.lang.Object
- - lv.lumii.layoutengine.springembedder.TimedSpringEmbedder

-     public final class TimedSpringEmbedder
      extends java.lang.Object

  This class defines the spring embedder class. The spring embedder layout uses a heuristical force directed algorithm for producing graph layouts. There are two kinds of forces: repulsive between any two nodes, and attractive between nodes connected with an edge. The equilibruim of these forces defines the layout.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `TimedSpringEmbedder(int nodes, int edges, int RandSeed)` This constructor creates a spring embedder class with n nodes and m edges.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `initLayout(double spacing, double[] nodeX, double[] nodeY, double[] nodeRadius, int[] edgeSourceId, int[] edgeTargetId, boolean incremental, boolean[] lockedNodes, double degreeModifier, double[] edgeStrength)` does only initalization part of layout
    `void` | `layout(double spacing, double[] nodeX, double[] nodeY, double[] nodeRadius, int[] edgeSourceId, int[] edgeTargetId, boolean incremental, boolean[] lockedNodes, double degreeModifier, double[] edgeStrength, int realNodeCount, java.util.List<AbstractContainer> boxes, LayoutConstraints constr, java.util.List<LayoutLine> layoutLines)`
    `void` | `timedLayout(double[] nodeX, double[] nodeY, double time)`
    `void` | `updateLayoutData(double spacing, double[] nodeX, double[] nodeY, double[] nodeRadius, boolean[] lockedNodes, double degreeModifier, double[] edgeStrength)` updates the graph data

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### TimedSpringEmbedder

          public TimedSpringEmbedder(int nodes,
                                     int edges,
                                     int RandSeed)

      This constructor creates a spring embedder class with n nodes and m edges. It also initializes the random generator with the defined seed.
      Parameters:
        `nodes` - Number of nodes
        `edges` - Number of edges
        `RandSeed` - Random seed

  - ### Method Detail

    - #### layout

          public void layout(double spacing,
                             double[] nodeX,
                             double[] nodeY,
                             double[] nodeRadius,
                             int[] edgeSourceId,
                             int[] edgeTargetId,
                             boolean incremental,
                             boolean[] lockedNodes,
                             double degreeModifier,
                             double[] edgeStrength,
                             int realNodeCount,
                             java.util.List<AbstractContainer> boxes,
                             LayoutConstraints constr,
                             java.util.List<LayoutLine> layoutLines)

      Parameters:
        `spacing` - desired separation of nodes (input)
        `nodeX` - x coordinates of node centers (output, input when incr=true)
        `nodeY` - y coordinates of node centers (output, input when incr=true)
        `nodeRadius` - node radius (input)
        `edgeSourceId` - from node index of the edges (input)
        `edgeTargetId` - to node index of the edges (input)
        `incremental` - incremental mode
        `lockedNodes` - flag if the node is locked
        `edgeStrength` - the strength of each edge. Default is 1.
        `realNodeCount` - all anodes with indices bigger than this are considered to be dummy. Repulsive forces are not calculated for dummy nodes. all edges

    - #### initLayout

          public void initLayout(double spacing,
                                 double[] nodeX,
                                 double[] nodeY,
                                 double[] nodeRadius,
                                 int[] edgeSourceId,
                                 int[] edgeTargetId,
                                 boolean incremental,
                                 boolean[] lockedNodes,
                                 double degreeModifier,
                                 double[] edgeStrength)

      does only initalization part of layout
      Parameters:
        `spacing` - desired separation of nodes (input)
        `nodeX` - x coordinates of node centers (output, input when incr=true)
        `nodeY` - y coordinates of node centers (output, input when incr=true)
        `nodeRadius` - node radius (input)
        `edgeSourceId` - from node index of the edges (input)
        `edgeTargetId` - to node index of the edges (input)
        `incremental` - incremental mode
        `lockedNodes` - flag if the node is locked all edges

    - #### updateLayoutData

          public void updateLayoutData(double spacing,
                                       double[] nodeX,
                                       double[] nodeY,
                                       double[] nodeRadius,
                                       boolean[] lockedNodes,
                                       double degreeModifier,
                                       double[] edgeStrength)

      updates the graph data
      Parameters:
        `spacing` - desired separation of nodes (input)
        `nodeX` - x coordinates of node centers (output, input when incr=true)
        `nodeY` - y coordinates of node centers (output, input when incr=true)
        `nodeRadius` - node radius (input)
        `lockedNodes` - flag if the node is locked higher temperature means that node is moving slower

    - #### timedLayout

          public void timedLayout(double[] nodeX,
                                  double[] nodeY,
                                  double time)