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
-
list
- The List component.
-
Registry()
- Creates a new Registry which contains an empty
List of client names and a Button to
clear the current selection.
-
action(Event, Object)
- Processes the clear Button.
-
disconnected()
- Disconnects this tool; for this class, this has no effect.
-
receive(DataInputStream)
- Receives a message from the ChatSystemHandler, and
updates the client list accordingly.
-
setMessageOutput(MessageOutput)
- Assigns a message stream over which this tool can communicate.
-
targets()
- Returns a list of the currently selected client names.
list
protected List list
- The List component.
Registry
public Registry()
- Creates a new Registry which contains an empty
List of client names and a Button to
clear the current selection.
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.
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
disconnected
public void disconnected()
- Disconnects this tool; for this class, this has no effect.
action
public boolean action(Event e,
Object what)
- Processes the clear Button.
- Overrides:
- action in class Component
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