infovis.tree.visualization
Class NodeLinkTreeLayout

java.lang.Object
  extended by infovis.tree.visualization.NodeLinkTreeLayout
All Implemented Interfaces:
Layout, Orientable, SwingConstants
Direct Known Subclasses:
DendrogramTreeLayout, RTLayout, SimpleTreeLayout

public abstract class NodeLinkTreeLayout
extends Object
implements Layout, Orientable

Layout class for NodeLinkTreeVisualization.

Version:
$Revision: 1.6 $
Author:
Jean-Daniel Fekete

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
 
Method Summary
 RowIterator childrenIterator(int node)
           
abstract  void computeShapes(Rectangle2D bounds, NodeLinkTreeVisualization vis)
          Performs the actual computation of the layout.
 void computeShapes(Rectangle2D bounds, Visualization vis)
          Computes the layout.
 Rectangle2D.Float findRectAt(int row)
           
 int getFirstChild(int node)
           
 float getLevelSeparation()
           
 short getOrientation()
          Returns the orientation manages by this interface.
 int getParent(int node)
           
 Dimension getPreferredSize(Visualization vis)
          Computes and return the preferred size for this layout and this visualization.
 Rectangle2D.Float getRectAt(int row)
           
 float getSiblingSeparation()
           
 float getSubtreeSeparation()
           
 void invalidate(Visualization vis)
          Invalidate the cached state of the layout.
 boolean isLeaf(int node)
           
 RowIterator iterator()
           
 void setLevelSeparation(float levelSeparation)
           
 void setOrientation(short orientation)
          Sets the orientation of this interface.
 void setRectSizeAt(int row, Rectangle2D.Float rect)
          Set the rectangle associated with a specified row.
 void setShapeAt(int row, Shape s)
          Sets the shape in the shape column.
 void setSiblingSeparation(float siblingSeparation)
           
 void setSubtreeSeparation(float subtreeSeparation)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface infovis.visualization.Layout
getName
 

Method Detail

getPreferredSize

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

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

invalidate

public void invalidate(Visualization vis)
Invalidate the cached state of the layout.

Call this method from the visualization when it gets invalidated.

Specified by:
invalidate in interface Layout
Parameters:
vis - the visualization.

computeShapes

public void computeShapes(Rectangle2D bounds,
                          Visualization vis)
Computes the layout.

Specified by:
computeShapes in interface Layout
Parameters:
bounds - the allocated bounds of the visualization.
vis - the visualization.

computeShapes

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

Parameters:
bounds - the visualization bounds
vis - the visualization

findRectAt

public Rectangle2D.Float findRectAt(int row)
See Also:
ShapeColumn.findRect(int)

getRectAt

public Rectangle2D.Float getRectAt(int row)
See Also:
ShapeColumn.getRect(int)

setShapeAt

public void setShapeAt(int row,
                       Shape s)
Sets the shape in the shape column.

Parameters:
row - the row
s - the shape

iterator

public RowIterator iterator()
See Also:
Visualization.iterator()

childrenIterator

public RowIterator childrenIterator(int node)
See Also:
Tree.childrenIterator(int)

isLeaf

public boolean isLeaf(int node)
See Also:
Tree.isLeaf(int)

getFirstChild

public int getFirstChild(int node)
See Also:
TreeVisualization.getFirstChild(int)

getParent

public int getParent(int node)
See Also:
Tree.getParent(int)

getOrientation

public short getOrientation()
Description copied from interface: Orientable
Returns the orientation manages by this interface.

Specified by:
getOrientation in interface Orientable
Returns:
the orientation manages by this interface
See Also:
Orientable.getOrientation()

setOrientation

public void setOrientation(short orientation)
Description copied from interface: Orientable
Sets the orientation of this interface.

Specified by:
setOrientation in interface Orientable
Parameters:
orientation - the orientation.
See Also:
Orientable.setOrientation(short)

setRectSizeAt

public void setRectSizeAt(int row,
                          Rectangle2D.Float rect)
Set the rectangle associated with a specified row.

Parameters:
row - the row
rect - the rectangle

getLevelSeparation

public float getLevelSeparation()
Returns:
Returns the levelSeparation.

setLevelSeparation

public void setLevelSeparation(float levelSeparation)
Parameters:
levelSeparation - The levelSeparation to set.

getSiblingSeparation

public float getSiblingSeparation()
Returns:
Returns the siblingSeparation.

setSiblingSeparation

public void setSiblingSeparation(float siblingSeparation)
Parameters:
siblingSeparation - The siblingSeparation to set.

getSubtreeSeparation

public float getSubtreeSeparation()
Returns:
Returns the subtreeSeparation.

setSubtreeSeparation

public void setSubtreeSeparation(float subtreeSeparation)
Parameters:
subtreeSeparation - The subtreeSeparation to set.


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