public class Dialog extends Window
result(Object)
is called and the dialog is removed from the stage.Window.WindowStyle
Modifier and Type | Field and Description |
---|---|
static float |
fadeDuration
The time in seconds that dialogs will fade in and out.
|
Constructor and Description |
---|
Dialog(java.lang.String title,
Skin skin) |
Dialog(java.lang.String title,
Skin skin,
java.lang.String windowStyleName) |
Dialog(java.lang.String title,
Window.WindowStyle windowStyle) |
Modifier and Type | Method and Description |
---|---|
Dialog |
button(Button button)
Adds the given button to the button table.
|
Dialog |
button(Button button,
java.lang.Object object)
Adds the given button to the button table.
|
Dialog |
button(java.lang.String text)
Adds a text button to the button table.
|
Dialog |
button(java.lang.String text,
java.lang.Object object)
Adds a text button to the button table.
|
Dialog |
button(java.lang.String text,
java.lang.Object object,
TextButton.TextButtonStyle buttonStyle)
Adds a text button to the button table.
|
void |
cancel() |
Table |
getButtonTable() |
Table |
getContentTable() |
void |
hide()
Hides the dialog.
|
Dialog |
key(int keycode,
java.lang.Object object)
If this key is pressed,
result(Object) is called with the specified object. |
protected void |
result(java.lang.Object object)
Called when a button is clicked.
|
void |
setObject(Actor actor,
java.lang.Object object) |
protected void |
setParent(Group parent)
Called by the framework when an actor is added to or removed from a group.
|
Dialog |
show(Stage stage)
Packs the dialog and adds it to the stage, centered. |
Dialog |
text(Label label)
Adds the given Label to the content table
|
Dialog |
text(java.lang.String text)
Adds a label to the content table.
|
Dialog |
text(java.lang.String text,
Label.LabelStyle labelStyle)
Adds a label to the content table.
|
draw, drawBackground, getPrefWidth, getStyle, getTitle, hit, isDragging, setKeepWithinStage, setModal, setMovable, setStyle, setTitle, setTitleAlignment
add, add, add, add, add, add, align, bottom, center, clearChildren, columnDefaults, debug, debug, debugCell, debugTable, debugWidget, defaults, drawDebug, getAlign, getBackground, getCell, getCells, getClip, getDebug, getMinHeight, getMinWidth, getPadBottom, getPadBottomValue, getPadLeft, getPadLeftValue, getPadRight, getPadRightValue, getPadTop, getPadTopValue, getPadX, getPadY, getPrefHeight, getRow, invalidate, layout, left, pad, pad, padBottom, padLeft, padRight, padTop, removeActor, reset, right, row, setBackground, setBackground, setClip, setRound, setSkin, stack, top
childrenChanged, getMaxHeight, getMaxWidth, invalidateHierarchy, needsLayout, pack, setFillParent, setLayoutEnabled, sizeChanged, validate
act, addActor, addActorAfter, addActorAt, addActorBefore, applyTransform, clear, computeTransform, drawChildren, findActor, getChildren, hasChildren, isTransform, localToDescendantCoordinates, print, resetTransform, setCullingArea, setStage, setTransform, swapActor, swapActor
addAction, addCaptureListener, addListener, clearActions, clearListeners, clipBegin, clipBegin, clipEnd, fire, getActions, getCaptureListeners, getColor, getHeight, getListeners, getName, getOriginX, getOriginY, getParent, getRight, getRotation, getScaleX, getScaleY, getStage, getTop, getTouchable, getWidth, getX, getY, getZIndex, hasParent, isAscendantOf, isDescendantOf, isVisible, localToAscendantCoordinates, localToParentCoordinates, localToStageCoordinates, notify, parentToLocalCoordinates, remove, removeAction, removeCaptureListener, removeListener, rotate, scale, scale, screenToLocalCoordinates, setBounds, setColor, setColor, setHeight, setName, setOrigin, setOriginX, setOriginY, setPosition, setRotation, setScale, setScale, setScaleX, setScaleY, setSize, setTouchable, setVisible, setWidth, setX, setY, setZIndex, size, size, stageToLocalCoordinates, toBack, toFront, toString, translate
public static float fadeDuration
public Dialog(java.lang.String title, Skin skin)
public Dialog(java.lang.String title, Skin skin, java.lang.String windowStyleName)
public Dialog(java.lang.String title, Window.WindowStyle windowStyle)
public Table getContentTable()
public Table getButtonTable()
getButtonTable
in class Window
public Dialog text(java.lang.String text)
public Dialog text(java.lang.String text, Label.LabelStyle labelStyle)
public Dialog button(java.lang.String text)
result(Object)
if this button is clicked. The dialog
must have been constructed with a skin to use this method.public Dialog button(java.lang.String text, java.lang.Object object)
object
- The object that will be passed to result(Object)
if this button is clicked. May be null.public Dialog button(java.lang.String text, java.lang.Object object, TextButton.TextButtonStyle buttonStyle)
object
- The object that will be passed to result(Object)
if this button is clicked. May be null.public Dialog button(Button button, java.lang.Object object)
object
- The object that will be passed to result(Object)
if this button is clicked. May be null.public void hide()
fadeDuration
seconds and then removes it from the stage.protected void setParent(Group parent)
Actor
public void setObject(Actor actor, java.lang.Object object)
public Dialog key(int keycode, java.lang.Object object)
result(Object)
is called with the specified object.Input.Keys
protected void result(java.lang.Object object)
cancel()
is called.object
- The object specified when the button was added.public void cancel()