Class mjr.treegraphics.ASCIITreeGraphics
All Packages Class Hierarchy This Package Previous Next Index
Class mjr.treegraphics.ASCIITreeGraphics
java.lang.Object
|
+----mjr.treegraphics.TreeGraphics
|
+----mjr.treegraphics.ASCIITreeGraphics
- public class ASCIITreeGraphics
- extends TreeGraphics
The graphics driver for an ASCII tree.
The TreeGraphics routines work by getting from you a pre-order
traversal of your tree (root-left-right), in terms of calls to
DrawInternal
and DrawLeaf
. The exact
semantics of these calls are:
ASCIITreeGraphics.DrawInternal(String nodeLabel);
ASCIITreeGraphics.DrawLeaf();
This code was ported by
mjr
from the pascal source written by
bmc.
- See Also:
- TreeGraphics
-
TAG_BASE_X
-
-
TAG_BASE_Y
-
-
TAG_DIF_X
-
-
TAG_DIF_Y
-
-
TAG_MAX_X
-
-
TAG_MAX_Y
-
-
ASCIITreeGraphics()
- Initializes the graphics routines with an empty tree
-
DrawInternal(String, String)
- Draws an internal node to standard output.
-
DrawInternal(String)
- Draws an internal node to standard output.
-
DrawLeaf(String)
- Draws a leaf to standard output.
-
DrawLeaf()
- Draws a leaf to standard output.
-
main(String[])
-
TAG_DIF_X
public final static int TAG_DIF_X
TAG_BASE_X
public final static int TAG_BASE_X
TAG_DIF_Y
public final static int TAG_DIF_Y
TAG_BASE_Y
public final static int TAG_BASE_Y
TAG_MAX_X
public final static int TAG_MAX_X
TAG_MAX_Y
public final static int TAG_MAX_Y
ASCIITreeGraphics
public ASCIITreeGraphics()
- Initializes the graphics routines with an empty tree
DrawInternal
public void DrawInternal(String nodeLabel,
String color)
- Draws an internal node to standard output.
- Parameters:
- nodeLabel - the label for the internal node
- Overrides:
- DrawInternal in class TreeGraphics
DrawInternal
public void DrawInternal(String nodeLabel)
- Draws an internal node to standard output.
- Parameters:
- nodeLabel - the label for the internal node
DrawLeaf
public void DrawLeaf(String color)
- Draws a leaf to standard output.
- Overrides:
- DrawLeaf in class TreeGraphics
DrawLeaf
public void DrawLeaf()
- Draws a leaf to standard output.
main
public static void main(String args[])
All Packages Class Hierarchy This Package Previous Next Index