HooChat
Class HooMessenger

java.lang.Object
  |
  +--HooChat.HooMessenger
All Implemented Interfaces:
Runnable

public class HooMessenger
extends Object
implements Runnable

This class encapsulates the methods and members necessary to create a messenger object. In this class you create a buddyList, messageFrame (IM window) and login screen. Also, this class holds references, which it feeds to its local objects, to the appropriate listener callback obj., listener and message server.


Constructor Summary
HooMessenger(MessageServer m, HydraClient hRef)
          Creates a new instance of GraphicsModule CRock: Added a fun filled extra thread to replace that crap that Hooman was running for Timers and Tasks....
 
Method Summary
 void activateBeamer()
          This method shows the beamer object
 void addToMessageBuf(String msg)
          Add another message received to the buffer holding all the messages
 void beam(String destination)
          This method beams the client to the selected destination using the hydraClient
 Vector getBuddyVec()
          This method gets the most recent list of clients using the server from the message server
 String getUsername()
          This method returns the username of the person using the client program
 void init()
          This method initializes the visibility of all our friendly graphics, specifically the Beamer, BuddyList, MessageFrame (i.e.
 void login(String u, String p)
          This method lets the client login with a username,password pair.
 void logOff()
          This method lets the client logOff with a (username,password) pair.
 void run()
          This run thread will do ALL of that polling crap we need to have done for the chat client (all the stuff in checkIn is now here....
 void send(String msg)
          This method sends a message to everyone in the chatroom
 void setState(Vector stateVec)
          This method sets all the state in the program from the given vector
 void suspend()
          This method puts the program into suspend mode.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HooMessenger

public HooMessenger(MessageServer m,
                    HydraClient hRef)
Creates a new instance of GraphicsModule CRock: Added a fun filled extra thread to replace that crap that Hooman was running for Timers and Tasks.... much cleaner! And it fixes bugs!

Method Detail

init

public void init()
This method initializes the visibility of all our friendly graphics, specifically the Beamer, BuddyList, MessageFrame (i.e. IM Window) and LoginScreen

Returns:
void

setState

public void setState(Vector stateVec)
This method sets all the state in the program from the given vector

Parameters:
stateVec - the vector containing all the state information required to wake a sleepy messenger. The vector is in the following format: 0: vector containing the messageFrame 1: vector containing the username 2: vector containing the password
Returns:
void

login

public void login(String u,
                  String p)
This method lets the client login with a username,password pair.

Returns:
void

logOff

public void logOff()
This method lets the client logOff with a (username,password) pair.

Returns:
void

getBuddyVec

public Vector getBuddyVec()
This method gets the most recent list of clients using the server from the message server

Returns:
Vector

addToMessageBuf

public void addToMessageBuf(String msg)
Add another message received to the buffer holding all the messages

Parameters:
msg - the message that to add to the buffer
Returns:
void

activateBeamer

public void activateBeamer()
This method shows the beamer object

Returns:
void

beam

public void beam(String destination)
This method beams the client to the selected destination using the hydraClient

Parameters:
destination - the name of the client you are sending to
Returns:
void

suspend

public void suspend()
This method puts the program into suspend mode. Basically, this means that all the forms will be hidden and the program will be standing by for transport. You can either start the program in this mode or put the program in suspend to beam. This function will deal with both cases.

Returns:
void

getUsername

public String getUsername()
This method returns the username of the person using the client program

Returns:
String

send

public void send(String msg)
This method sends a message to everyone in the chatroom

Returns:
void

run

public void run()
This run thread will do ALL of that polling crap we need to have done for the chat client (all the stuff in checkIn is now here.... BITCH

Specified by:
run in interface Runnable