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
-
WalTreeCanvas()
- Constructs new WalTreeCanvas, an associated WTFactory, and inits state.
-
makeNode(String, WNode, WNode, WNode)
- Create a new node with the given attributes, calculating width
to match the displayed node name text.
-
makeNodeOfWidth(String, int, WNode, WNode, WNode)
- Create a new node with the given attributes and the specified width.
-
minimumSize()
-
-
paint(Graphics)
- Draw the tree associated with this canvas.
-
preferredSize()
-
-
setDefaultBorder(int)
- Set the default border size for nodes
-
setParentDistance(int)
- Set the distance between parent nodes.
-
setRootOffset(int)
- Set the horizontal offset between edge of canvas and root node.
-
setTree(WNode)
- Set the tree to be displayed by this canvas.
WalTreeCanvas
public WalTreeCanvas()
- Constructs new WalTreeCanvas, an associated WTFactory, and inits state.
preferredSize
public Dimension preferredSize()
- Overrides:
- preferredSize in class Component
minimumSize
public Dimension minimumSize()
- Overrides:
- minimumSize in class Component
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.
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.
setTree
public void setTree(WNode t)
- Set the tree to be displayed by this canvas.
setDefaultBorder
public void setDefaultBorder(int b)
- Set the default border size for nodes
setParentDistance
public void setParentDistance(int val)
- Set the distance between parent nodes.
setRootOffset
public void setRootOffset(int val)
- Set the horizontal offset between edge of canvas and root node.
paint
public void paint(Graphics g)
- Draw the tree associated with this canvas.
- Overrides:
- paint in class Canvas