Class SchoolBoardController

java.lang.Object
it.polimi.ingsw.eriantys.client.gui.controllers.Controller
it.polimi.ingsw.eriantys.client.gui.controllers.SchoolBoardController
All Implemented Interfaces:
javafx.fxml.Initializable

public class SchoolBoardController extends Controller
A class representing the controller for the SCHOOLBOARD scene.
See Also:
  • Constructor Details

    • SchoolBoardController

      public SchoolBoardController()
  • Method Details

    • initialize

      public void initialize(URL url, ResourceBundle resourceBundle)
      Initializes all the images for the scene from the resource files. Sets some event handlers.
      See Also:
      • EventHandler
    • getTopLevelPane

      public javafx.scene.layout.Pane getTopLevelPane()
      Description copied from class: Controller
      A getter for the Pane object associated with the FXML tag of highest level in the *.fxml file associated with this. The method is called in order to process a popup. Any controller should override the method if necessary.
      Specified by:
      getTopLevelPane in class Controller
      Returns:
      the highest level Pane
    • getSelected

      public String getSelected()
      Getter for the selected attribute, which contains either the name of a Color representing a selected student or the name of a character card (during the process of selecting parameters of an effect).
      Returns:
      the selected color or character card, or null if nothing is selected
    • setSelected

      public void setSelected(String selected)
      Sets the selected color or character card.
      Parameters:
      selected - The name of a Color or the name of a character card
    • onChangeScene

      public void onChangeScene()
      Encloses the workflow of this on a scene change event. The method is called before the implementation of the controller itself to pre-process eventual data. The default behaviour of the method returns immediately. Any controller should override the method if necessary. Saves the username of the player in order to show it at the top of the scene. Draws the selected color or character card, which could change when changing to another scene and back.
      Overrides:
      onChangeScene in class Controller
    • load

      public void load()
      Loads the board status and draws all the elements of the scene.
    • setEventHandlers

      protected void setEventHandlers()
      Sets the event handlers for the MouseClicked event on the entrance and dining room if the schoolboard that is showing is the one of the player. If a character card is selected, the event handlers are replaced with the ones to select arguments for that card's effect.
    • initCharacterMiniatures

      protected void initCharacterMiniatures()
      Initializes the miniature images of the character cards to show when a character card is selected.