Class WalTreeCanvas

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Canvas
                   |
                   +----WalTreeCanvas

public class WalTreeCanvas
extends Canvas
Basic canvas for creating and displaying a WalTree. This is part of the WalTree package, created by Walter Korman to enable the visually appealing display of M-ary trees. More documentation is available at his web site; follow the link below to get to it.

Documentation

Author:
Walter Korman

Constructor Index

 o WalTreeCanvas()
Constructs new WalTreeCanvas, an associated WTFactory, and inits state.

Method Index

 o makeNode(String, WNode, WNode, WNode)
Create a new node with the given attributes, calculating width to match the displayed node name text.
 o makeNodeOfWidth(String, int, WNode, WNode, WNode)
Create a new node with the given attributes and the specified width.
 o minimumSize()
 o paint(Graphics)
Draw the tree associated with this canvas.
 o preferredSize()
 o setDefaultBorder(int)
Set the default border size for nodes
 o setParentDistance(int)
Set the distance between parent nodes.
 o setRootOffset(int)
Set the horizontal offset between edge of canvas and root node.
 o setTree(WNode)
Set the tree to be displayed by this canvas.

Constructors

 o WalTreeCanvas
 public WalTreeCanvas()
Constructs new WalTreeCanvas, an associated WTFactory, and inits state.

Methods

 o preferredSize
 public Dimension preferredSize()
Overrides:
preferredSize in class Component
 o minimumSize
 public Dimension minimumSize()
Overrides:
minimumSize in class Component
 o makeNode
 public WNode makeNode(String name,
                       WNode p,
                       WNode c,
                       WNode s)
Create a new node with the given attributes, calculating width to match the displayed node name text.

 o makeNodeOfWidth
 public WNode makeNodeOfWidth(String name,
                              int width,
                              WNode p,
                              WNode c,
                              WNode s)
Create a new node with the given attributes and the specified width.

 o setTree
 public void setTree(WNode t)
Set the tree to be displayed by this canvas.

 o setDefaultBorder
 public void setDefaultBorder(int b)
Set the default border size for nodes

 o setParentDistance
 public void setParentDistance(int val)
Set the distance between parent nodes.

 o setRootOffset
 public void setRootOffset(int val)
Set the horizontal offset between edge of canvas and root node.

 o paint
 public void paint(Graphics g)
Draw the tree associated with this canvas.

Overrides:
paint in class Canvas