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.SCHOOLBOARD
Scene
-
Field Summary
Fields inherited from class it.polimi.ingsw.eriantys.client.gui.controllers.Controller
app, client, showError, showInfo
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGetter for theselected
attribute, which contains either the name of aColor
representing a selected student or the name of a character card (during the process of selecting parameters of an effect).javafx.scene.layout.Pane
A getter for thePane
object associated with the FXML tag of highest level in the*.fxml
file associated withthis
.protected void
Initializes the miniature images of the character cards to show when a character card is selected.void
initialize
(URL url, ResourceBundle resourceBundle) Initializes all the images for the scene from the resource files.void
load()
Loads the board status and draws all the elements of the scene.void
Encloses the workflow ofthis
on a scene change event.protected void
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.void
setSelected
(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:Controller
A getter for thePane
object associated with the FXML tag of highest level in the*.fxml
file associated withthis
. The method is called in order to process a popup. Any controller should override the method if necessary.- Specified by:
getTopLevelPane
in classController
- Returns:
- the highest level
Pane
-
getSelected
Getter for theselected
attribute, which contains either the name of aColor
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
Sets the selected color or character card.- Parameters:
selected
- The name of aColor
or the name of a character card
-
onChangeScene
public void onChangeScene()Encloses the workflow ofthis
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 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.
-