Treeviz 0.37 2010-10-17

ch.randelshofer.tree.sunburst
Class SunburstDraw

java.lang.Object
  extended by ch.randelshofer.tree.sunburst.SunburstDraw

public class SunburstDraw
extends java.lang.Object

SunburstDraw draws a SunburstTree.

Can draw the tree from any node within the tree.

Version:
1.0 September 18, 2007 Created.
Author:
Werner Randelshofer

Constructor Summary
SunburstDraw(SunburstNode root, NodeInfo info)
           
SunburstDraw(SunburstTree model)
          Creates a new instance.
 
Method Summary
static void addSeg(java.awt.geom.GeneralPath mc, double x, double y, double startAngle, double arc, double radius)
           
static java.awt.geom.GeneralPath createArc(double x, double y, double startAngle, double arc, double outerRadius, double innerRadius)
           
 void drawContours(java.awt.Graphics2D g, SunburstNode node, java.awt.Color color)
           
 void drawDescendants(java.awt.Graphics2D g, SunburstNode node, ProgressObserver p)
           
 void drawDescendantSubtreeBounds(java.awt.Graphics2D g, SunburstNode parent, java.awt.Color color)
           
 void drawLabel(java.awt.Graphics2D g, SunburstNode node)
           
 void drawNode(java.awt.Graphics2D g, SunburstNode node)
           
 void drawNodeBounds(java.awt.Graphics2D g, SunburstNode selectedNode, java.awt.Color color)
           
 void drawSubtreeBounds(java.awt.Graphics2D g, SunburstNode selectedNode, java.awt.Color color)
           
 void drawTree(java.awt.Graphics2D g, ProgressObserver p)
          Draws the Sunburst tree onto the supplied graphics object.
 void drawTree(java.awt.Graphics2D g, SunburstNode node, ProgressObserver p)
           
 double getCX()
           
 double getCY()
           
 NodeInfo getInfo()
           
 double getInnerRadius()
           
 SunburstNode getNodeAt(int x, int y)
           
 double getOuterRadius()
           
 SunburstNode getRoot()
           
 double getRotation()
           
 double getTheta(double x, double y)
          Converts screen coordinates to polar coordinates in degrees.
 java.lang.String getToolTipText(int x, int y)
           
 int getTotalDepth()
           
 void setCX(double newValue)
           
 void setCY(double newValue)
           
 void setInnerRadius(double newValue)
           
 void setOuterRadius(double newValue)
           
 void setRotation(double newValue)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SunburstDraw

public SunburstDraw(SunburstTree model)
Creates a new instance.


SunburstDraw

public SunburstDraw(SunburstNode root,
                    NodeInfo info)
Method Detail

getInfo

public NodeInfo getInfo()

getRoot

public SunburstNode getRoot()

getRotation

public double getRotation()

setRotation

public void setRotation(double newValue)

getTotalDepth

public int getTotalDepth()

getCX

public double getCX()

setCX

public void setCX(double newValue)

getCY

public double getCY()

setCY

public void setCY(double newValue)

getInnerRadius

public double getInnerRadius()

setInnerRadius

public void setInnerRadius(double newValue)

getOuterRadius

public double getOuterRadius()

setOuterRadius

public void setOuterRadius(double newValue)

getTheta

public double getTheta(double x,
                       double y)
Converts screen coordinates to polar coordinates in degrees.


getNodeAt

public SunburstNode getNodeAt(int x,
                              int y)

getToolTipText

public java.lang.String getToolTipText(int x,
                                       int y)

drawNodeBounds

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

drawSubtreeBounds

public void drawSubtreeBounds(java.awt.Graphics2D g,
                              SunburstNode selectedNode,
                              java.awt.Color color)

drawDescendantSubtreeBounds

public void drawDescendantSubtreeBounds(java.awt.Graphics2D g,
                                        SunburstNode parent,
                                        java.awt.Color color)

createArc

public static java.awt.geom.GeneralPath createArc(double x,
                                                  double y,
                                                  double startAngle,
                                                  double arc,
                                                  double outerRadius,
                                                  double innerRadius)

addSeg

public static void addSeg(java.awt.geom.GeneralPath mc,
                          double x,
                          double y,
                          double startAngle,
                          double arc,
                          double radius)

drawTree

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


drawTree

public void drawTree(java.awt.Graphics2D g,
                     SunburstNode node,
                     ProgressObserver p)

drawContours

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

drawDescendants

public void drawDescendants(java.awt.Graphics2D g,
                            SunburstNode node,
                            ProgressObserver p)

drawLabel

public void drawLabel(java.awt.Graphics2D g,
                      SunburstNode node)

drawNode

public void drawNode(java.awt.Graphics2D g,
                     SunburstNode node)

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