net.slashie.libjcsi.textcomponents
Class TextBox

java.lang.Object
  extended by net.slashie.libjcsi.textcomponents.TextComponent
      extended by net.slashie.libjcsi.textcomponents.TextBox
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
DialogBox

public class TextBox
extends TextComponent

Provides a means to put output into a specific box.

Author:
Santiago Zapata, Eben Howard
See Also:
Serialized Form

Field Summary
static java.lang.String BEOL
           
 
Constructor Summary
TextBox(ConsoleSystemInterface si)
          Allows creation of a new TextBox
 
Method Summary
 void clear()
          Empties the box but does not erase the box itself.
 void draw()
          Outputs box to interface.
 void setBorder(boolean value)
          Allows for setting a border.
 void setHeight(int value)
           
 void setText(java.lang.String text)
           
 void setTitle(java.lang.String pTitle)
          Sets the title of the box, displayed in the top border.
 
Methods inherited from class net.slashie.libjcsi.textcomponents.TextComponent
clearBox, drawBorder, getForeColor, getHeight, getWidth, hasBorder, setBorderColor, setBorderColor, setBounds, setForeColor, setForeColor, setPosition, setWidth
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BEOL

public static final java.lang.String BEOL
See Also:
Constant Field Values
Constructor Detail

TextBox

public TextBox(ConsoleSystemInterface si)
Allows creation of a new TextBox

Parameters:
si - the ConsoleSystemInterface that this box will be attached to
Method Detail

setHeight

public void setHeight(int value)
Overrides:
setHeight in class TextComponent
Parameters:
value - The height of the box

setBorder

public void setBorder(boolean value)
Allows for setting a border.

Overrides:
setBorder in class TextComponent
Parameters:
value - true if border desired

draw

public void draw()
Outputs box to interface.

Specified by:
draw in class TextComponent

setText

public void setText(java.lang.String text)
Parameters:
text - String that is the contents desired.

setTitle

public void setTitle(java.lang.String pTitle)
Sets the title of the box, displayed in the top border. Does not check to see if box is wide enough for the title to appear in the border, so such a check must be done externaly.

Parameters:
pTitle - title for box

clear

public void clear()
Empties the box but does not erase the box itself.