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
A class representing the controller for the
SCHOOLBOARD scene.- See Also:
-
SceneName.SCHOOLBOARDScene
-
Field Summary
Fields inherited from class it.polimi.ingsw.eriantys.client.gui.controllers.Controller
app, client, showError, showInfo -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGetter for theselectedattribute, which contains either the name of aColorrepresenting a selected student or the name of a character card (during the process of selecting parameters of an effect).javafx.scene.layout.PaneA getter for thePaneobject associated with the FXML tag of highest level in the*.fxmlfile associated withthis.protected voidInitializes the miniature images of the character cards to show when a character card is selected.voidinitialize(URL url, ResourceBundle resourceBundle) Initializes all the images for the scene from the resource files.voidload()Loads the board status and draws all the elements of the scene.voidEncloses the workflow ofthison a scene change event.protected voidSets 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.voidsetSelected(String selected) Sets the selected color or character card.Methods inherited from class it.polimi.ingsw.eriantys.client.gui.controllers.Controller
applyGrayscale, applyGreenShade, roundBorders, setApp, setClient, setShowError, setShowInfo
-
Constructor Details
-
SchoolBoardController
public SchoolBoardController()
-
-
Method Details
-
initialize
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:ControllerA getter for thePaneobject associated with the FXML tag of highest level in the*.fxmlfile associated withthis. The method is called in order to process a popup. Any controller should override the method if necessary.- Specified by:
getTopLevelPanein classController- Returns:
- the highest level
Pane
-
getSelected
Getter for theselectedattribute, which contains either the name of aColorrepresenting 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
nullif nothing is selected
-
setSelected
Sets the selected color or character card.- Parameters:
selected- The name of aColoror the name of a character card
-
onChangeScene
public void onChangeScene()Encloses the workflow ofthison 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:
onChangeScenein classController
-
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.
-