infovis.tree.visualization.nodelink
Class SimpleTreeLayout

java.lang.Object
  extended by infovis.tree.visualization.NodeLinkTreeLayout
      extended by infovis.tree.visualization.nodelink.SimpleTreeLayout
All Implemented Interfaces:
DepthFirst.Visitor, Layout, Orientable, SwingConstants

public class SimpleTreeLayout
extends NodeLinkTreeLayout
implements Orientable, DepthFirst.Visitor

Simple algorithm for tree layout.

Version:
$Revision: 1.3 $
Author:
Jean-Daniel Fekete
InfoVis factory arguments:
TreeLayoutFactory "Simple"

Field Summary
 
Fields inherited from interface infovis.visualization.Orientable
DIRECTION, NAME, ORIENTATION_CENTER, ORIENTATION_EAST, ORIENTATION_INVALID, ORIENTATION_NORTH, ORIENTATION_SOUTH, ORIENTATION_WEST, SQRT2
 
Fields inherited from interface javax.swing.SwingConstants
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
 
Constructor Summary
SimpleTreeLayout()
          Constructor.
 
Method Summary
 void computeShapes(Rectangle2D bounds, NodeLinkTreeVisualization vis)
          Performs the actual computation of the layout.
 String getName()
          Returns the name of the layout algorithm.
 Dimension getPreferredSize(Visualization vis)
          Computes and return the preferred size for this layout and this visualization.
 void postorder(int node)
          Method called when all the children of the node have been traversed.
 boolean preorder(int node)
          Method called when the node is initially reached.
 
Methods inherited from class infovis.tree.visualization.NodeLinkTreeLayout
childrenIterator, computeShapes, findRectAt, getFirstChild, getLevelSeparation, getOrientation, getParent, getRectAt, getSiblingSeparation, getSubtreeSeparation, invalidate, isLeaf, iterator, setLevelSeparation, setOrientation, setRectSizeAt, setShapeAt, setSiblingSeparation, setSubtreeSeparation
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface infovis.visualization.Orientable
getOrientation, setOrientation
 

Constructor Detail

SimpleTreeLayout

public SimpleTreeLayout()
Constructor.

Method Detail

computeShapes

public void computeShapes(Rectangle2D bounds,
                          NodeLinkTreeVisualization vis)
Performs the actual computation of the layout.

Specified by:
computeShapes in class NodeLinkTreeLayout
Parameters:
bounds - the visualization bounds
vis - the visualization

getName

public String getName()
Returns the name of the layout algorithm.

Specified by:
getName in interface Layout
Returns:
the name of the layout algorithm

preorder

public boolean preorder(int node)
Method called when the node is initially reached.

Specified by:
preorder in interface DepthFirst.Visitor
Parameters:
node - the reached node.
Returns:
true if the subtree should be traversed, false if it should be pruned from the traversal. In the latter case, the two other methods are not called for the node.

postorder

public void postorder(int node)
Method called when all the children of the node have been traversed.

Specified by:
postorder in interface DepthFirst.Visitor
Parameters:
node - the reached node.

getPreferredSize

public Dimension getPreferredSize(Visualization vis)
Computes and return the preferred size for this layout and this visualization.

Specified by:
getPreferredSize in interface Layout
Overrides:
getPreferredSize in class NodeLinkTreeLayout
Parameters:
vis - the visualization
Returns:
the preferred size for this layout and this visualization.


Copyright © 2005 by Jean-Daniel Fekete and INRIA, France All rights reserved.