org.arakhne.neteditor.figlayout.force
public class ForceBasedFigureLayout extends AbstractFigureLayout implements ForceBasedConstants
The force toward and away from nodes is calculated according to Hooke's Law and Coulomb's Law.
DEFAULT_COULOMB_CONSTANT, DEFAULT_DAMPING, DEFAULT_MASS, DEFAULT_SPRING_CONSTANT, DEFAULT_STABILITY_ENERGY_THRESHOLD, DEFAULT_TIME_STEPHALF_MINIMAL_HORIZONTAL_PADDING, HALF_MINIMAL_VERTICAL_PADDINGDEFAULT_ACTIVE_COLOR, DEFAULT_BACKGROUND_SELECTION_COLOR, DEFAULT_DAMAGING_EXTENTS, DEFAULT_DRAW_SHADOW, DEFAULT_FILL_COLOR, DEFAULT_FOREGROUND_SELECTION_COLOR, DEFAULT_LINE_COLOR, DEFAULT_LOCKING_FILL_COLOR, DEFAULT_LOCKING_OUTLINE_COLOR, DEFAULT_MAXIMAL_SIZE, DEFAULT_MINIMAL_SIZE, DEFAULT_MINIMAL_SUBFIGURE_SIZE, DEFAULT_SHADOW_PROJECTION_DISTANCE_X, DEFAULT_SHADOW_PROJECTION_DISTANCE_Y, FLATTENING_PRECISION| Constructor and Description |
|---|
ForceBasedFigureLayout() |
| Modifier and Type | Method and Description |
|---|---|
float |
getCoulombConstant()
Replies the Coulomb's constant to use.
|
float |
getDamping()
Replies the damping constant.
|
float |
getMaximalKinematicEnergy()
Replies the maximal kinematic energy up to the algorithm
is able to reach.
|
FigureMassCalculator |
getNodeMassCalculator()
Replies the calculator of the node's masses.
|
float |
getPreferredInterNodeSpace()
Replies the preferred space between two nodes (insets are
outside this preferred space).
|
float |
getRandomCoordinateSpaceSize()
Replies the size of the coordinate space that is
used to compute a coordinate randomly.
|
float |
getSpringConstant()
Replies the spring constant to use.
|
float |
getTimeStep()
Replies the time step used by the algorithm.
|
Undoable |
layoutFigures(Collection<? extends Figure> figures)
Run the laying-out algorithm for the given figures.
|
void |
setCoulombConstant(float k)
Set the Coulomb's constant to use.
|
void |
setDamping(float damping)
Set the damping constant.
|
void |
setMaximalKinematicEnergy(float energy)
Set the maximal kinematic energy up to the algorithm
is able to reach.
|
void |
setNodeMassCalculator(FigureMassCalculator calculator)
Set the calculator of the node's masses.
|
void |
setPreferredInterNodeSpace(float space)
Set the preferred space between two nodes (insets are
outside this preferred space).
|
void |
setRandomCoordinateSpaceSize(float size)
Set the size of the coordinate space that is
used to compute a coordinate randomly.
|
void |
setSpringConstant(float k)
Set the spring constant to use.
|
void |
setTimeStep(float step)
Set the time step used by the algorithm.
|
getMargins, getOrigin, setMargins, setOrigin, setOriginpublic void setPreferredInterNodeSpace(float space)
space - public float getPreferredInterNodeSpace()
public void setNodeMassCalculator(FigureMassCalculator calculator)
calculator - public FigureMassCalculator getNodeMassCalculator()
public float getRandomCoordinateSpaceSize()
public void setRandomCoordinateSpaceSize(float size)
size - is the size of the random coordinate space; stricly positive.public float getMaximalKinematicEnergy()
public void setMaximalKinematicEnergy(float energy)
energy - is the maximal kinematic energy, stricly positive.public float getCoulombConstant()
ForceBasedConstants.DEFAULT_COULOMB_CONSTANT.public void setCoulombConstant(float k)
k - the Coulomb's constant, stricly positive.public float getSpringConstant()
ForceBasedConstants.DEFAULT_SPRING_CONSTANT.public void setSpringConstant(float k)
k - the spring constant, stricly positive.public float getDamping()
public void setDamping(float damping)
damping - is the damping constant.public float getTimeStep()
public void setTimeStep(float step)
step - is the time step, stricly positive.public Undoable layoutFigures(Collection<? extends Figure> figures)
layoutFigures in interface FigureLayoutfigures - are the figures to laying out.null if the layout does not supports the undo/redo feature
or it has nothing to undo.Copyright © 2001-2013 NetEditor Developers. 
NetEditor API Documentation by NetEditor Developers is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
Based on a work at www.arakhne.org/neteditor