Menu

chat

Roger B. Dannenberg David Schlesinger

Home

Chat System

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.

GUI Design

  • the gui is contained in chat.java and uses a JFrame populated by swing objects.
  • the main function is chat() which calls populateForm() and waits for received messages.
  • public void populateForm() is called once at the beginning of execution and prepares GUI objects and places them on the JFrame.
  • public void sendMessage() is called from the event handlers for the send button and pressing enter. It writes the message to the chat window and sends the message using the publish subscribe system
  • public void receiveMessage(String userName, String message) takes a received message and writes it to the text area
  • messages are displayed in different colors to make the chat window easy to read
  • public void updateUsers(int index) takes an index from the orchestra list and updates the user list with the performers in that orchestra. This function will need to be updated.
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)

Addresses and Syntax

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.

Communication

-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.

Subtask Assignments

  • David (dschlesi) - I'm the only one assigned to this group. I'm responsible for writing a GUI for the chat client and receiving and sending messages using the publish/subscribe system.

Home


Related

Wiki: Home

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.