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

Variable Index

 o TAG_BASE_X
 o TAG_BASE_Y
 o TAG_DIF_X
 o TAG_DIF_Y
 o TAG_MAX_X
 o TAG_MAX_Y

Constructor Index

 o ASCIITreeGraphics()
Initializes the graphics routines with an empty tree

Method Index

 o DrawInternal(String, String)
Draws an internal node to standard output.
 o DrawInternal(String)
Draws an internal node to standard output.
 o DrawLeaf(String)
Draws a leaf to standard output.
 o DrawLeaf()
Draws a leaf to standard output.
 o main(String[])

Variables

 o TAG_DIF_X
  public final static int TAG_DIF_X
 o TAG_BASE_X
  public final static int TAG_BASE_X
 o TAG_DIF_Y
  public final static int TAG_DIF_Y
 o TAG_BASE_Y
  public final static int TAG_BASE_Y
 o TAG_MAX_X
  public final static int TAG_MAX_X
 o TAG_MAX_Y
  public final static int TAG_MAX_Y

Constructors

 o ASCIITreeGraphics
  public ASCIITreeGraphics()
Initializes the graphics routines with an empty tree

Methods

 o 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
 o DrawInternal
  public void DrawInternal(String nodeLabel)
Draws an internal node to standard output.
Parameters:
nodeLabel - the label for the internal node
 o DrawLeaf
  public void DrawLeaf(String color)
Draws a leaf to standard output.
Overrides:
DrawLeaf in class TreeGraphics
 o DrawLeaf
  public void DrawLeaf()
Draws a leaf to standard output.
 o main
  public static void main(String args[])

All Packages  Class Hierarchy  This Package  Previous  Next  Index