The chat system provides a GUI to a chat system. There should be an interface to select the destination, e.g. everyone, everyone in an orchestra, or an individual. The interface should list all the orchestras and the members of each orchestra in an easy-to-access interface such as a drop-down list.
Membership lists are distributed by the connection manager system.
Messages are typed into a box and delivered when a send button is pressed (or maybe when return is typed.
Incoming messages are displayed along with the sender, and there should be a reply button to facilitate sending an answer.
The conductor is a special case: It should be easy to send a messsage to the conductor. Work with the server-side connection manager group to work out how each node will discover the conductor.
List of GUI objects and variables | |
---|---|
Object Summary (Chat.java) | |
private JTextPane textArea | Displays a users chat history |
private JTextArea typeArea | This is the field which a user types into to send a message |
private JButton btnSend | Sends a Message |
private JList orchList | List of available orchestras |
private JList userList | List of available users for an orchestra |
private DefaultListModel orchGroups | List of orchestras (displayed in JList orchList) |
private DefaultListModel users | List of users for a given orchestra (displayed in JList userList) |
The communications systems are not providing name lists, so as a (temporary?) work-around, if the message begins with a slash, the text up to the first space is taken as an address, and the text after the first region of white space is the message.
-Chat implements publish subscribe and messages are received inside receive function which is part of publish subscribe
-Chat either receives a message on the Chat Topic, or the Name Space Topic.
-If a message is received with the Chat Topic, then the message is displayed.
-If a message is received on the name space topic, then we update the list of orchestras and names. This is stored in a hashset similar to the hashset in used to keep track of nodes in the namespace class.