Package gaia.cu9.ari.gaiaorbit.interfce
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
-
- com.badlogic.gdx.scenes.scene2d.ui.Window
-
- gaia.cu9.ari.gaiaorbit.util.scene2d.CollapsibleWindow
-
- gaia.cu9.ari.gaiaorbit.interfce.GenericDialog
-
- All Implemented Interfaces:
com.badlogic.gdx.scenes.scene2d.utils.Cullable
,com.badlogic.gdx.scenes.scene2d.utils.Layout
- Direct Known Subclasses:
AboutWindow
,ArchiveViewWindow
,ChooseCatalogWindow
,DownloadDataWindow
,FileChooser
,FileNameWindow
,KeyframePreferencesWindow
,KeyframesWindow
,LandAtWindow
,LogWindow
,MemInfoWindow
,MinimapWindow
,PreferencesWindow
,QuitWindow
,RunCameraWindow
,SearchDialog
,UpdatePopup
public abstract class GenericDialog extends CollapsibleWindow
-
-
Field Summary
Fields Modifier and Type Field Description protected com.badlogic.gdx.scenes.scene2d.ui.TextButton
acceptButton
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
pad
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 gaia.cu9.ari.gaiaorbit.util.scene2d.CollapsibleWindow
collapseSpeed
-
-
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 anyprotected abstract void
build()
Build the content herevoid
buildSuper()
protected abstract void
cancel()
The cancel function, if anyprotected void
enableComponents(boolean enabled, com.badlogic.gdx.scenes.scene2d.utils.Disableable... components)
Sets the enabled property on the given componentsboolean
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 clickedvoid
setAcceptText(java.lang.String acceptText)
void
setCancelRunnable(java.lang.Runnable r)
Sets the runnable which runs when cancel is clickedvoid
setCancelText(java.lang.String cancelText)
void
setKeyboardFocus()
Sets the keyboard focus, override in case you want to set the focus to a specific itemvoid
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 actionGenericDialog
show(com.badlogic.gdx.scenes.scene2d.Stage stage, float x, float y)
Packs
the dialog and adds it to the stage at the specified positionGenericDialog
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 showstatic void
updatePads()
-
Methods inherited from class gaia.cu9.ari.gaiaorbit.util.scene2d.CollapsibleWindow
act, collapse, collapseInstant, drawBackground, expand, expandInstant, getHeight, getMaxHeight, getMaxWidth, getPrefHeight, getPrefWidth, getWidth, isCollapsed, pack, setResizable, toggleCollapsed
-
Methods inherited from class com.badlogic.gdx.scenes.scene2d.ui.Window
draw, drawStageBackground, getStyle, getTitleLabel, getTitleTable, hit, isDragging, isModal, isMovable, isResizable, keepWithinStage, setKeepWithinStage, setMovable, setResizable, setResizeBorder, setStyle
-
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
-
-
-
-
Field Detail
-
pad
protected static float pad
-
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
-
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
-
-
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 classcom.badlogic.gdx.scenes.scene2d.ui.Window
-
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
-
-
-