wabadma.ui
Class OutputBox

java.lang.Object
  |
  +--waba.ui.Control
        |
        +--waba.ui.Container
              |
              +--wabadma.ui.OutputBox

public class OutputBox
extends waba.ui.Container

A waba container providing text output.

Version:
0.2, 2000 Nov 21 - added printFormattedStringArray & printFormatted.
Author:
David M. Archer

Field Summary
static int BEHAVIOUR_AUTOCLEAR
          Behaviour of OutputBox is to clear & return to top when the bottom is reached.
static int STYLE_CENTERED
          Style of a line's text is centered.
static int STYLE_NORMAL
          Style of a line's text is normal (left-justified).
 
Fields inherited from class waba.ui.Container
children, tail
 
Fields inherited from class waba.ui.Control
height, next, parent, prev, width, x, y
 
Constructor Summary
OutputBox(int x, int y, int w, int h)
          Construct an OutputBox with the given metrics using a default font.
OutputBox(int x, int y, int w, int h, waba.fx.Font font)
          Construct an OutputBox with the given metrics and given font.
 
Method Summary
 void clear()
          Clear the OutputBox.
 boolean isActive()
          Return true if the Dialog is currently being displayed.
 void onPaint(waba.fx.Graphics g)
           
 void printFormatted(java.lang.String s)
          Print a pre-formatted string to the OutputBox using STYLE_NORMAL.
 void printFormattedStringArray(java.lang.String[] sa)
          Print an array of pre-formatted strings to the OutputBox using STYLE_NORMAL.
 void println()
          Print an empty line.
 void println(java.lang.String s)
          Print a line to the OutputBox.
 void printlnCentered(java.lang.String s)
          Print a centered line to the OutputBox.
 void printlnStyled(java.lang.String string, int style)
          Print a styled line.
 
Methods inherited from class waba.ui.Container
add, findChild, paintChildren, remove
 
Methods inherited from class waba.ui.Control
addTimer, contains, createGraphics, getFontMetrics, getNext, getParent, getRect, onEvent, postEvent, removeTimer, repaint, setRect
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BEHAVIOUR_AUTOCLEAR

public static final int BEHAVIOUR_AUTOCLEAR
Behaviour of OutputBox is to clear & return to top when the bottom is reached. (Currently this is the only available behaviour.

STYLE_NORMAL

public static final int STYLE_NORMAL
Style of a line's text is normal (left-justified).

STYLE_CENTERED

public static final int STYLE_CENTERED
Style of a line's text is centered.
Constructor Detail

OutputBox

public OutputBox(int x,
                 int y,
                 int w,
                 int h,
                 waba.fx.Font font)
Construct an OutputBox with the given metrics and given font.

OutputBox

public OutputBox(int x,
                 int y,
                 int w,
                 int h)
Construct an OutputBox with the given metrics using a default font.
Method Detail

isActive

public boolean isActive()
Return true if the Dialog is currently being displayed.

printlnStyled

public void printlnStyled(java.lang.String string,
                          int style)
Print a styled line.
Parameters:
string - String to print
style - style to use
See Also:
STYLE_NORMAL, STYLE_CENTERED

printlnCentered

public void printlnCentered(java.lang.String s)
Print a centered line to the OutputBox.

println

public void println(java.lang.String s)
Print a line to the OutputBox.

printFormattedStringArray

public void printFormattedStringArray(java.lang.String[] sa)
Print an array of pre-formatted strings to the OutputBox using STYLE_NORMAL.

printFormatted

public void printFormatted(java.lang.String s)
Print a pre-formatted string to the OutputBox using STYLE_NORMAL.

println

public void println()
Print an empty line.

clear

public void clear()
Clear the OutputBox.

onPaint

public void onPaint(waba.fx.Graphics g)
Overrides:
onPaint in class waba.ui.Control