megamek.client.ui.AWT
Class ChatterBox

java.lang.Object
  extended by megamek.client.ui.AWT.ChatterBox
All Implemented Interfaces:
java.awt.event.KeyListener, java.util.EventListener

public class ChatterBox
extends java.lang.Object
implements java.awt.event.KeyListener

ChatterBox keeps track of a player list and a (chat) message buffer. Although it is not an AWT component, it keeps one that it will gladly supply.


Field Summary
(package private)  java.awt.TextArea chatArea
           
 java.lang.String[] chatBuffer
           
 java.awt.Panel chatPanel
           
 Client client
           
(package private)  java.awt.List playerList
           
 
Constructor Summary
ChatterBox(ClientGUI clientgui)
           
 
Method Summary
 java.awt.Component getComponent()
          Returns the "box" component with all teh stuff
 void keyPressed(java.awt.event.KeyEvent ev)
           
 void keyReleased(java.awt.event.KeyEvent ev)
           
 void keyTyped(java.awt.event.KeyEvent ev)
           
 void moveToEnd()
          Tries to scroll down to the end of the box
 void setDoneButton(java.awt.Button button)
          Replace the "Done" button in the chat box.
 void systemMessage(java.lang.String message)
          Display a system message in the chat box.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

client

public Client client

chatBuffer

public java.lang.String[] chatBuffer

chatPanel

public java.awt.Panel chatPanel

chatArea

java.awt.TextArea chatArea

playerList

java.awt.List playerList
Constructor Detail

ChatterBox

public ChatterBox(ClientGUI clientgui)
Method Detail

moveToEnd

public void moveToEnd()
Tries to scroll down to the end of the box


getComponent

public java.awt.Component getComponent()
Returns the "box" component with all teh stuff


systemMessage

public void systemMessage(java.lang.String message)
Display a system message in the chat box.

Parameters:
message - the String message to be shown.

setDoneButton

public void setDoneButton(java.awt.Button button)
Replace the "Done" button in the chat box.

Parameters:
button - the Button that should be used for "Done".

keyPressed

public void keyPressed(java.awt.event.KeyEvent ev)
Specified by:
keyPressed in interface java.awt.event.KeyListener

keyReleased

public void keyReleased(java.awt.event.KeyEvent ev)
Specified by:
keyReleased in interface java.awt.event.KeyListener

keyTyped

public void keyTyped(java.awt.event.KeyEvent ev)
Specified by:
keyTyped in interface java.awt.event.KeyListener