All Implemented Interfaces:
AttributeSink, ElementSink, Pipe, Sink, Source, Layout, org.miv.pherd.ParticleBoxListener

public class SpringBox
extends BarnesHutLayout
The GraphStream Spring-Box layout.

This layout is the default GraphStream layout that handles dynamic graphs. It can constantly evolve according to the changes in the graph. And works well with the LayoutRunner class so that the computations stops when the layout is stable enougth.

This algorithm is based on the Frutcherman-Reingold force layout algorithm modified on the attraction (the degree of nodes is taken into account to stabilize the layout as we are not only interested in the result, but also in the steps in between).

  • Constructor Details

    • SpringBox

      public SpringBox()
      New "Spring-Box" 2D Barnes-Hut simulation.
    • SpringBox

      public SpringBox​(boolean is3D)
      New "Spring-Box" Barnes-Hut simulation.
      Parameters:
      is3D - If true the simulation dimensions count is 3 else 2.
    • SpringBox

      public SpringBox​(boolean is3D, Random randomNumberGenerator)
      New "Spring-Box" Barnes-Hut simulation.
      Parameters:
      is3D - If true the simulation dimensions count is 3 else 2.
      randomNumberGenerator - The random number generator to use.
  • Method Details

    • getLayoutAlgorithmName

      public String getLayoutAlgorithmName()
      Description copied from interface: Layout
      Name of the layout algorithm.
      Specified by:
      getLayoutAlgorithmName in interface Layout
      Specified by:
      getLayoutAlgorithmName in class BarnesHutLayout
    • setQuality

      public void setQuality​(double qualityLevel)
      Description copied from interface: Layout
      Set the overall quality level, a number between 0 and 1 with 1 the highest quality available, but often with a slower computation.
      Specified by:
      setQuality in interface Layout
      Overrides:
      setQuality in class BarnesHutLayout
      Parameters:
      qualityLevel - The quality level, a number between 0 and 1.
    • newNodeParticle

      public NodeParticle newNodeParticle​(String id)
      Description copied from class: BarnesHutLayout
      Factory method to create node particles.
      Specified by:
      newNodeParticle in class BarnesHutLayout
      Parameters:
      id - The identifier of the new node/particle.
      Returns:
      The new node/particle.