org.xistrat.util.d3.vrmlgraph
Class ViewCenterer

java.lang.Object
  extended by org.xistrat.util.d3.vrmlgraph.ViewCenterer

public class ViewCenterer
extends java.lang.Object

A class used for centering a graph about the origin

Since:
0.6.90

Constructor Summary
ViewCenterer(GraphData graph)
          Constructor for the ViewCenterer object
 
Method Summary
 void center()
          Calculates the average x, y and z coordinates of all of the nodes in the GraphData object that was passed via its constructor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ViewCenterer

public ViewCenterer(GraphData graph)
Constructor for the ViewCenterer object

Parameters:
graph - The GraphData object to be centered
Method Detail

center

public void center()
Calculates the average x, y and z coordinates of all of the nodes in the GraphData object that was passed via its constructor. It then used this to move each Node such that the average coordinate is at the origin.