Class StageManager
java.lang.Object
com.dlsc.gemsfx.util.StageManager
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 Summary
Modifier and TypeMethodDescriptionstatic StageManagerInstalls a new manager for the given stage.static StageManagerInstalls a new manager for the given stage.static StageManagerinstall(javafx.stage.Stage stage, Preferences preferences) Installs a new manager for the given stage.static StageManagerinstall(javafx.stage.Stage stage, Preferences preferences, double minWidth, double minHeight) Installs a new manager for the given stage.final booleanReturns whether full-screen and maximized states should be persisted.final voidsetSupportFullScreenAndMaximized(boolean supportFullScreenAndMaximized) Sets whether full-screen and maximized states should be persisted.
-
Method Details
-
install
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.- Parameters:
stage- the stage to persist and restorepreferencesPath- the java.util preferences path used for storing the information- Returns:
- the installed stage manager
-
install
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.- Parameters:
stage- the stage to persist and restorepreferences- the preferences used for storing the information- Returns:
- the installed stage manager
-
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 restorepreferencesPath- the java.util preferences path used for storing the informationminWidth- the minimum width that will be used for the stageminHeight- the minimum height that will be used for the stage- Returns:
- the installed stage manager
-
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 restorepreferences- the java.util preferences used for storing the informationminWidth- the minimum width that will be used for the stageminHeight- the minimum height that will be used for the stage- Returns:
- the installed stage manager
-
setSupportFullScreenAndMaximized
public final void setSupportFullScreenAndMaximized(boolean supportFullScreenAndMaximized) Sets whether full-screen and maximized states should be persisted.- Parameters:
supportFullScreenAndMaximized-trueto persist full-screen and maximized states
-
isSupportFullScreenAndMaximized
public final boolean isSupportFullScreenAndMaximized()Returns whether full-screen and maximized states should be persisted.- Returns:
trueif full-screen and maximized states are persisted
-