Class prominence.chat.Chatboard
All Packages Class Hierarchy This Package Previous Next Index
Class prominence.chat.Chatboard
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Container
|
+----java.awt.Panel
|
+----prominence.chat.Chatboard
- public class Chatboard
- extends Panel
- implements ChatClient
A text-based chat tool; this is a Panel that implements
the ChatClient interface, and is added to the Chat
Frame. Messages from other clients are displayed in a large
TextArea at the top; the user can enter information in a
TextField at the bottom.
- See Also:
- ChatClient, Chat
-
input
- The input region.
-
o
- The outbound message stream.
-
output
- The output region.
-
r
- A registry of users.
-
Chatboard(Registry)
- Creates a new Chatboard with an output TextArea
and an input TextField.
-
action(Event, Object)
- Handles input from the user.
-
disconnected()
- Sets the input TextField to uneditable.
-
preferredSize()
- Returns the preferred size of this component.
-
receive(DataInputStream)
- We implement the ChatClient interface so this method is not
used.
-
receive(DataInputStream, String)
- Receives a message from the peer Chatboard of the indicated
client.
-
setMessageOutput(MessageOutput)
- Assigns a message output stream over which this tool can communicate.
output
protected TextArea output
- The output region.
input
protected TextField input
- The input region.
r
protected Registry r
- A registry of users.
o
protected MessageOutput o
- The outbound message stream.
Chatboard
public Chatboard(Registry r)
- Creates a new Chatboard with an output TextArea
and an input TextField.
A registry of clients is used to determine whether messages should
be broadcast or sent to a specific selection of clients.
- Parameters:
- r - The user registry
setMessageOutput
public void setMessageOutput(MessageOutput o)
- Assigns a message output stream over which this tool can communicate.
This method is called by the GenericClient class with a
message stream that is multiplexed to peer Chatboards
of other clients.
- Parameters:
- o - The message output stream
- See Also:
- GenericClient
receive
public void receive(DataInputStream i)
- We implement the ChatClient interface so this method is not
used.
receive
public void receive(DataInputStream i,
String from)
- Receives a message from the peer Chatboard of the indicated
client.
- Parameters:
- i - A stream from which the message can be read
- from - The name of the message sender
- See Also:
- receive
disconnected
public void disconnected()
- Sets the input TextField to uneditable. This is called when
the server connection is closed, or this tool is deregistered.
- See Also:
- closedown, deregister
preferredSize
public Dimension preferredSize()
- Returns the preferred size of this component.
- Overrides:
- preferredSize in class Container
action
public boolean action(Event e,
Object arg)
- Handles input from the user. Sends a message to the currently selected
users in the client registry.
- Overrides:
- action in class Component
- See Also:
- targets
All Packages Class Hierarchy This Package Previous Next Index