Package gaiasky.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
-
- gaiasky.util.scene2d.OwnWindow
-
- gaiasky.util.scene2d.CollapsibleWindow
-
- gaiasky.interfce.GenericDialog
-
- All Implemented Interfaces:
com.badlogic.gdx.scenes.scene2d.utils.Cullable,com.badlogic.gdx.scenes.scene2d.utils.Layout
- Direct Known Subclasses:
AboutWindow,ArchiveViewWindow,CatalogChooserWindow,DatasetLoadDialog,DatasetPreferencesWindow,DownloadDataWindow,FileChooser,FileNameWindow,IndividualVisibilityWindow,KeyframePreferencesWindow,KeyframesWindow,LandAtWindow,LogWindow,MemInfoWindow,MinimapWindow,NewBookmarkFolderDialog,PreferencesWindow,QuitWindow,SearchDialog,SlaveConfigWindow,UpdatePopup
public abstract class GenericDialog extends CollapsibleWindow
-
-
Field Summary
Fields Modifier and Type Field Description protected com.badlogic.gdx.scenes.scene2d.ui.TextButtonacceptButtonprotected com.badlogic.gdx.scenes.scene2d.ui.Tablebottomprotected com.badlogic.gdx.scenes.scene2d.ui.HorizontalGroupbuttonGroupprotected com.badlogic.gdx.scenes.scene2d.ui.TextButtoncancelButtonprotected com.badlogic.gdx.scenes.scene2d.ui.Tablecontentprotected booleanenterExitprotected booleanescExitprotected com.badlogic.gdx.scenes.scene2d.InputListenerignoreTouchDownprotected GenericDialogmeprotected booleanmodalprotected static floatpadprotected static floatpad5protected com.badlogic.gdx.utils.Array<OwnScrollPane>scrollsprotected com.badlogic.gdx.scenes.scene2d.ui.Skinskinprotected com.badlogic.gdx.scenes.scene2d.Stagestage-
Fields inherited from class gaiasky.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 voidaccept()The accept function, if anyprotected abstract voidbuild()Build the content herevoidbuildSuper()protected abstract voidcancel()The cancel function, if anyprotected voidenableComponents(boolean enabled, com.badlogic.gdx.scenes.scene2d.utils.Disableable... components)Sets the enabled property on the given componentsbooleanhasAcceptRunnable()booleanhasCancelRunnable()voidhide()Hides the dialog.voidhide(com.badlogic.gdx.scenes.scene2d.Action action)Hides the dialog with the given action and then removes it from the stage.protected voidrecalculateButtonSize()voidsetAcceptRunnable(java.lang.Runnable r)Sets the runnable which runs when accept is clickedvoidsetAcceptText(java.lang.String acceptText)voidsetCancelRunnable(java.lang.Runnable r)Sets the runnable which runs when cancel is clickedvoidsetCancelText(java.lang.String cancelText)voidsetKeyboardFocus()Sets the keyboard focus, override in case you want to set the focus to a specific itemvoidsetModal(boolean modal)GenericDialogshow(com.badlogic.gdx.scenes.scene2d.Stage stage)Packsthe dialog and adds it to the stage, centered with default fadeIn actionGenericDialogshow(com.badlogic.gdx.scenes.scene2d.Stage stage, float x, float y)Packsthe dialog and adds it to the stage at the specified positionGenericDialogshow(com.badlogic.gdx.scenes.scene2d.Stage stage, com.badlogic.gdx.scenes.scene2d.Action action)Packsthe dialog and adds it to the stage with custom action which can be null for instant showstatic voidupdatePads()-
Methods inherited from class gaiasky.util.scene2d.CollapsibleWindow
act, collapse, collapseInstant, drawBackground, expand, expandInstant, getHeight, getMaxHeight, getMaxWidth, getPrefHeight, getPrefWidth, getWidth, isCollapsed, pack, setResizable, toggleCollapsed
-
Methods inherited from class gaiasky.util.scene2d.OwnWindow
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
-
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
-
-
Method Detail
-
updatePads
public static void updatePads()
-
setAcceptText
public void setAcceptText(java.lang.String acceptText)
-
setCancelText
public void setCancelText(java.lang.String cancelText)
-
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)
Packsthe 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)
Packsthe 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)
Packsthe 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-
-
-