brain.NetClient
Class RobotClient

java.lang.Object
  extended by biocell.BioCell
      extended by brain.NetClient.RobotClient
All Implemented Interfaces:
java.awt.event.ActionListener, java.util.EventListener, MNSListener

public class RobotClient
extends BioCell
implements java.awt.event.ActionListener, MNSListener

Author: Randall Borck Modified: 11-8-01 Assignment: CS442 Networking chat program. (Prog. assign. #2) Description: Program implements a UDP chat client on port 7000. Hard-coded server ip address is 137.229.114.140.


Constructor Summary
RobotClient()
           
RobotClient(javax.swing.JTextArea response, javax.swing.JTextField message, RobotClientListener listener)
           
RobotClient(RobotClientListener listener)
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent event)
           
 void fileSend(java.lang.String filename, java.lang.String recipient)
           
 void process(MNSEvent mnEvent)
          loads a CNSEvent into a listener
 void sendClientEvent(java.lang.String message)
          Gets input from user.
 void sendClientInform(java.lang.String message)
          Gets input from user.
 void sendMessage()
          Gets input from user.
protected  void showComm(java.lang.Object message)
           
 void startClient()
           
 void whisperMethod()
          Whispers the input to the designated user.
 void whoInquire()
          Implements the client side of the "WHO" command.
 
Methods inherited from class biocell.BioCell
getCurrentmood, getMoodParam, getstate, setMood, stepEnergy
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RobotClient

public RobotClient(javax.swing.JTextArea response,
                   javax.swing.JTextField message,
                   RobotClientListener listener)

RobotClient

public RobotClient(RobotClientListener listener)

RobotClient

public RobotClient()
Method Detail

startClient

public void startClient()

process

public void process(MNSEvent mnEvent)
Description copied from interface: MNSListener
loads a CNSEvent into a listener

Specified by:
process in interface MNSListener

actionPerformed

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

sendMessage

public void sendMessage()
Gets input from user. Sends input with the "BROADCAST" server command.


sendClientInform

public void sendClientInform(java.lang.String message)
Gets input from user. Sends input with the "INFORM" server command. This tag is the communication protocol for common events of any robotclient


sendClientEvent

public void sendClientEvent(java.lang.String message)
Gets input from user. Sends input with the "BROADCAST" server command.


showComm

protected void showComm(java.lang.Object message)

whisperMethod

public void whisperMethod()
Whispers the input to the designated user.


fileSend

public void fileSend(java.lang.String filename,
                     java.lang.String recipient)

whoInquire

public void whoInquire()
Implements the client side of the "WHO" command.