|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.mindfusion.diagramming.SpringLayout
public class SpringLayout
Implements the Spring-Embedder graph layout algorithm. Spring-Embedder produces layouts having uniform distribution of nodes by simulating a physical system in which nodes repulse each other and the links between them act as confining springs. Nodes are moved around in an iterative process. The forces that act on a node are calculated, taking in account the positions of surrounding nodes and links from the previous iteration.
Constructor Summary | |
---|---|
SpringLayout()
Initializes a new instance of the SpringLayout class. |
|
SpringLayout(int iterationCount,
float nodeDistance,
boolean minimizeCrossings)
Initializes a new instance of the SpringLayout class. |
|
SpringLayout(int iterationCount,
float nodeDistance,
boolean minimizeCrossings,
boolean keepGroupLayout)
Initializes a new instance of the SpringLayout class. |
Method Summary | |
---|---|
boolean |
arrange(Diagram chart)
Arranges the specified flowchart. |
int |
getAnchoring()
Gets a value indicating how arrows will be aligned to the anchor points of tree nodes. |
boolean |
getEnableClusters()
Gets a value indicating whether the layout algorithm should place nodes into distinct clusters. |
int |
getIterations()
Gets the number of iterations that the layout algorithm should run. |
boolean |
getKeepGroupLayout()
Gets a value specifying whether the relative position of nodes within groups should be kept intact. |
boolean |
getMinimizeCrossings()
Gets a value indicating whether the algorithm should try to minimize the number of arrow crossings. |
float |
getNodeDistance()
Gets how much space should be left between adjacent nodes. |
int |
getRandomSeed()
Gets the randomization seed used for generating random node positions. |
double |
getRepulsionFactor()
Gets a multiplier value applied to the repulsive force between nodes. |
void |
setAnchoring(int value)
Sets a value indicating how arrows should be aligned to the anchor points of tree nodes. |
void |
setEnableClusters(boolean value)
Sets a value indicating whether the layout algorithm should place nodes into distinct clusters. |
void |
setIterations(int value)
Sets the number of iterations that the layout algorithm should run. |
void |
setKeepGroupLayout(boolean value)
Sets a value specifying whether the relative position of nodes within groups should be kept intact. |
void |
setMinimizeCrossings(boolean value)
Sets a value indicating whether the algorithm should try to minimize the number of arrow crossings. |
void |
setNodeDistance(float value)
Sets how much space should be left between adjacent nodes. |
void |
setRandomSeed(int value)
Sets the randomization seed that should be used for generating random node positions. |
void |
setRepulsionFactor(double value)
Sets a multiplier value applied to the repulsive force between nodes. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SpringLayout()
public SpringLayout(int iterationCount, float nodeDistance, boolean minimizeCrossings)
iterationCount
- The number of iterations that the
layout algorithm should run.nodeDistance
- The desired distance between nodes.minimizeCrossings
- true
to minimize arrow crossings,
otherwise false
.public SpringLayout(int iterationCount, float nodeDistance, boolean minimizeCrossings, boolean keepGroupLayout)
iterationCount
- The number of iterations that the
layout algorithm should run.nodeDistance
- The desired distance between nodes.minimizeCrossings
- true
to minimize arrow crossings,
otherwise false
.keepGroupLayout
- true
if the relative position of
nodes within groups should be preserved, otherwise false
.Method Detail |
---|
public boolean arrange(Diagram chart)
arrange
in interface Layout
chart
- The Diagram
to arrange.
true
public boolean getKeepGroupLayout()
true
if the relative position of nodes within
groups should be preserved, otherwise false
.public void setKeepGroupLayout(boolean value)
value
- true
if the relative position of nodes within
groups should be preserved, otherwise false
.public int getIterations()
public void setIterations(int value)
value
- An integer value specifying the number of iterations.public float getNodeDistance()
public void setNodeDistance(float value)
value
- A float value specifying the desired node distance.public boolean getMinimizeCrossings()
true
if the layout routine will try to minimize
the number of arrow crossings, otherwise false
.public void setMinimizeCrossings(boolean value)
value
- true
if the layout routine should try to minimize
the number of arrow crossings, otherwise false
.public boolean getEnableClusters()
true
if nodes will be placed in clusters
when possible, otherwise false
.public void setEnableClusters(boolean value)
value
- true
if nodes should be placed in clusters
when possible, otherwise false
.public double getRepulsionFactor()
public void setRepulsionFactor(double value)
value
- A float value by which the repulsive force between nodes is multiplied.public int getRandomSeed()
public void setRandomSeed(int value)
value
- An integer value specifying the randomization seed.public int getAnchoring()
Anchoring
constants.public void setAnchoring(int value)
value
- One of the Anchoring
constants.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |