Class GenericDialog

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
Direct Known Subclasses:
AboutWindow, ArchiveViewWindow, CatalogSelectionWindow, ControllerConfigWindow, DatasetLoadDialog, DatasetPreferencesWindow, DownloadDataWindow, FileChooser, FileNameWindow, IndividualVisibilityWindow, KeyframePreferencesWindow, KeyframesWindow, LandAtWindow, LogWindow, MemInfoWindow, MinimapWindow, NewBookmarkFolderDialog, PreferencesWindow, QuitWindow, SearchDialog, SlaveConfigWindow, UpdatePopup, WikiInfoWindow

public abstract class GenericDialog extends CollapsibleWindow
  • Nested Class Summary

    Nested classes/interfaces inherited from class com.badlogic.gdx.scenes.scene2d.ui.Table

    com.badlogic.gdx.scenes.scene2d.ui.Table.Debug, com.badlogic.gdx.scenes.scene2d.ui.Table.DebugRect
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected com.badlogic.gdx.scenes.scene2d.ui.TextButton
     
    protected com.badlogic.gdx.scenes.scene2d.ui.Table
     
    protected com.badlogic.gdx.scenes.scene2d.ui.HorizontalGroup
     
    protected com.badlogic.gdx.scenes.scene2d.ui.TextButton
     
    protected com.badlogic.gdx.scenes.scene2d.ui.Table
     
    protected boolean
     
    protected boolean
     
    protected com.badlogic.gdx.scenes.scene2d.InputListener
     
    protected float
     
    protected float
     
    protected GenericDialog
     
    protected boolean
     
    protected static float
     
    protected static float
     
    protected static float
     
    protected static float
     
    protected com.badlogic.gdx.utils.Array<OwnScrollPane>
     
    protected com.badlogic.gdx.scenes.scene2d.ui.Skin
     
    protected com.badlogic.gdx.scenes.scene2d.Stage
     

    Fields inherited from class gaiasky.util.scene2d.CollapsibleWindow

    collapseSpeed

    Fields inherited from class gaiasky.util.scene2d.OwnWindow

    dragging, edge

    Fields inherited from class com.badlogic.gdx.scenes.scene2d.ui.Table

    backgroundBottom, backgroundLeft, backgroundRight, backgroundTop, debugActorColor, debugCellColor, debugTableColor
  • Constructor Summary

    Constructors
    Constructor
    Description
    GenericDialog​(String title, com.badlogic.gdx.scenes.scene2d.ui.Skin skin, com.badlogic.gdx.scenes.scene2d.Stage stage)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected abstract void
    The accept function, if any
    protected abstract void
    Build the content here
    void
     
    protected abstract void
    The cancel function, if any
    abstract void
     
    protected void
    enableComponents​(boolean enabled, com.badlogic.gdx.scenes.scene2d.utils.Disableable... components)
    Sets the enabled property on the given components.
    boolean
     
    boolean
     
    void
    Hides the dialog.
    void
    hide​(com.badlogic.gdx.scenes.scene2d.Action action)
    Hides the dialog with the given action and then removes it from the stage.
    protected void
     
    void
    Sets the runnable which runs when accept is clicked
    void
    setAcceptText​(String acceptText)
     
    void
    Sets the runnable which runs when cancel is clicked
    void
    setCancelText​(String cancelText)
     
    void
    Sets the keyboard focus, override in case you want to set the focus to a specific item
    void
    setModal​(boolean modal)
     
    show​(com.badlogic.gdx.scenes.scene2d.Stage stage)
    Packs the dialog and adds it to the stage, centered with default fadeIn action
    show​(com.badlogic.gdx.scenes.scene2d.Stage stage, float x, float y)
    Packs the dialog and adds it to the stage at the specified position
    show​(com.badlogic.gdx.scenes.scene2d.Stage stage, com.badlogic.gdx.scenes.scene2d.Action action)
    Packs the dialog and adds it to the stage with custom action which can be null for instant show
    static void
     

    Methods inherited from class com.badlogic.gdx.scenes.scene2d.ui.Table

    add, add, add, add, add, add, add, align, background, background, bottom, center, clearChildren, clip, clip, columnDefaults, debug, debug, debugActor, debugAll, debugCell, debugTable, defaults, drawDebug, drawDebugBounds, getAlign, getBackground, getCell, getCells, getClip, getColumnMinWidth, getColumnPrefWidth, getColumns, getColumnWidth, getMinHeight, getMinWidth, getPadBottom, getPadBottomValue, getPadLeft, getPadLeftValue, getPadRight, getPadRightValue, getPadTop, getPadTopValue, getPadX, getPadY, getRow, getRowHeight, getRowMinHeight, getRowPrefHeight, getRows, getSkin, getTableDebug, invalidate, layout, left, pad, pad, pad, pad, padBottom, padBottom, padLeft, padLeft, padRight, padRight, padTop, padTop, removeActor, removeActor, removeActorAt, reset, right, row, setBackground, setBackground, setClip, setDebug, setRound, setSkin, stack, top

    Methods inherited from class com.badlogic.gdx.scenes.scene2d.ui.WidgetGroup

    childrenChanged, invalidateHierarchy, needsLayout, setFillParent, setLayoutEnabled, sizeChanged, validate

    Methods inherited from class com.badlogic.gdx.scenes.scene2d.Group

    addActor, addActorAfter, addActorAt, addActorBefore, applyTransform, applyTransform, clear, clear, clearChildren, computeTransform, drawChildren, drawDebugChildren, findActor, getChild, getChildren, getCullingArea, hasChildren, isTransform, localToDescendantCoordinates, resetTransform, resetTransform, setCullingArea, setDebug, setStage, setTransform, swapActor, swapActor, toString

    Methods inherited from class com.badlogic.gdx.scenes.scene2d.Actor

    addAction, addCaptureListener, addListener, ancestorsVisible, ascendantsVisible, clearActions, clearListeners, clipBegin, clipBegin, clipEnd, fire, firstAscendant, getActions, getCaptureListeners, getColor, getDebug, getListeners, getName, getOriginX, getOriginY, getParent, getRight, getRotation, getScaleX, getScaleY, getStage, getTop, getTouchable, getUserObject, getX, getX, getY, getY, getZIndex, hasActions, hasKeyboardFocus, hasParent, hasScrollFocus, isAscendantOf, isDescendantOf, isTouchable, isTouchFocusListener, isTouchFocusTarget, isVisible, localToActorCoordinates, localToAscendantCoordinates, localToParentCoordinates, localToScreenCoordinates, localToStageCoordinates, moveBy, notify, parentToLocalCoordinates, positionChanged, remove, removeAction, removeCaptureListener, removeListener, rotateBy, rotationChanged, scaleBy, scaleBy, scaleChanged, screenToLocalCoordinates, setBounds, setColor, setColor, setHeight, setName, setOrigin, setOrigin, setOriginX, setOriginY, setParent, setPosition, setPosition, setRotation, setScale, setScale, setScaleX, setScaleY, setSize, setTouchable, setUserObject, setVisible, setWidth, setX, setX, setY, setY, setZIndex, sizeBy, sizeBy, stageToLocalCoordinates, toBack, toFront

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • pad20

      protected static float pad20
    • pad15

      protected static float pad15
    • pad10

      protected static float pad10
    • pad5

      protected static float pad5
    • stage

      protected final com.badlogic.gdx.scenes.scene2d.Stage stage
    • skin

      protected final com.badlogic.gdx.scenes.scene2d.ui.Skin skin
    • me

      protected GenericDialog me
    • content

      protected com.badlogic.gdx.scenes.scene2d.ui.Table content
    • bottom

      protected com.badlogic.gdx.scenes.scene2d.ui.Table bottom
    • lastPosX

      protected float lastPosX
    • lastPosY

      protected float lastPosY
    • buttonGroup

      protected com.badlogic.gdx.scenes.scene2d.ui.HorizontalGroup buttonGroup
    • acceptButton

      protected com.badlogic.gdx.scenes.scene2d.ui.TextButton acceptButton
    • cancelButton

      protected com.badlogic.gdx.scenes.scene2d.ui.TextButton cancelButton
    • enterExit

      protected boolean enterExit
    • escExit

      protected boolean escExit
    • ignoreTouchDown

      protected com.badlogic.gdx.scenes.scene2d.InputListener ignoreTouchDown
    • scrolls

      protected com.badlogic.gdx.utils.Array<OwnScrollPane> scrolls
  • Constructor Details

    • GenericDialog

      public GenericDialog(String title, com.badlogic.gdx.scenes.scene2d.ui.Skin skin, com.badlogic.gdx.scenes.scene2d.Stage stage)
  • Method Details

    • updatePads

      public static void updatePads()
    • setAcceptText

      public void setAcceptText(String acceptText)
    • setCancelText

      public void setCancelText(String cancelText)
    • setModal

      public void setModal(boolean modal)
      Overrides:
      setModal in class OwnWindow
    • recalculateButtonSize

      protected void recalculateButtonSize()
    • buildSuper

      public void buildSuper()
    • build

      protected abstract void build()
      Build the content here
    • accept

      protected abstract void accept()
      The accept function, if any
    • cancel

      protected abstract void cancel()
      The cancel function, if any
    • show

      public GenericDialog show(com.badlogic.gdx.scenes.scene2d.Stage stage, com.badlogic.gdx.scenes.scene2d.Action action)
      Packs the dialog and adds it to the stage with custom action which can be null for instant show
    • show

      public GenericDialog show(com.badlogic.gdx.scenes.scene2d.Stage stage)
      Packs the dialog and adds it to the stage, centered with default fadeIn action
    • show

      public GenericDialog show(com.badlogic.gdx.scenes.scene2d.Stage stage, float x, float y)
      Packs the dialog and adds it to the stage at the specified position
    • setKeyboardFocus

      public void setKeyboardFocus()
      Sets the keyboard focus, override in case you want to set the focus to a specific item
    • hide

      public void hide(com.badlogic.gdx.scenes.scene2d.Action action)
      Hides the dialog with the given action and then removes it from the stage.
    • setAcceptRunnable

      public void setAcceptRunnable(Runnable r)
      Sets the runnable which runs when accept is clicked
      Parameters:
      r - The runnable
    • hasAcceptRunnable

      public boolean hasAcceptRunnable()
    • setCancelRunnable

      public void setCancelRunnable(Runnable r)
      Sets the runnable which runs when cancel is clicked
      Parameters:
      r - The runnable
    • hasCancelRunnable

      public boolean hasCancelRunnable()
    • hide

      public void hide()
      Hides the dialog. Called automatically when a button is clicked. The default implementation fades out the dialog over 400 milliseconds and then removes it from the stage.
    • enableComponents

      protected void enableComponents(boolean enabled, com.badlogic.gdx.scenes.scene2d.utils.Disableable... components)
      Sets the enabled property on the given components.
      Parameters:
      enabled - The state to set.
      components - The components to enable or disable.
    • dispose

      public abstract void dispose()