Class SpringBox
java.lang.Object
org.graphstream.stream.SourceBase
org.graphstream.ui.layout.springbox.BarnesHutLayout
org.graphstream.ui.layout.springbox.implementations.SpringBox
- 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).
-
Nested Class Summary
Nested classes/interfaces inherited from class org.graphstream.stream.SourceBase
SourceBase.ElementType -
Constructor Summary
-
Method Summary
Modifier and Type Method Description StringgetLayoutAlgorithmName()Name of the layout algorithm.NodeParticlenewNodeParticle(String id)Factory method to create node particles.voidsetQuality(double qualityLevel)Set the overall quality level, a number between 0 and 1 with 1 the highest quality available, but often with a slower computation.Methods inherited from class org.graphstream.ui.layout.springbox.BarnesHutLayout
clear, compute, edgeAdded, edgeAttributeAdded, edgeAttributeChanged, edgeAttributeRemoved, edgeRemoved, freezeNode, getBarnesHutTheta, getCenterPoint, getEnergies, getForce, getGravityFactor, getHiPoint, getLastStepTime, getLowPoint, getNodeMovedCount, getQuality, getRandom, getSpatialIndex, getStabilization, getStabilizationLimit, getSteps, getViewZone, graphAttributeAdded, graphAttributeChanged, graphAttributeRemoved, graphCleared, is3D, moveNode, nodeAdded, nodeAttributeAdded, nodeAttributeChanged, nodeAttributeRemoved, nodeRemoved, particleAdded, particleAdded, particleAttributeChanged, particleMarked, particleMoved, particleRemoved, randomXInsideBounds, randomYInsideBounds, randomZInsideBounds, setBarnesHutTheta, setForce, setGravityFactor, setSendNodeInfos, setStabilizationLimit, shake, stepBegins, stepFinishedMethods inherited from class org.graphstream.stream.SourceBase
addAttributeSink, addElementSink, addSink, attributeSinks, clearAttributeSinks, clearElementSinks, clearSinks, elementSinks, removeAttributeSink, removeElementSink, removeSink, sendAttributeChangedEvent, sendAttributeChangedEvent, sendEdgeAdded, sendEdgeAdded, sendEdgeAttributeAdded, sendEdgeAttributeAdded, sendEdgeAttributeChanged, sendEdgeAttributeChanged, sendEdgeAttributeRemoved, sendEdgeAttributeRemoved, sendEdgeRemoved, sendEdgeRemoved, sendGraphAttributeAdded, sendGraphAttributeAdded, sendGraphAttributeChanged, sendGraphAttributeChanged, sendGraphAttributeRemoved, sendGraphAttributeRemoved, sendGraphCleared, sendGraphCleared, sendNodeAdded, sendNodeAdded, sendNodeAttributeAdded, sendNodeAttributeAdded, sendNodeAttributeChanged, sendNodeAttributeChanged, sendNodeAttributeRemoved, sendNodeAttributeRemoved, sendNodeRemoved, sendNodeRemoved, sendStepBegins, sendStepBeginsMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.graphstream.stream.Source
addAttributeSink, addElementSink, addSink, clearAttributeSinks, clearElementSinks, clearSinks, removeAttributeSink, removeElementSink, removeSink
-
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
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
Description copied from interface:LayoutName of the layout algorithm.- Specified by:
getLayoutAlgorithmNamein interfaceLayout- Specified by:
getLayoutAlgorithmNamein classBarnesHutLayout
-
setQuality
public void setQuality(double qualityLevel)Description copied from interface:LayoutSet the overall quality level, a number between 0 and 1 with 1 the highest quality available, but often with a slower computation.- Specified by:
setQualityin interfaceLayout- Overrides:
setQualityin classBarnesHutLayout- Parameters:
qualityLevel- The quality level, a number between 0 and 1.
-
newNodeParticle
Description copied from class:BarnesHutLayoutFactory method to create node particles.- Specified by:
newNodeParticlein classBarnesHutLayout- Parameters:
id- The identifier of the new node/particle.- Returns:
- The new node/particle.
-