Treeviz 0.37 2010-10-17

ch.randelshofer.tree.rectmap
Class RectmapNode

java.lang.Object
  extended by java.awt.geom.RectangularShape
      extended by java.awt.geom.Rectangle2D
          extended by java.awt.geom.Rectangle2D.Double
              extended by ch.randelshofer.tree.rectmap.RectmapNode
All Implemented Interfaces:
java.awt.Shape, java.io.Serializable, java.lang.Cloneable
Direct Known Subclasses:
RectmapCompositeNode

public class RectmapNode
extends java.awt.geom.Rectangle2D.Double

The RectmapNode encapsulatets a TreeNode whithin a RectmapTree.

It holds the width and height of the node as an absolute value. The location is held relative to the location of the parent node.

This node can layout its subtree in a space-filling rectangular treemap.

Version:
1.2 2009-03-22 Made layout progress observable.
1.0 Jan 16, 2008 Created.
Author:
Werner Randelshofer
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.awt.geom.Rectangle2D
java.awt.geom.Rectangle2D.Double, java.awt.geom.Rectangle2D.Float
 
Field Summary
protected  double cumulatedWeight
           
protected  TreePath2<TreeNode> dataNodePath
           
protected  RectmapNode parent
           
 
Fields inherited from class java.awt.geom.Rectangle2D.Double
height, width, x, y
 
Fields inherited from class java.awt.geom.Rectangle2D
OUT_BOTTOM, OUT_LEFT, OUT_RIGHT, OUT_TOP
 
Constructor Summary
RectmapNode(RectmapNode parent, TreeNode data)
           
 
Method Summary
 java.util.List<RectmapNode> children()
           
 double getCumulatedWeight()
           
 TreePath2<TreeNode> getDataNodePath()
           
 int getDescendantCount()
           
 RectmapNode getParent()
           
 boolean isLeaf()
           
 void layout(ProgressObserver p)
          Lays out the subtree starting at this node in a space-filling rectangular treemap.
 java.lang.String toString()
           
 void updateCumulatedWeight(NodeInfo info)
           
 
Methods inherited from class java.awt.geom.Rectangle2D.Double
createIntersection, createUnion, getBounds2D, getHeight, getWidth, getX, getY, isEmpty, outcode, setRect, setRect
 
Methods inherited from class java.awt.geom.Rectangle2D
add, add, add, contains, contains, equals, getPathIterator, getPathIterator, hashCode, intersect, intersects, intersectsLine, intersectsLine, outcode, setFrame, union
 
Methods inherited from class java.awt.geom.RectangularShape
clone, contains, contains, getBounds, getCenterX, getCenterY, getFrame, getMaxX, getMaxY, getMinX, getMinY, intersects, setFrame, setFrame, setFrameFromCenter, setFrameFromCenter, setFrameFromDiagonal, setFrameFromDiagonal
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

parent

protected RectmapNode parent

dataNodePath

protected TreePath2<TreeNode> dataNodePath

cumulatedWeight

protected double cumulatedWeight
Constructor Detail

RectmapNode

public RectmapNode(RectmapNode parent,
                   TreeNode data)
Method Detail

children

public java.util.List<RectmapNode> children()

isLeaf

public boolean isLeaf()

getDataNodePath

public TreePath2<TreeNode> getDataNodePath()

layout

public void layout(ProgressObserver p)
Lays out the subtree starting at this node in a space-filling rectangular treemap.

Note: You must call updateCumulatedWeight before you can layout a node.


getParent

public RectmapNode getParent()

updateCumulatedWeight

public void updateCumulatedWeight(NodeInfo info)

getCumulatedWeight

public double getCumulatedWeight()

getDescendantCount

public int getDescendantCount()

toString

public java.lang.String toString()
Overrides:
toString in class java.awt.geom.Rectangle2D.Double

Copyright 2007-2008 (c) Werner Randelshofer.
All rights reserved.