Client
Class ConversationPane

java.lang.Object
  extended by Client.ConversationPane

public class ConversationPane
extends java.lang.Object

Manages a JPanel representing a single conversation tab. Can switch from the "invite" view -- which says "You have been invited [...]" and features buttons to accept or reject the invitation -- to the "conversation" view -- which has all of the necessary buttons, windows, and textfields to manage multiple users having a conversation.


Constructor Summary
ConversationPane(ClientView vi, java.lang.String id)
          Construct a new ConversationPane.
ConversationPane(ClientView vi, java.lang.String id, java.lang.String otheruser)
          For when another user has invited you to a chat.
 
Method Summary
 void addStatement(Statement statement)
          Add a statement to the conversation.
 javax.swing.JPanel getPanel()
           
 void init()
          Settings common to both constructor methods.
 void updateUsers(java.util.List<java.lang.String> users)
          Update the list of users participating in this conversation to match a given list.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConversationPane

public ConversationPane(ClientView vi,
                        java.lang.String id)
Construct a new ConversationPane. For when *this client* has initiated a chat. The Accept/Reject screen will not be shown.

Parameters:
vi - The ClientView that is the "parent" of this conversation pane
id - The ID of the conversation

ConversationPane

public ConversationPane(ClientView vi,
                        java.lang.String id,
                        java.lang.String otheruser)
For when another user has invited you to a chat. The Accept/Reject screen will be shown before the main conversation window is revealed.

Parameters:
vi - The ClientView that is the "parent" of this conversation pane
id - The ID of the conversation
otheruser - The user who invited you to a chat.
Method Detail

init

public void init()
Settings common to both constructor methods. Most variables, being final, must be instantiated in the constructors.


getPanel

public javax.swing.JPanel getPanel()
Returns:
the panel this ConversationPane manages

addStatement

public void addStatement(Statement statement)
Add a statement to the conversation. Invoked both as a result of the server sending you other users' messages, and as a result of you typing something in.

Parameters:
statement - the Statement to add

updateUsers

public void updateUsers(java.util.List<java.lang.String> users)
Update the list of users participating in this conversation to match a given list.

Parameters:
users - the list of users to update to