Class ViewGUIController

java.lang.Object
it.polimi.ingsw.am13.client.view.gui.ViewGUIController
Direct Known Subclasses:
ViewGUIControllerInit, ViewGUIControllerJoinedRoom, ViewGUIControllerMatch, ViewGUIControllerRooms, ViewGUIControllerWinner

public abstract class ViewGUIController extends Object
Abstract class for the GUI controllers (the classes implementing the logic behind the various scenes)
  • Field Details

    • stage

      protected javafx.stage.Stage stage
      The stage on which the application is displayed
    • scene

      protected javafx.scene.Scene scene
      The scene that this controller manages
    • networkHandler

      protected NetworkHandler networkHandler
      The network handler which is used to communicate with the server
  • Constructor Details

    • ViewGUIController

      public ViewGUIController()
  • Method Details

    • getScene

      public javafx.scene.Scene getScene()
      Returns:
      the scene that this controller manages
    • setStage

      public void setStage(javafx.stage.Stage stage)
      Method that sets the stage
      Parameters:
      stage - on which the application is displayed
    • setScene

      public void setScene(javafx.scene.Scene scene)
      Method that sets the scene
      Parameters:
      scene - the scene that this controller manages
    • setNetworkHandler

      public void setNetworkHandler(NetworkHandler networkHandler)
      Method that sets the network handler
      Parameters:
      networkHandler - the network handler which is used to communicate with the server
    • setThisPlayer

      public abstract void setThisPlayer(PlayerLobby player)
      Method that sets the player
      Parameters:
      player - the player associated to this ViewGUIController
    • setGameState

      public abstract void setGameState(GameState state)
      Method that sets the gameState
      Parameters:
      state - the representation of the state of the game
    • switchToScene

      public void switchToScene()
      Shows the scene associated to this controller, setting also the scene title
    • getSceneTitle

      public abstract String getSceneTitle()
      Returns:
      the title of the scene
    • showException

      public abstract void showException(Exception e)
      Shows a generic exception in the view (specific exception could be handled in different ways, also depending on the phase or the state of game)
      Parameters:
      e - Exception to be shown
    • showPlayerDisconnected

      public abstract void showPlayerDisconnected(PlayerLobby player)
      It shows that a player disconnected from an ongoing game by calling the corresponding method on ViewGUIController.
      Parameters:
      player - Player who disconnected
    • showPlayerReconnected

      public abstract void showPlayerReconnected(PlayerLobby player)
      It shows that a player reconnected to an ongoing game by calling the corresponding method on ViewGUIController.
      Parameters:
      player - Player who reconnected
    • forceCloseApp

      public abstract void forceCloseApp()
      Force closing the app. It should be used to end the app for anomalous reasons