Interface ScreenComponent

All Superinterfaces:
megalodonte.contracts.ScreenComponentContract<Component>, megalodonte.contracts.ScreenLifecycle

public interface ScreenComponent extends megalodonte.contracts.ScreenComponentContract<Component>
Interface for screen-level components managed by the router. A screen has a lifecycle: render() produces the component tree, onMount() is called once the stage is visible, and onDestroy() is called when the screen is navigated away from.
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    Called when the screen is destroyed (navigated away from).
    default void
    Called once after the stage is visible and the scene is attached.
    Renders the screen's component tree.
  • Method Details

    • render

      Component render()
      Renders the screen's component tree. Called once per navigation.
      Specified by:
      render in interface megalodonte.contracts.ScreenComponentContract<Component>
    • onMount

      default void onMount()
      Called once after the stage is visible and the scene is attached. Override for one-time setup.
      Specified by:
      onMount in interface megalodonte.contracts.ScreenLifecycle
    • onDestroy

      default void onDestroy()
      Called when the screen is destroyed (navigated away from). Override for cleanup.
      Specified by:
      onDestroy in interface megalodonte.contracts.ScreenLifecycle