Module fxlauncher
Package fxlauncher

Interface UIProvider

All Known Implementing Classes:
DefaultUIProvider

public interface UIProvider
The UIProvider is responsible for creating the loader screen and the updater screen. A default implementation is available in the DefaultUIProvider class, but you can provide a custom implementation to alter the appearance of the loader UI. Implement this interface and make sure to embed the classes inside the fxlauncher.jar right around the "embed manifest" step. You have to do this manually as there is no function in the plugin to support this yet. Basically you have to do the following two steps: 1. Copy the implementation classes into the fxlauncher.jar 2. Create META-INF/services/fxlauncher.UIProvider inside the fxlauncher.jar. The content must be a string with the fully qualified name of your implementation class. Typical example:
# cd into directory with ui sources jar uf fxlauncher.jar -C my/package/MyUIProvider.class # cd into directory with META-INF folder jar uf fxlauncher.jar -C META-INF/services/fxlauncher.UIProvider
  • Method Summary

    Modifier and Type
    Method
    Description
    javafx.scene.Parent
    Create the Node that will be displayed while the launcher is loading resources, before the update process starts.
    javafx.scene.Parent
    Create the Node that will be displayed while the launcher is updating resources.
    void
    init(javafx.stage.Stage stage)
    Initialization method called before createLoader() and createUpdater(FXManifest).
    void
    updateProgress(double progress)
    Called when the update/download progress is changing.
  • Method Details

    • init

      void init(javafx.stage.Stage stage)
      Initialization method called before createLoader() and createUpdater(FXManifest). This is a good place to add stylesheets and perform other configuration.
      Parameters:
      stage - The stage that will be used to contain the loader and updater.
    • createLoader

      javafx.scene.Parent createLoader()
      Create the Node that will be displayed while the launcher is loading resources, before the update process starts. The default implementation is an intdeterminate progress indicator, but you can return any arbitrary scene graph.
      Returns:
      The launcher UI
    • createUpdater

      javafx.scene.Parent createUpdater(FXManifest manifest)
      Create the Node that will be displayed while the launcher is updating resources. This Node should update it's display whenever the updateProgress(double) method is called.
      Returns:
      The updater Node
      See Also:
    • updateProgress

      void updateProgress(double progress)
      Called when the update/download progress is changing. The progress is a value between 0 and 1, indicating the completion rate of the update process.
      Parameters:
      progress - A number between 0 and 1