Class GenericDialog

    • 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 acceptButton  
      protected com.badlogic.gdx.scenes.scene2d.ui.Table bottom  
      protected com.badlogic.gdx.scenes.scene2d.ui.HorizontalGroup buttonGroup  
      protected com.badlogic.gdx.scenes.scene2d.ui.TextButton cancelButton  
      protected com.badlogic.gdx.scenes.scene2d.ui.Table content  
      protected boolean enterExit  
      protected boolean escExit  
      protected com.badlogic.gdx.scenes.scene2d.InputListener ignoreTouchDown  
      protected GenericDialog me  
      protected boolean modal  
      protected static float pad10  
      protected static float pad15  
      protected static float pad20  
      protected static float pad5  
      protected com.badlogic.gdx.utils.Array<OwnScrollPane> scrolls  
      protected com.badlogic.gdx.scenes.scene2d.ui.Skin skin  
      protected com.badlogic.gdx.scenes.scene2d.Stage stage  
      • Fields inherited from class com.badlogic.gdx.scenes.scene2d.ui.Table

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

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

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected abstract void accept()
      The accept function, if any
      protected abstract void build()
      Build the content here
      void buildSuper()  
      protected abstract void cancel()
      The cancel function, if any
      protected void enableComponents​(boolean enabled, com.badlogic.gdx.scenes.scene2d.utils.Disableable... components)
      Sets the enabled property on the given components
      boolean hasAcceptRunnable()  
      boolean hasCancelRunnable()  
      void hide()
      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 recalculateButtonSize()  
      void setAcceptRunnable​(java.lang.Runnable r)
      Sets the runnable which runs when accept is clicked
      void setAcceptText​(java.lang.String acceptText)  
      void setCancelRunnable​(java.lang.Runnable r)
      Sets the runnable which runs when cancel is clicked
      void setCancelText​(java.lang.String cancelText)  
      void setKeyboardFocus()
      Sets the keyboard focus, override in case you want to set the focus to a specific item
      void setModal​(boolean modal)  
      GenericDialog show​(com.badlogic.gdx.scenes.scene2d.Stage stage)
      Packs the dialog and adds it to the stage, centered with default fadeIn action
      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
      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
      static void updatePads()  
      • Methods inherited from class com.badlogic.gdx.scenes.scene2d.ui.Table

        add, add, add, add, add, add, add, align, background, background, bottom, center, clearChildren, 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, 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, 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, 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, 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 Detail

      • 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
      • content

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

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

        protected boolean modal
      • 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 Detail

      • GenericDialog

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

      • updatePads

        public static void updatePads()
      • setAcceptText

        public void setAcceptText​(java.lang.String acceptText)
      • setCancelText

        public void setCancelText​(java.lang.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​(java.lang.Runnable r)
        Sets the runnable which runs when accept is clicked
        Parameters:
        r - The runnable
      • hasAcceptRunnable

        public boolean hasAcceptRunnable()
      • setCancelRunnable

        public void setCancelRunnable​(java.lang.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 -
        components -