Class ScreenContextBase
java.lang.Object
megalodonte.base.route.v2.ScreenContextBase
- All Implemented Interfaces:
ScreenContextInterface
Screen-level context owned by megalodonte-base. Exposes navigation, route
parameters, scope, the current JavaFX scene and window spawning. Screens on
the router receive an instance of this via their
ScreenFactory.-
Constructor Summary
ConstructorsConstructorDescriptionScreenContextBase(javafx.stage.Stage selfStage, RouterBase router, ScreenManager screenManager) -
Method Summary
Modifier and TypeMethodDescriptionjavafx.scene.SceneGet current JavaFX scene of this screenRoute parameters for the current navigation, resolved from dynamic segments (${param}) — e.g.booleanReturns whether this screen's window is currently in full-screen mode.voidNavigates to the given route path within this screen's stage.voidnavigateAndCloseOthers(String path) Fecha todas as janelas spawned (inclusive a atual, se for uma spawned) e navega a stage principal para o path informado.router()scope()Escopo de cancelamento vinculado a esta navegação: cancelado automaticamente peloRouterBaseassim que a tela associada é destruída (antes deonDestroy()rodar).javafx.stage.StageThe JavaFXStagethis screen is currently attached to.voidsetFullScreen(boolean fullScreen) Changes this screen's window full-screen mode without exposing JavaFX stage manipulation to application code.voidvoidspawnWindow(String path) Spawns a new window for the given route.voidspawnWindow(String path, Consumer<Exception> errorHandler) Spawns a new window for the given route.voidwhenReady(RunnableThrowing runnableThrowing) Executa o callback quando a Scene estiver pronta na Stage.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ScreenContextInterface
toggleFullScreen
-
Constructor Details
-
ScreenContextBase
public ScreenContextBase(javafx.stage.Stage selfStage, RouterBase router, ScreenManager screenManager)
-
-
Method Details
-
scope
Description copied from interface:ScreenContextInterfaceEscopo de cancelamento vinculado a esta navegação: cancelado automaticamente peloRouterBaseassim que a tela associada é destruída (antes deonDestroy()rodar). Trabalho assíncrono iniciado viascope().run(...)não fica pendurado depois que o usuário navega pra outro lugar.- Specified by:
scopein interfaceScreenContextInterface
-
spawnWindow
Description copied from interface:ScreenContextInterfaceSpawns a new window for the given route.- Specified by:
spawnWindowin interfaceScreenContextInterface- Parameters:
path- route identification to spawn
-
spawnWindow
Description copied from interface:ScreenContextInterfaceSpawns a new window for the given route.- Specified by:
spawnWindowin interfaceScreenContextInterface- Parameters:
path- route identification to spawnerrorHandler- callback invoked if spawning fails
-
setParams
-
selfStage
public javafx.stage.Stage selfStage()Description copied from interface:ScreenContextInterfaceThe JavaFXStagethis screen is currently attached to.- Specified by:
selfStagein interfaceScreenContextInterface
-
isFullScreen
public boolean isFullScreen()Description copied from interface:ScreenContextInterfaceReturns whether this screen's window is currently in full-screen mode.- Specified by:
isFullScreenin interfaceScreenContextInterface
-
setFullScreen
public void setFullScreen(boolean fullScreen) Description copied from interface:ScreenContextInterfaceChanges this screen's window full-screen mode without exposing JavaFX stage manipulation to application code.- Specified by:
setFullScreenin interfaceScreenContextInterface
-
router
-
getParams
Description copied from interface:ScreenContextInterfaceRoute parameters for the current navigation, resolved from dynamic segments (${param}) — e.g. for path"product/${id}":{ "id" = "123" }.- Specified by:
getParamsin interfaceScreenContextInterface
-
getJavaFXScene
public javafx.scene.Scene getJavaFXScene()Description copied from interface:ScreenContextInterfaceGet current JavaFX scene of this screen- Specified by:
getJavaFXScenein interfaceScreenContextInterface- Returns:
Scene
-
whenReady
Description copied from interface:ScreenContextInterfaceExecuta o callback quando a Scene estiver pronta na Stage. Cobre tanto o caso onde ela ainda não existe (aguarda) quanto o caso onde já está disponível (executa imediatamente).- Specified by:
whenReadyin interfaceScreenContextInterface
-