com.eriksilkensen.sudoku
Class ChatRoom

java.lang.Object
  extended by com.eriksilkensen.sudoku.ChatRoom
All Implemented Interfaces:
java.awt.event.ActionListener, java.util.EventListener

public class ChatRoom
extends java.lang.Object
implements java.awt.event.ActionListener

ChatRoom is a feature to the Sudoku program that can be used to allow users to send and receive messages to each other while playing a networked, multi- player LAN game of Sudoku. In addition, though, the ChatRoom will display messages from the "Admin" when something happens in the game such as when a user gives up or wins.

ChatRoom doesn't extend JFrame directly, but it does provide some JFrame functionality by composing itself with one and delgating a couple of common JFrame functions to it like setVisible(), setSize(), and pack().

Since:
1.0.4
Version:
04/26/07
Author:
Erik Silkensen

Constructor Summary
ChatRoom(javax.swing.JFrame parent)
          Default - and only - constructor for Objects of type ChatRoom.
 
Method Summary
 void accept(java.lang.String message)
          Accepts a message and appends it to the chat
 void actionPerformed(java.awt.event.ActionEvent evt)
           
 void addClient(java.lang.String client)
          Adds a Client to this ChatRoom
 boolean isVisible()
           
 void pack()
           
 void removeAllClients()
          Removes all of the Clients
 void removeClient(java.lang.String client)
          Removes a Client from this ChatRoom
 void setAllClients(java.util.List<java.lang.String> clients)
          Sets all of the Clients
 void setClient(Client client)
          Sets the Client helper
 void setSize(java.awt.Dimension dim)
           
 void setVisible(boolean visible)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChatRoom

public ChatRoom(javax.swing.JFrame parent)
Default - and only - constructor for Objects of type ChatRoom.

Method Detail

setClient

public void setClient(Client client)
Sets the Client helper


addClient

public void addClient(java.lang.String client)
Adds a Client to this ChatRoom


removeClient

public void removeClient(java.lang.String client)
Removes a Client from this ChatRoom


setAllClients

public void setAllClients(java.util.List<java.lang.String> clients)
Sets all of the Clients


removeAllClients

public void removeAllClients()
Removes all of the Clients


accept

public void accept(java.lang.String message)
Accepts a message and appends it to the chat


actionPerformed

public void actionPerformed(java.awt.event.ActionEvent evt)
Specified by:
actionPerformed in interface java.awt.event.ActionListener

setVisible

public void setVisible(boolean visible)

isVisible

public boolean isVisible()

setSize

public void setSize(java.awt.Dimension dim)

pack

public void pack()