Package client

Class ChatController

java.lang.Object
client.ChatController

public class ChatController extends Object
ChatController - The Controller component of the MVC pattern. Bridges the Model and View, handling user interactions and updating the model.
  • Constructor Details

    • ChatController

      public ChatController(ChatModel model, ChatView view)
      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

      public void initialize(String inituser)
      Initializes the controller by setting up the view and attaching event listeners.
      Parameters:
      inituser - The initial username to log in with
    • main

      public static void main(String[] args)
      Main entry point for the application.