edu.uci.ics.jung.visualization.contrib
Class TreeLayout

java.lang.Object
  extended by edu.uci.ics.jung.visualization.AbstractLayout
      extended by edu.uci.ics.jung.visualization.contrib.TreeLayout
All Implemented Interfaces:
ChangeEventSupport, Layout, VertexLocationFunction

public class TreeLayout
extends AbstractLayout
implements Layout

Author:
Karlheinz Toni

Field Summary
static int DEFAULT_DISTX
           
static int DEFAULT_DISTY
           
 
Fields inherited from class edu.uci.ics.jung.visualization.AbstractLayout
changeSupport, vertex_locations
 
Constructor Summary
TreeLayout(SparseTree g)
           
TreeLayout(SparseTree g, int distx)
           
TreeLayout(SparseTree g, int distx, int disty)
           
 
Method Summary
 void advancePositions()
          ?
 void applyFilter(Graph g)
          Applies the filter to the current graph.
static Vector getAtomics(Vertex p)
           
 int getDepth(Vertex v)
           
 Vertex getRootVertex()
           
 boolean incrementsAreDone()
          ?
protected  void initialize_local_vertex(Vertex v)
          ?
 void initialize(Dimension size)
          Initializer, calls intialize_local and initializeLocations to start construction process.
protected  void initializeLocations()
          This method calls initialize_local_vertex for each vertex, and also adds initial coordinate information for each vertex.
 boolean isIncremental()
          ?
 void setRootVertex(Vertex rootVertex_)
           
 
Methods inherited from class edu.uci.ics.jung.visualization.AbstractLayout
addChangeListener, dontMove, fireStateChanged, forceMove, getAVertex, getBaseKey, getChangeListeners, getCoordinates, getCurrentSize, getEdge, getEdge, getGraph, getLocation, getStatus, getVertex, getVertex, getVertexIterator, getVisibleEdges, getVisibleGraph, getVisibleVertices, getX, getY, initialize_local, initialize, initializeLocation, isLocked, lockVertex, offsetVertex, postInitialize, removeChangeListener, resize, restart, unlockVertex
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface edu.uci.ics.jung.visualization.Layout
forceMove, getCurrentSize, getGraph, getLocation, getStatus, getVertex, getVertex, getVisibleEdges, getVisibleVertices, getX, getY, isLocked, lockVertex, resize, restart, unlockVertex
 
Methods inherited from interface edu.uci.ics.jung.visualization.VertexLocationFunction
getVertexIterator
 

Field Detail

DEFAULT_DISTX

public static int DEFAULT_DISTX

DEFAULT_DISTY

public static int DEFAULT_DISTY
Constructor Detail

TreeLayout

public TreeLayout(SparseTree g)

TreeLayout

public TreeLayout(SparseTree g,
                  int distx)

TreeLayout

public TreeLayout(SparseTree g,
                  int distx,
                  int disty)
Method Detail

getAtomics

public static Vector getAtomics(Vertex p)

advancePositions

public void advancePositions()
?

Specified by:
advancePositions in interface Layout
Specified by:
advancePositions in class AbstractLayout
See Also:
Layout.advancePositions()

applyFilter

public void applyFilter(Graph g)
Description copied from class: AbstractLayout
Applies the filter to the current graph. The default implementation merely makes fewer vertices available to the getVisibleVertices and getVisibleEdges methods.

Specified by:
applyFilter in interface Layout
Overrides:
applyFilter in class AbstractLayout
Parameters:
g - a filtered graph that is a subgraph of the Graph returned by getGraph
See Also:
Layout.applyFilter(Graph g)

getDepth

public int getDepth(Vertex v)

getRootVertex

public Vertex getRootVertex()
Returns:
Returns the rootVertex_.

incrementsAreDone

public boolean incrementsAreDone()
?

Specified by:
incrementsAreDone in interface Layout
See Also:
Layout.incrementsAreDone()

initialize

public void initialize(Dimension size)
Description copied from class: AbstractLayout
Initializer, calls intialize_local and initializeLocations to start construction process.

Specified by:
initialize in interface Layout
Overrides:
initialize in class AbstractLayout

initialize_local_vertex

protected void initialize_local_vertex(Vertex v)
?

Specified by:
initialize_local_vertex in class AbstractLayout
See Also:
AbstractLayout.initialize_local_vertex(edu.uci.ics.jung.graph.Vertex)

initializeLocations

protected void initializeLocations()
Description copied from class: AbstractLayout
This method calls initialize_local_vertex for each vertex, and also adds initial coordinate information for each vertex. (The vertex's initial location is set by calling initializeLocation.

Overrides:
initializeLocations in class AbstractLayout

isIncremental

public boolean isIncremental()
?

Specified by:
isIncremental in interface Layout
See Also:
Layout.isIncremental()

setRootVertex

public void setRootVertex(Vertex rootVertex_)
Parameters:
rootVertex_ - The rootVertex_ to set.