Package client
Class ChatController
java.lang.Object
client.ChatController
ChatController - The Controller component of the MVC pattern.
Bridges the Model and View, handling user interactions and updating the model.
-
Constructor Summary
ConstructorsConstructorDescriptionChatController(ChatModel model, ChatView view) Constructor for ChatController. -
Method Summary
Modifier and TypeMethodDescriptionvoidinitialize(String inituser) Initializes the controller by setting up the view and attaching event listeners.voidInitializes the WebSocket connection to the server and sets up event listeners for WebSocket events.static voidMain entry point for the application.
-
Constructor Details
-
ChatController
Constructor for ChatController. Initializes the model, view, and WebSocket connection.- Parameters:
model- The ChatModel instance representing the application's data and business logic.view- The ChatView instance responsible for the user interface and presentation logic.
-
-
Method Details
-
initializeWebSocket
public void initializeWebSocket()Initializes the WebSocket connection to the server and sets up event listeners for WebSocket events. -
initialize
Initializes the controller by setting up the view and attaching event listeners.- Parameters:
inituser- The initial username to log in with
-
main
Main entry point for the application.
-