Class ScreenManager
java.lang.Object
megalodonte.base.route.ScreenManager
Screen lifecycle manager owned by megalodonte-base. Tracks the active screen
per stage and the spawned windows, owning the shared mount/destroy logic so
that both the router (navigation) and
ScreenContextBase (window
spawning) tear down screens the same way (scope cancel + onDestroy).-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidDestroys every spawned window's screen and closes its stage.voiddestroy(javafx.stage.Stage stage) Removes a spawned window from tracking and destroys its active screen.Mounts a screen on the given stage, destroying any previously active screen on that stage.voidregisterSpawned(javafx.stage.Stage stage) Registers a window spawned viaScreenContextBase.spawnWindow(String).
-
Constructor Details
-
ScreenManager
-
-
Method Details
-
resolve
-
mount
public RouteResult mount(javafx.stage.Stage stage, Route route, Map<String, String> params, RouterBase router) Mounts a screen on the given stage, destroying any previously active screen on that stage. CallsonMount()before returning.- Parameters:
stage- the stage to host the screen (may be a brand-new spawned window)- Returns:
- the mounted view and its route props
-
registerSpawned
public void registerSpawned(javafx.stage.Stage stage) Registers a window spawned viaScreenContextBase.spawnWindow(String). -
destroy
public void destroy(javafx.stage.Stage stage) Removes a spawned window from tracking and destroys its active screen. Does not close the stage (used when the user closes the window). -
closeAllSpawned
public void closeAllSpawned()Destroys every spawned window's screen and closes its stage.
-