java.lang.Object
edu.ntnu.idatt1002.k01g08.fta.util.SceneManager
Class used to switch scene
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic javafx.fxml.FXMLLoaderRetrieves the FXML loaderstatic javafx.scene.ScenegetScene()Retrieves a scenestatic javafx.stage.StagegetStage()Retrieves a stagestatic voidMethod for going to the last scenestatic voidsetCurrentScene(String sceneName) Sets the current scenestatic voidsetScene(javafx.scene.Scene scene) Sets the scenesstatic voidMethod for setting the view
-
Constructor Details
-
SceneManager
public SceneManager()Constructor
-
-
Method Details
-
setView
Method for setting the view- Parameters:
viewFxml- is the name of the fxml file- Throws:
IOException- if the view couldn't be loaded
-
goToLastScene
Method for going to the last scene- Throws:
IOException- if the view couldn't be loaded
-
getLoader
Retrieves the FXML loader- Parameters:
fileName- is the name of the FXML file- Returns:
- the FXMLLoader
-
setScene
public static void setScene(javafx.scene.Scene scene) Sets the scenes- Parameters:
scene- is the scene being set
-
setCurrentScene
Sets the current scene- Parameters:
sceneName- is the name of the scene
-
getScene
public static javafx.scene.Scene getScene()Retrieves a scene- Returns:
- the scene
-
getStage
public static javafx.stage.Stage getStage()Retrieves a stage- Returns:
- the stage
-