Class View

java.lang.Object
edu.ntnu.idatt1002.k2g05.View

public class View extends Object
Singleton class for managing the current view.
  • Field Details

  • Method Details

    • getInstance

      public static View getInstance()
      Method for getting the instance of the View class.
      Returns:
      the instance
    • getStage

      public javafx.stage.Stage getStage()
      Gets the stage, the stage is the window frame, and can be seen as the parent of the view.
      Returns:
      the stages
    • setStage

      public void setStage(javafx.stage.Stage stage)
      Sets the stage, the stage is the window frame, and can be seen as the parent of the view.
      Parameters:
      stage - to be set.
    • getCurrentScene

      public javafx.scene.Scene getCurrentScene()
      Method for getting the currently set scene, the scene is the content of the window.
      Returns:
      the scene
    • setCurrentScene

      public void setCurrentScene(javafx.scene.Scene currentScene)
      Method for setting the current scene, the scene is the content of the window.
      Parameters:
      currentScene - to be set
    • setCurrentScene

      public void setCurrentScene(String path)
      Sets the current scene, it is preferred to use the static constants in this class to set a scene, as they will be correct.
      Parameters:
      path - to FXML file
      Throws:
      IllegalArgumentException - if the path is wrong or the file is wrong.
    • isDebugMode

      public boolean isDebugMode()
    • setDebugMode

      public void setDebugMode(boolean b)