Class DatasetUrlConfirmWindow

java.lang.Object
com.badlogic.gdx.scenes.scene2d.Actor
com.badlogic.gdx.scenes.scene2d.Group
com.badlogic.gdx.scenes.scene2d.ui.WidgetGroup
com.badlogic.gdx.scenes.scene2d.ui.Table
All Implemented Interfaces:
com.badlogic.gdx.scenes.scene2d.utils.Cullable, com.badlogic.gdx.scenes.scene2d.utils.Layout, IScreen

public class DatasetUrlConfirmWindow extends GenericDialog
Confirmation dialog for dataset URLs received through the gaiasky:// protocol handler. Asks the user for confirmation before downloading and installing a dataset package from the internet.
  • Constructor Details

    • DatasetUrlConfirmWindow

      public DatasetUrlConfirmWindow(String datasetUrl, com.badlogic.gdx.scenes.scene2d.ui.Skin skin, com.badlogic.gdx.scenes.scene2d.Stage stage, Runnable onAccept, Runnable onCancel)
      Creates the confirmation dialog.
      Parameters:
      datasetUrl - The URL of the dataset package.
      skin - The UI skin.
      stage - The UI stage.
      onAccept - Runnable to run if the user accepts.
      onCancel - Runnable to run if the user cancels.
  • Method Details

    • build

      protected void build()
      Description copied from class: GenericDialog
      Build the content here.
      Specified by:
      build in class GenericDialog
    • accept

      protected boolean accept()
      Description copied from class: GenericDialog
      The accept function, if any.
      Specified by:
      accept in class GenericDialog
      Returns:
      True if the dialog must close after the call, false otherwise.
    • cancel

      protected void cancel()
      Description copied from class: GenericDialog
      The cancel function, if any.
      Specified by:
      cancel in class GenericDialog
    • dispose

      public void dispose()
      Specified by:
      dispose in class GenericDialog
    • isFromDataMirror

      public static boolean isFromDataMirror(String datasetUrl)
      Returns true if the given dataset URL points to one of the configured data mirrors. Used to decide whether a confirmation dialog is needed before downloading.
      Parameters:
      datasetUrl - The dataset URL.
      Returns:
      True if the URL host matches one of the data mirrors.