annas.graph.drawing
Class ForceBasedPlacer<N,A extends ArcInterface<N>>
java.lang.Object
annas.graph.drawing.ForceBasedPlacer<N,A>
- Type Parameters:
N
- Node TypeA
- Arc type
- All Implemented Interfaces:
- Placer<N,A>
public class ForceBasedPlacer<N,A extends ArcInterface<N>>
- extends java.lang.Object
- implements Placer<N,A>
Uses a Forced based iterative algorithm to find the optimal location of each
node.
- Author:
- Sam Wilson
Field Summary |
static boolean |
debug
|
static boolean |
random
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
debug
public static boolean debug
random
public static boolean random
ForceBasedPlacer
public ForceBasedPlacer()
place
public java.util.Map<N,int[]> place(GraphInterface<N,A> graph,
int sizeX,
int sizeY)
- Takes a graph and runs an Algorithm to determine the location of each
node in the Graph.
- Specified by:
place
in interface Placer<N,A extends ArcInterface<N>>
- Parameters:
graph
- Graph to draw.
- Returns:
- Map mapping nodes to maps of string Object pairs. Containing data
used by the drawing routine.
iterateForce
public void iterateForce()
calculateForces
public void calculateForces(int i)
calculateChange
public void calculateChange()