net.slashie.libjcsi.textcomponents
Class TextInformBox

java.lang.Object
  extended by net.slashie.libjcsi.textcomponents.TextComponent
      extended by net.slashie.libjcsi.textcomponents.TextInformBox
All Implemented Interfaces:
java.io.Serializable

public class TextInformBox
extends TextComponent

Represents a text box which can be updated to show a new text along with the old one until it is full, in which case it shows a [More] prompt, waits for a player keypress, erases it selfs and continues exhibiting the same behaviour.

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

Constructor Summary
TextInformBox(ConsoleSystemInterface si)
          Creates new TextInformBox tied to a specific interface.
 
Method Summary
 void addText(java.lang.String text)
          Allows text to be added to the box
 void clear()
          Erases content but leaves box
 void draw()
          Outputs the box to the interface.
 void setHeight(int value)
           
 void setText(java.lang.String text)
          Erases current content and then sets content
 
Methods inherited from class net.slashie.libjcsi.textcomponents.TextComponent
clearBox, drawBorder, getForeColor, getHeight, getWidth, hasBorder, setBorder, setBorderColor, setBorderColor, setBounds, setForeColor, setForeColor, setPosition, setWidth
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextInformBox

public TextInformBox(ConsoleSystemInterface si)
Creates new TextInformBox tied to a specific interface.

Parameters:
si - interface to attach to
Method Detail

setHeight

public void setHeight(int value)
Overrides:
setHeight in class TextComponent
Parameters:
value - vertical height desired

draw

public void draw()
Outputs the box to the interface.

Specified by:
draw in class TextComponent

addText

public void addText(java.lang.String text)
Allows text to be added to the box

Parameters:
text - content to be added

setText

public void setText(java.lang.String text)
Erases current content and then sets content

Parameters:
text - new content

clear

public void clear()
Erases content but leaves box