be.yildizgames.common.util.Registerable, ContainerChild, InputBox, Element, Widgetpublic final class SimpleInputBox extends BaseContainerChild implements InputBox
Element.AlignmentMAX_OPACITY, virtualHeightemptyZones| Constructor | Description |
|---|---|
SimpleInputBox(String name,
BaseCoordinate coordinates,
AbstractTextElement textElement,
AbstractTextElement caption,
SimpleContainer c,
Image backgroundElement,
ButtonMaterial material,
AbstractIconElement cursor,
SimpleTextLine defaultMessage,
SimpleContainer container) |
Full constructor.
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
addChar(int key) |
Add a char to the current contained text.
|
void |
delete() |
Delete the widget.
|
void |
deleteText() |
Delete all the current contained text.
|
String |
getText() |
|
protected void |
hideImpl() |
Implementation to set the widget invisible.
|
protected void |
highlightImpl(boolean over) |
Implementation to set the widget highlight.
|
void |
removeChar() |
Remove the last char of the current contained text.
|
void |
setCaptionText(be.yildizgames.common.client.translation.Key caption) |
|
void |
setCaptionText(String caption) |
Set the caption text.
|
InputBox |
setDefaultMessage(be.yildizgames.common.client.translation.Key message) |
|
InputBox |
setDefaultMessage(String message) |
|
void |
setFont(Font font) |
Set the font to use for the inner text and for the caption.
|
SimpleInputBox |
setMaterial(Material material) |
Set the box background material.
|
SimpleInputBox |
setPassword() |
All characters written in the box will be hidden and replaced by the replacement character(default is '*').
|
void |
setPasswordReplacement(char replacement) |
Change the password replacement char by another, default is '*'.
|
protected Element |
setPositionImpl(int left,
int top) |
Implementation to update the widget position.
|
protected void |
setSizeImpl(int w,
int h) |
Implementation to set the widget size.
|
SimpleInputBox |
setText(be.yildizgames.common.client.translation.Key newText) |
|
SimpleInputBox |
setText(String newText) |
Set the text to print in the box.
|
SimpleInputBox |
setTextAlignment(PositionRelativeLeft left,
PositionRelativeTop top) |
Set the text position relative to the input box.
|
SimpleInputBox |
setTextCenter() |
Align the text.
|
protected void |
showImpl() |
Implementation to set the widget visible.
|
addEmptyZoneImpl, detachFromParent, getParent, isContainer, setLeftFromParent, setLeftFromParent, setTopFromParent, setTopFromParent, setUnaffectedByZoom, updateSizeAfterZoomaddToLeft, addToPosition, addToTop, getBottom, getCoordinates, getHeight, getLeft, getOpacity, getRight, getTop, getWidth, hide, isVisible, multiplySize, resetVirtualHeight, setCoordinates, setHeight, setLeft, setLeft, setLeft, setLeft, setPosition, setPosition, setPosition, setSize, setSize, setTop, setTop, setTop, setTop, setVirtualHeight, setVisible, setWidth, show, updateAddPositionValueaddEmptyZone, addKeyboardListener, addMouseDoubleLeftClickListener, addMouseDragListener, addMouseLeftClickListener, addMouseMoveListener, addMouseReleaseListener, addMouseWheelListener, addOnMouseOverListener, addSpecialKeyListener, align, contains, contains, deleteKeyPressed, disableEmptyZone, enableEmptyZone, enterKeyPressed, findParent, focus, forceContainsFalse, getAbsoluteLeft, getAbsolutePosition, getAbsoluteTop, highlight, isFocusable, isMouseOver, keyPressed, mouseLeftClick, playAnimation, registerAnimation, removeAllClickListeners, setFocusable, setHighlightable, setMouseClickActive, setMouseOver, setStatic, stopAnimation, toStringdetachFromParent, getParent, setLeftFromParent, setLeftFromParent, setTopFromParent, setTopFromParent, updateAddPositionValue, updateSizeAfterZoomaddToLeft, addToPosition, addToTop, getBottom, getCoordinates, getHeight, getLeft, getRight, getTop, getWidth, hide, isVisible, resetVirtualHeight, setCoordinates, setHeight, setLeft, setLeft, setLeft, setLeft, setPosition, setPosition, setPosition, setSize, setSize, setTop, setTop, setTop, setTop, setVirtualHeight, setVisible, setWidth, showclone, finalize, getClass, notify, notifyAll, wait, wait, waitaddEmptyZone, addKeyboardListener, addMouseDoubleLeftClickListener, addMouseDragListener, addMouseLeftClickListener, addMouseMoveListener, addMouseReleaseListener, addMouseWheelListener, addOnMouseOverListener, addSpecialKeyListener, align, contains, contains, focus, getAbsoluteLeft, getAbsoluteTop, highlight, isFocusable, playAnimation, registerAnimation, removeAllClickListeners, stopAnimationpublic SimpleInputBox(String name, BaseCoordinate coordinates, AbstractTextElement textElement, AbstractTextElement caption, SimpleContainer c, Image backgroundElement, ButtonMaterial material, AbstractIconElement cursor, SimpleTextLine defaultMessage, SimpleContainer container)
name - Input box name, must be unique.coordinates - Box size and position.textElement - Text to print in the box.caption - Text to print next the box(usually box description).c - backgroundElement - Box background.material - Materials to assign.cursor - Cursor image.container - Container holding the input box.public void setCaptionText(String caption)
InputBoxsetCaptionText in interface InputBoxcaption - Text to set for the caption.public void setCaptionText(be.yildizgames.common.client.translation.Key caption)
setCaptionText in interface InputBoxpublic void addChar(int key)
key - Char to add ASCII value.public void removeChar()
InputBoxremoveChar in interface InputBoxpublic void deleteText()
InputBoxdeleteText in interface InputBoxprotected void highlightImpl(boolean over)
BaseWidgethighlightImpl in class BaseWidgetover - Highlight state.public SimpleInputBox setPassword()
InputBoxsetPassword in interface InputBoxpublic void delete()
BaseElementdelete in class BaseElementprotected void showImpl()
BaseElementshowImpl in class BaseElementprotected void hideImpl()
BaseElementhideImpl in class BaseElementpublic SimpleInputBox setMaterial(Material material)
InputBoxsetMaterial in interface InputBoxmaterial - Material to use as background.public SimpleInputBox setTextAlignment(PositionRelativeLeft left, PositionRelativeTop top)
InputBoxsetTextAlignment in interface InputBoxleft - Left relative position.top - Top relative position.public void setFont(Font font)
InputBoxpublic void setPasswordReplacement(char replacement)
InputBoxsetPasswordReplacement in interface InputBoxreplacement - New char to use in password boxes.public String getText()
public SimpleInputBox setText(String newText)
InputBoxpublic SimpleInputBox setText(be.yildizgames.common.client.translation.Key newText)
protected Element setPositionImpl(int left, int top)
BaseElementsetPositionImpl in class BaseElementleft - New widget x position.top - New widget y position.protected void setSizeImpl(int w,
int h)
BaseElementsetSizeImpl in class BaseElementw - New width.h - New height.public InputBox setDefaultMessage(String message)
setDefaultMessage in interface InputBoxpublic InputBox setDefaultMessage(be.yildizgames.common.client.translation.Key message)
setDefaultMessage in interface InputBoxpublic SimpleInputBox setTextCenter()
InputBoxsetTextCenter in interface InputBoxCopyright © 2014–2018. All rights reserved.