Class Controller
java.lang.Object
it.polimi.ingsw.eriantys.client.gui.controllers.Controller
- All Implemented Interfaces:
javafx.fxml.Initializable
- Direct Known Subclasses:
AssistantCardsController,BoardController,CharacterCardsController,LobbiesController,LoginController,SchoolBoardController,TowersController,WaitingRoomController,WizardsController
A class representing a GUI application controller which can manage
*.fxml files and
display data accordingly inside them.
Every element of SceneName or PopupName enumerations should have a corresponding declaration
as a subclass of this non-specific controller.- See Also:
-
Initializable
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyGrayscale(javafx.scene.image.ImageView img) A helper method to apply a grayscale filter on an image.voidapplyGreenShade(javafx.scene.image.ImageView img) A helper method to apply a green shade filter on an image.abstract javafx.scene.layout.PaneA getter for thePaneobject associated with the FXML tag of highest level in the*.fxmlfile associated withthis.voidEncloses the workflow ofthison a scene change event.voidroundBorders(javafx.scene.image.ImageView img, double arcSize) A helper method to round borders of an image.voidSets an internal reference to the GUI application.voidSets an internal reference to the client who launched the GUI application.voidsetShowError(Consumer<String> showError) Sets the error show process coded within aConsumer.voidsetShowInfo(Consumer<String> showInfo) Sets the information show process coded within aConsumer.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface javafx.fxml.Initializable
initialize
-
Field Details
-
app
-
client
-
showInfo
-
showError
-
-
Constructor Details
-
Controller
public Controller()
-
-
Method Details
-
setApp
Sets an internal reference to the GUI application.- Parameters:
app- the target app reference- See Also:
-
setClient
Sets an internal reference to the client who launched the GUI application.- Parameters:
client- the target client reference- See Also:
-
setShowInfo
Sets the information show process coded within aConsumer.- Parameters:
showInfo- the functional interface which stores the show process behaviour
-
setShowError
Sets the error show process coded within aConsumer.- Parameters:
showError- the functional interface which stores the show process behaviour
-
roundBorders
public void roundBorders(javafx.scene.image.ImageView img, double arcSize) A helper method to round borders of an image.- Parameters:
img- the target image referencearcSize- the desired size for the arc of the borders
-
applyGrayscale
public void applyGrayscale(javafx.scene.image.ImageView img) A helper method to apply a grayscale filter on an image. The method could be used to visualize an item which cannot be selected.- Parameters:
img- the target image reference
-
applyGreenShade
public void applyGreenShade(javafx.scene.image.ImageView img) A helper method to apply a green shade filter on an image. The method could be used to visualize an item which has been selected.- Parameters:
img- the target image reference
-
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. -
getTopLevelPane
public abstract javafx.scene.layout.Pane getTopLevelPane()A 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.- Returns:
- the highest level
Pane
-