Class prominence.chat.Registry
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class prominence.chat.Registry

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Panel
                           |
                           +----prominence.chat.Registry

public class Registry
extends Panel
implements Client
A registry of clients connected to the server; this is a Panel that implements the Client interface and contains a List of connected users and a Button to clear the current selection.

This class parses messages from a ChatSystemHandler directed to the "registry" tool, and maintains a client-list based on this information.

See Also:
ChatSystemHandler

Variable Index

 o list
The List component.

Constructor Index

 o Registry()
Creates a new Registry which contains an empty List of client names and a Button to clear the current selection.

Method Index

 o action(Event, Object)
Processes the clear Button.
 o disconnected()
Disconnects this tool; for this class, this has no effect.
 o receive(DataInputStream)
Receives a message from the ChatSystemHandler, and updates the client list accordingly.
 o setMessageOutput(MessageOutput)
Assigns a message stream over which this tool can communicate.
 o targets()
Returns a list of the currently selected client names.

Variables

 o list
  protected List list
The List component.

Constructors

 o Registry
  public Registry()
Creates a new Registry which contains an empty List of client names and a Button to clear the current selection.

Methods

 o setMessageOutput
  public void setMessageOutput(MessageOutput o)
Assigns a message stream over which this tool can communicate. This tool sends no messages, so we ignore this method.
 o receive
  public void receive(DataInputStream i)
Receives a message from the ChatSystemHandler, and updates the client list accordingly.

Messages consist of a boolean flag indicating whether the clients are joining or leaving, followed by a list of client names.

Parameters:
i - A stream from which the message can be read
 o disconnected
  public void disconnected()
Disconnects this tool; for this class, this has no effect.
 o action
  public boolean action(Event e,
                        Object what)
Processes the clear Button.
Overrides:
action in class Component
 o targets
  public String[] targets()
Returns a list of the currently selected client names.
Returns:
An array of Strings

All Packages  Class Hierarchy  This Package  Previous  Next  Index