Index

A B C D E G H I L M O R S T U W 
All Classes and Interfaces|All Packages

A

addChat(String) - Method in class client.ChatModel
Creates a new chat room and links the current user to it.
addChatButtonListener(ActionListener) - Method in class client.ChatView
Registers a listener for the "Add Chat" button.
addChatSelectionListener(ActionListener) - Method in class client.ChatView
Registers a listener for selecting chat rooms.
addDisconnectButtonListener(ActionListener) - Method in class client.ChatView
Registers a listener for the "Disconnect" button.
addInputFieldListener(ActionListener) - Method in class client.ChatView
Registers a listener for the message input field (e.g., for Enter key).
addListener(ChatModelListener) - Method in class client.ChatModel
Registers a listener to receive model change notifications.
addListener(WebSocketEventListener) - Method in class client.ClientWebSocketHandler
Adds a WebSocketEventListener to the list of listeners.
addLoginButtonListener(ActionListener) - Method in class client.ChatView
Registers a listener for the "Login" button.
addMessage(Message) - Method in class client.Chat
Appends a new message to the chat history.
addMessage(Message) - Method in class client.ChatGUI
Adds a new message to the display in real-time.
addMessage(Message, Chat) - Method in class client.ChatModel
Sends a message to a specific chat room.
addSendButtonListener(ActionListener) - Method in class client.ChatView
Registers a listener for the "Send" message button.
addSendImageButtonListener(ActionListener) - Method in class client.ChatView
Registers a listener for the "Send Image" button.
addUser(User) - Method in class client.Chat
Adds a user to the list of participants in this chat.

B

buildUserListPanel(ArrayList<String>, ArrayList<String>) - Method in class client.ChatGUI
Updates the user list panel with the current active users

C

Chat - Class in client
This class acts as a data container for the chat's identity, the history of messages sent, and the list of participating users.
Chat(String) - Constructor for class client.Chat
Constructs a new Chat instance with a specific name.
ChatController - Class in client
ChatController - The Controller component of the MVC pattern.
ChatController(ChatModel, ChatView) - Constructor for class client.ChatController
Constructor for ChatController.
ChatGUI - Class in client
Handles the graphical user interface for a chat session.
ChatGUI() - Constructor for class client.ChatGUI
Constructs a default ChatGUI with an empty border layout.
ChatGUI(Chat) - Constructor for class client.ChatGUI
Constructs a ChatGUI populated with data from an existing Chat object.
ChatListGUI - Class in client
Provides a graphical interface for displaying a list of available chat rooms.
ChatListGUI() - Constructor for class client.ChatListGUI
Constructs an empty ChatListGUI with a GridBagLayout.
ChatListGUI(ArrayList<String>, String) - Constructor for class client.ChatListGUI
Constructs a ChatListGUI populated with buttons for each chat room.
ChatModel - Class in client
ChatModel - The Model component of the MVC pattern.
ChatModel() - Constructor for class client.ChatModel
Constructs a new ChatModel.
ChatModelListener - Interface in client
ChatModelListener - Observer interface for ChatModel changes.
ChatView - Class in client
ChatView - The View component of the MVC pattern.
ChatView() - Constructor for class client.ChatView
 
clearAddChatField() - Method in class client.ChatView
Clears the text in the "Add Chat" input field.
clearInputField() - Method in class client.ChatView
Clears the message input field.
client - package client
 
ClientWebSocketHandler - Class in client
 
ClientWebSocketHandler(URI) - Constructor for class client.ClientWebSocketHandler
Constructor for ClientWebSocketHandler.
Connect(User, String) - Static method in class client.ConnectionHandler
Handles the connection of a user to a chat.
ConnectionHandler - Class in client
 
ConnectionHandler(String, String) - Constructor for class client.ConnectionHandler
Constructor for ConnectionHandler.
createAndShowUi(String) - Method in class client.ChatView
Initializes the GUI components, sets up layouts, and displays the main frame.
createImageMessage(String) - Method in class client.ChatModel
Method to create an image-based message.
createMessage(String) - Method in class client.ChatModel
Method to create a standard text message with the current timestamp and user.
createMessagePanel(Message) - Method in class client.ChatGUI
Transforms a Message object into a list of JLabels for display.

D

Disconnect(User, String) - Static method in class client.ConnectionHandler
Handles the disconnection of a user from a chat.

E

enterChat(String) - Method in class client.ClientWebSocketHandler
Sends a message to the server to enter a specific chat room.
equals(Object) - Method in class client.User
Compares this user to another object for equality.

G

Get_Chat(String) - Static method in class client.ConnectionHandler
Retrieves a Chat object from the server based on the provided chat name.
Get_Chats(User) - Static method in class client.ConnectionHandler
Retrieves a list of chat names that the specified user is a member of.
Get_Image(String) - Static method in class client.ConnectionHandler
Retrieves an image from the server based on the provided hash.
getAddChatText() - Method in class client.ChatView
 
getChatListPanel() - Method in class client.ChatListGUI
Returns the panel containing the chat list components.
getChatName() - Method in class client.Chat
Gets the name of the chat room.
getChats() - Method in class client.ChatModel
Fetches the latest list of chat rooms from the server for the current user.
getCurrentChat() - Method in class client.ChatModel
 
getFrame() - Method in class client.ChatView
 
getInputText() - Method in class client.ChatView
 
getLoginText() - Method in class client.ChatView
 
getMainPanel() - Method in class client.ChatGUI
Returns the main container of the GUI.
getMessages() - Method in class client.Chat
Gets the list of all messages recorded in this chat.
getName() - Method in class client.User
Returns the display name of the user.
getText() - Method in class client.Message
Returns the text content or the image path of the message.
getTime() - Method in class client.Message
Returns the timestamp indicating when the message was sent.
getUser() - Method in class client.ChatModel
 
getUser() - Method in class client.Message
Returns the author of the message.
getUsers() - Method in class client.Chat
Gets the list of users associated with this chat.

H

hashCode() - Method in class client.User
Generates a hash code for this user based on their name.

I

initialize(String) - Method in class client.ChatController
Initializes the controller by setting up the view and attaching event listeners.
initializeWebSocket() - Method in class client.ChatController
Initializes the WebSocket connection to the server and sets up event listeners for WebSocket events.
isImage() - Method in class client.Message
Checks if this message represents an image.

L

leaveChat() - Method in class client.ChatModel
Leaves the currently active chat room by setting activeChat to null.
login(String) - Method in class client.ClientWebSocketHandler
Sends a login message to the server with the provided username.

M

main(String[]) - Static method in class client.ChatController
Main entry point for the application.
Message - Class in client
Represents a single message within a chat session.
Message(String, Instant, User, Boolean) - Constructor for class client.Message
Constructs a new Message instance.

O

onChatSelected(Chat) - Method in interface client.ChatModelListener
Triggered when a specific chat room has been selected by the user.
onChatSelected(Chat) - Method in class client.ChatView
Updates the display when a user selects a different chat room.
onChatsLoaded(ArrayList<String>, String) - Method in interface client.ChatModelListener
Triggered when the list of available chat rooms has been fetched from the server.
onChatsLoaded(ArrayList<String>, String) - Method in class client.ChatView
Populates the sidebar with the list of available chat rooms.
onClose(int, String, boolean) - Method in class client.ClientWebSocketHandler
Notifies listeners of disconnection when the WebSocket connection is closed.
onConnected() - Method in interface client.WebSocketEventListener
Called when the WebSocket connection is established
onDisconnected() - Method in interface client.WebSocketEventListener
Called when the WebSocket connection is closed
onError(Exception) - Method in class client.ClientWebSocketHandler
Notifies listeners of any errors that occur in the WebSocket connection.
onError(String) - Method in interface client.WebSocketEventListener
Called when an error occurs in the WebSocket connection
onMessage(String) - Method in class client.ClientWebSocketHandler
Handles incoming messages from the WebSocket connection.
onMessageAdded(Chat) - Method in interface client.ChatModelListener
Triggered when the local user adds a message to a chat.
onMessageAdded(Chat) - Method in class client.ChatView
Updates the UI when a message is added to a specific chat.
onMessageReceived(Message) - Method in interface client.ChatModelListener
Triggered when a new message is received from the server.
onMessageReceived(Message) - Method in class client.ChatView
Updates the current chat view with a single incoming message.
onMessageReceived(Message) - Method in interface client.WebSocketEventListener
Called when a message is received over the WebSocket connection
onOpen(ServerHandshake) - Method in class client.ClientWebSocketHandler
Handles start of connection WebSocket server.

R

removeChatPanel() - Method in class client.ChatView
Removes content of chatPanel
removeListener(ChatModelListener) - Method in class client.ChatModel
Removes a listener from receiving notifications.
removeListener(WebSocketEventListener) - Method in class client.ClientWebSocketHandler
Removes a WebSocketEventListener from the list of listeners.

S

Send_Image(String) - Static method in class client.ConnectionHandler
Sends an image to the server by reading the image file, encoding it in Base64, and making a POST request with the encoded image as the payload.
Send_Message(Message, String) - Static method in class client.ConnectionHandler
Sends a message to the server within a specific chat.
sendImageMessage(String, ClientWebSocketHandler) - Method in class client.ChatModel
Sends an image message to the server for the currently active chat room.
sendMessage(String, ClientWebSocketHandler) - Method in class client.ChatModel
Sends a message to the server for the currently active chat room.
sendMessageToServer(Message, String) - Method in class client.ClientWebSocketHandler
Sends a message to the server within a specific chat.
setActiveChat(String) - Method in class client.ChatListGUI
Updates the chat list to visually indicate which chat is currently active.
setChats(ArrayList<String>) - Method in class client.ChatModel
Updates the local list of chat rooms and notifies all listeners.
setCurrentChat(Chat) - Method in class client.ChatModel
Sets the currently active chat room and notifies listeners to update the view.
setName(String) - Method in class client.User
Sets or updates the display name of the user.
setUser(User) - Method in class client.ChatModel
Sets the current user and fetches the available chat rooms for that user.

T

toString() - Method in class client.Chat
Returns a string representation of the chat, which is its name.
toString() - Method in class client.Message
Returns a string representation of the message content.
toString() - Method in class client.User
Returns a string representation of the user, which is their name.

U

updateUserList(String, String[], ArrayList<String>) - Method in interface client.ChatModelListener
Triggered when there is an update to the users present in a specific chat.
updateUserList(String, String[], ArrayList<String>) - Method in class client.ChatView
Updates the user list in the sidebar when a chat update is received.
updateUserList(String, String[], ArrayList<String>) - Method in interface client.WebSocketEventListener
Called when a chat update occurs
User - Class in client
User - Represents a chat user.
User(String) - Constructor for class client.User
Constructs a new User with the specified name.

W

WebSocketEventListener - Interface in client
WebSocketEventListener - Interface for handling WebSocket events.
A B C D E G H I L M O R S T U W 
All Classes and Interfaces|All Packages