net.jinx.video
Class MessageView

java.lang.Object
  extended by net.jinx.video.View2D
      extended by net.jinx.video.MessageView
All Implemented Interfaces:
View, Visible

public class MessageView
extends View2D
implements Visible

View2D extension that provides a console-like text area.

API Stability: Stable.


Constructor Summary
MessageView(float columns, float rows, java.awt.Color bcolor, java.awt.Color color)
          Constructs a MessageView with the given number of columns, rows, foreground color and background color.
 
Method Summary
 void deinit(Context opt)
          Deinitializes this View.
 void draw(Context opt)
          Draws the console along with it's message.
 Visible getVisible()
          The Visible for a MessageView is itself.
 void init(Context opt)
          Initializes this View.
 void setMessage(java.lang.CharSequence text)
          Sets the sequence of characters to use as the message.
 
Methods inherited from class net.jinx.video.View2D
getBottom, getLeft, getRight, getTop, view
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MessageView

public MessageView(float columns,
                   float rows,
                   java.awt.Color bcolor,
                   java.awt.Color color)
Constructs a MessageView with the given number of columns, rows, foreground color and background color.

Parameters:
columns - the number of characters across.
rows - the number of rows from top to bottom.
bcolor - the background color for the View.
color - the text color.
Method Detail

init

public void init(Context opt)
Description copied from interface: View
Initializes this View. happen.

Specified by:
init in interface View
Specified by:
init in interface Visible
Overrides:
init in class View2D
Parameters:
opt - the Context object providing data on how rendering should proceed.

deinit

public void deinit(Context opt)
Description copied from interface: View
Deinitializes this View.

Specified by:
deinit in interface View
Specified by:
deinit in interface Visible
Overrides:
deinit in class View2D
Parameters:
opt - the Context object providing data on how rendering should proceed.

draw

public void draw(Context opt)
Draws the console along with it's message.

Specified by:
draw in interface Visible
Parameters:
opt - the Context object containing the rendering options.

setMessage

public void setMessage(java.lang.CharSequence text)
Sets the sequence of characters to use as the message.

Parameters:
text - the message to use. This can contain carriage returns and line feeds, which will be handled properly.

getVisible

public Visible getVisible()
The Visible for a MessageView is itself.

Specified by:
getVisible in interface View
Overrides:
getVisible in class View2D
Returns:
this.