Class Bootstrap
java.lang.Object
megalodonte.application.Bootstrap
Internal bootstrap that wires the JavaFX lifecycle to the Megalodonte framework.
Called by MegalodonteApplication.start(Stage) once JavaFX is ready. Handles:
- App name and
.desktopentry (Linux dev mode) - Custom font loading via
FontLoader Contextcreation and registration- Application handler invocation
- Stage show
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic StringClasspath resource path for the app icon, or null if not set.static StringApplication display name, or null if not set.static Consumer<MegalodonteApp.Event> Framework event handler (e.g.Application startup handler, called once with theContext. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidapplyAppIcon(javafx.stage.Stage stage) Applies the icon configured throughMegalodonteApp.appIcon(String)to a stage.static voidapplyStageIcon(javafx.stage.Stage stage, String routeIconPath) Applies a route icon when one is provided, otherwise falls back to the application icon.static voiddispatch(Class<? extends javafx.application.Application> appClass, javafx.stage.Stage stage, String[] args) Main bootstrap entry point.static voiddispatch(javafx.stage.Stage stage) static voidstatic voidDispatches a framework event to the registered event handler.
-
Field Details
-
handler
-
eventHandler
Framework event handler (e.g.MegalodonteApp.Event.CloseRequest). -
appName
Application display name, or null if not set. -
appIconResourcePath
Classpath resource path for the app icon, or null if not set.
-
-
Constructor Details
-
Bootstrap
public Bootstrap()
-
-
Method Details
-
dispatch
public static void dispatch(Class<? extends javafx.application.Application> appClass, javafx.stage.Stage stage, String[] args) Main bootstrap entry point. Wires the stage, loads fonts, creates the context, invokes the application handler, and shows the stage.- Parameters:
appClass- the concreteApplicationclass (determines WM_CLASS on Linux)stage- the primary JavaFX stageargs- command-line arguments
-
dispatch
- See Also:
-
dispatch
public static void dispatch(javafx.stage.Stage stage) - See Also:
-
applyAppIcon
public static void applyAppIcon(javafx.stage.Stage stage) Applies the icon configured throughMegalodonteApp.appIcon(String)to a stage. Framework-created secondary stages call this method so they inherit the application icon.- Parameters:
stage- stage that should receive the application icon
-
applyStageIcon
Applies a route icon when one is provided, otherwise falls back to the application icon. Replacing the icon list also prevents stale route icons from accumulating while navigating.- Parameters:
stage- stage whose icon should be updatedrouteIconPath- route-specific image URL, ornullto use the app icon
-
dispatchEvent
Dispatches a framework event to the registered event handler.- Parameters:
event- the event to dispatch (e.g.MegalodonteApp.Event.CloseRequest)
-