Class Bootstrap

java.lang.Object
megalodonte.application.Bootstrap

public final class Bootstrap extends Object
Internal bootstrap that wires the JavaFX lifecycle to the Megalodonte framework.

Called by MegalodonteApplication.start(Stage) once JavaFX is ready. Handles:

  1. App name and .desktop entry (Linux dev mode)
  2. Custom font loading via FontLoader
  3. Context creation and registration
  4. Application handler invocation
  5. Stage show
  • Field Details

  • 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 concrete Application class (determines WM_CLASS on Linux)
      stage - the primary JavaFX stage
      args - command-line arguments
    • dispatch

      public static void dispatch(javafx.stage.Stage stage, String[] args)
      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 through MegalodonteApp.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

      public static void applyStageIcon(javafx.stage.Stage stage, String routeIconPath)
      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 updated
      routeIconPath - route-specific image URL, or null to use the app icon
    • dispatchEvent

      public static void dispatchEvent(MegalodonteApp.Event event)
      Dispatches a framework event to the registered event handler.
      Parameters:
      event - the event to dispatch (e.g. MegalodonteApp.Event.CloseRequest)