annas.graph.drawing
Class ForceBasedPlacer<N,A extends ArcInterface<N>>

java.lang.Object
  extended by annas.graph.drawing.ForceBasedPlacer<N,A>
Type Parameters:
N - Node Type
A - 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
           
 
Constructor Summary
ForceBasedPlacer()
           
 
Method Summary
 void calculateChange()
           
 void calculateForces(int i)
           
 void iterateForce()
           
 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.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

debug

public static boolean debug

random

public static boolean random
Constructor Detail

ForceBasedPlacer

public ForceBasedPlacer()
Method Detail

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()