Class StageManager

java.lang.Object
com.dlsc.gemsfx.util.StageManager

public class StageManager extends Object
A manager for storing the location and dimension of a stage across user sessions. Installing this manager on a stage will ensure that a stage will present itself at the same location and in the same size that it had when the user closed it the last time. This manager also works with multiple screens and will ensure that the window becomes visible if the last used screen is no longer available. In that case the stage will be shown centered on the primary screen with the specified min width and min height.
  • Method Details

    • install

      public static StageManager install(javafx.stage.Stage stage, String preferencesPath)
      Installs a new manager for the given stage. The location and dimension information will be stored in the user preferences at the given path. The default values for the minimum width is 850 and for the minimum height is 600.
    • install

      public static StageManager install(javafx.stage.Stage stage, Preferences preferences)
      Installs a new manager for the given stage. The location and dimension information will be stored in the given preferences. The default values for the minimum width is 850 and for the minimum height is 600.
    • install

      public static StageManager install(javafx.stage.Stage stage, String preferencesPath, double minWidth, double minHeight)
      Installs a new manager for the given stage. The location and dimension information will be stored in the user preferences at the given path.
      Parameters:
      stage - the stage to persist and restore
      preferencesPath - the java.util preferences path used for storing the information
      minWidth - the minimum width that will be used for the stage
      minHeight - the minimum height that will be used for the stage
    • install

      public static StageManager install(javafx.stage.Stage stage, Preferences preferences, double minWidth, double minHeight)
      Installs a new manager for the given stage. The location and dimension information will be stored in the user preferences at the given path.
      Parameters:
      stage - the stage to persist and restore
      preferences - the java.util preferences used for storing the information
      minWidth - the minimum width that will be used for the stage
      minHeight - the minimum height that will be used for the stage
    • setSupportFullScreenAndMaximized

      public final void setSupportFullScreenAndMaximized(boolean supportFullScreenAndMaximized)
    • isSupportFullScreenAndMaximized

      public final boolean isSupportFullScreenAndMaximized()