Treeviz 0.37 2010-10-17

ch.randelshofer.tree.rectmap
Class RectmapDraw

java.lang.Object
  extended by ch.randelshofer.tree.rectmap.RectmapDraw

public class RectmapDraw
extends java.lang.Object

RectmapDraw draws a RectmapTree.

Can draw a subtree from any node within the tree.

Author:
Werner Randelshofer  @version 1.2 2009-01-30 Added maxDepth property.
1.1 2008-07-04 Draw asynchronously.
1.0 Jan 16, 2008 Created.

Constructor Summary
RectmapDraw(RectmapNode root, NodeInfo info)
           
RectmapDraw(RectmapTree model)
           
 
Method Summary
 void drawContours(java.awt.Graphics2D g, RectmapNode node, java.awt.Color color)
           
 void drawLabel(java.awt.Graphics2D g, RectmapNode node, int depth, double px, double py, double sfh, double sfv)
           
 void drawNode(java.awt.Graphics2D g, RectmapNode node, int depth, double px, double py, double sfh, double sfv)
           
 void drawNodeBounds(java.awt.Graphics2D g, RectmapNode selectedNode, java.awt.Color color)
           
 void drawTree(java.awt.Graphics2D g, ProgressObserver p)
          Draws the tree onto the supplied graphics object.
 void drawTree0(java.awt.Graphics2D g, RectmapNode node, int depth, double px, double py, double pwidth, double pheight, ProgressObserver p)
          Recursive part of the drawing routine.
 RectmapNode getDrawRoot()
           
 double getHeight()
           
 NodeInfo getInfo()
           
 int getMaxDepth()
           
 RectmapNode getNodeAt(double px, double py)
          Returns the node at the specified draw coordinates.
 RectmapNode getNodeAt(int px, int py)
          Returns the node at the specified view coordinates.
 RectmapNode getRoot()
           
 double getWidth()
           
 double getX()
           
 double getY()
           
 void setDrawRoot(RectmapNode newValue)
           
 void setHeight(double newValue)
           
 void setMaxDepth(int newValue)
           
 void setWidth(double newValue)
           
 void setX(double newValue)
           
 void setY(double newValue)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RectmapDraw

public RectmapDraw(RectmapTree model)

RectmapDraw

public RectmapDraw(RectmapNode root,
                   NodeInfo info)
Method Detail

getX

public double getX()

setX

public void setX(double newValue)

getMaxDepth

public int getMaxDepth()

setMaxDepth

public void setMaxDepth(int newValue)

getY

public double getY()

setY

public void setY(double newValue)

getWidth

public double getWidth()

setWidth

public void setWidth(double newValue)

getHeight

public double getHeight()

setHeight

public void setHeight(double newValue)

drawTree

public void drawTree(java.awt.Graphics2D g,
                     ProgressObserver p)
Draws the tree onto the supplied graphics object.


drawTree0

public void drawTree0(java.awt.Graphics2D g,
                      RectmapNode node,
                      int depth,
                      double px,
                      double py,
                      double pwidth,
                      double pheight,
                      ProgressObserver p)
Recursive part of the drawing routine.


drawNode

public void drawNode(java.awt.Graphics2D g,
                     RectmapNode node,
                     int depth,
                     double px,
                     double py,
                     double sfh,
                     double sfv)

drawLabel

public void drawLabel(java.awt.Graphics2D g,
                      RectmapNode node,
                      int depth,
                      double px,
                      double py,
                      double sfh,
                      double sfv)

drawContours

public void drawContours(java.awt.Graphics2D g,
                         RectmapNode node,
                         java.awt.Color color)

getInfo

public NodeInfo getInfo()

getRoot

public RectmapNode getRoot()

getDrawRoot

public RectmapNode getDrawRoot()

setDrawRoot

public void setDrawRoot(RectmapNode newValue)

drawNodeBounds

public void drawNodeBounds(java.awt.Graphics2D g,
                           RectmapNode selectedNode,
                           java.awt.Color color)

getNodeAt

public RectmapNode getNodeAt(int px,
                             int py)
Returns the node at the specified view coordinates.

Parameters:
px -
py -
Returns:

getNodeAt

public RectmapNode getNodeAt(double px,
                             double py)
Returns the node at the specified draw coordinates.


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