|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.wilmascope.graph.LayoutEngine<NodeForceLayout,EdgeForceLayout>
org.wilmascope.forcelayout.ForceLayout
public class ForceLayout
Main class force for calculating forces on all nodes and moving them incrementally.
Constructor Summary | |
---|---|
ForceLayout()
|
Method Summary | |
---|---|
void |
addForce(Force force)
Add a force to ForceLayout's list of forces to apply |
boolean |
applyLayout()
apply the changes calculated by LayoutEngine.calculateLayout() |
void |
calculateLayout()
calculate the changes required to move the graph to a nicer layout. |
static ForceLayout |
createDefaultClusterForceLayout(Cluster root)
|
static ForceLayout |
createDefaultForceLayout(Cluster root)
|
EdgeForceLayout |
createEdgeLayout(Edge e)
Factory method to create a new EdgeLayout implementation compatible with the layout engine implementing this interface. |
NodeForceLayout |
createNodeLayout(Node n)
Factory method to create a new NodeLayout implementation compatible with the layout engine implementing this interface. |
float |
getBalancedThreshold()
|
javax.swing.JPanel |
getControls()
|
Force |
getForce(java.lang.String name)
Get a reference to one of our forces by name |
java.util.Vector |
getForces()
|
int |
getLevels()
|
float |
getLevelSeparation()
|
java.lang.String |
getName()
Return a string descriptor for the layout engine type. |
int |
getOrbits()
|
float |
getOrbitSeparation()
|
java.util.Properties |
getProperties()
If you want custom properties for your layout you will need to override this method but be sure to super.getProperties() |
float |
getVelocityAttenuation()
|
boolean |
isIterative()
The iterationsPerFrameSlider should be enabled for iterative layouts (like force directed) and disabled for layouts that complete in a single step (sugiyama) |
void |
removeAllForces()
|
void |
removeForce(Force force)
Remove a force from ForceLayout's list of forces to apply |
void |
reset()
|
void |
resetProperties()
process your custom properties by overriding this method, but, again call super.resetProperties in your overriding implementation |
void |
setBalancedEventClient(BalancedEventClient c)
|
void |
setBalancedThreshold(float threshold)
|
void |
setConstrained()
|
void |
setFrictionCoefficient(float friction)
|
void |
setVelocityAttenuation(float va)
|
Methods inherited from class org.wilmascope.graph.LayoutEngine |
---|
getRoot, init, setProperties |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ForceLayout()
Method Detail |
---|
public void calculateLayout()
LayoutEngine
LayoutEngine.applyLayout()
method. Potentially, this means that
the caller can calculate new positions (stored in the NodeLayouts), then opt not to
apply the changes if it does not lead to an improvement.
In practice this has not yet been utilised and such
decisions are usually made internally to the layout engine.
calculateLayout
in class LayoutEngine<NodeForceLayout,EdgeForceLayout>
public void reset()
public boolean applyLayout()
LayoutEngine
LayoutEngine.calculateLayout()
applyLayout
in class LayoutEngine<NodeForceLayout,EdgeForceLayout>
public void addForce(Force force)
public void removeForce(Force force)
public void removeAllForces()
public java.util.Vector getForces()
public Force getForce(java.lang.String name)
public void setBalancedEventClient(BalancedEventClient c)
public void setBalancedThreshold(float threshold)
public float getBalancedThreshold()
public float getVelocityAttenuation()
public void setVelocityAttenuation(float va)
public void setConstrained()
public NodeForceLayout createNodeLayout(Node n)
LayoutEngine
createNodeLayout
in class LayoutEngine<NodeForceLayout,EdgeForceLayout>
public EdgeForceLayout createEdgeLayout(Edge e)
LayoutEngine
createEdgeLayout
in class LayoutEngine<NodeForceLayout,EdgeForceLayout>
public void setFrictionCoefficient(float friction)
public javax.swing.JPanel getControls()
getControls
in class LayoutEngine<NodeForceLayout,EdgeForceLayout>
public java.lang.String getName()
LayoutEngine
getName
in class LayoutEngine<NodeForceLayout,EdgeForceLayout>
public int getLevels()
public float getLevelSeparation()
public int getOrbits()
public float getOrbitSeparation()
public java.util.Properties getProperties()
LayoutEngine
getProperties
in class LayoutEngine<NodeForceLayout,EdgeForceLayout>
public void resetProperties()
LayoutEngine
resetProperties
in class LayoutEngine<NodeForceLayout,EdgeForceLayout>
public static ForceLayout createDefaultForceLayout(Cluster root)
public static ForceLayout createDefaultClusterForceLayout(Cluster root)
public boolean isIterative()
LayoutEngine
isIterative
in class LayoutEngine<NodeForceLayout,EdgeForceLayout>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |