be.yildizgames.common.util.Registerable, Button, ContainerChild, Element, Widgetpublic final class SimpleButton extends BaseContainerChild implements Button
Element.AlignmentMAX_OPACITY, virtualHeightemptyZones| Constructor | Description |
|---|---|
SimpleButton(String name,
AbstractTextElement captionText,
SimpleContainer container,
ButtonMaterial materials,
SimpleContainer parent) |
Full constructor, hidden from outside package, must be invoked by the gui builder.
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
delete() |
Delete the widget.
|
void |
desactivate() |
The button will no longer be clickable nor highlitable.
|
Font |
getCaptionFont() |
|
PositionRelativeLeft |
getCaptionHorizontalAlignment() |
|
int |
getCaptionHorizontalPadding() |
|
String |
getCaptionText() |
|
PositionRelativeTop |
getCaptionVerticalAlignment() |
|
int |
getCaptionVerticalPadding() |
|
Material |
getHighlightMaterial() |
|
Font |
getInactiveFont() |
|
Material |
getInactiveMaterial() |
|
Material |
getMaterial() |
|
protected void |
hideImpl() |
Hide everything.
|
protected void |
highlightImpl(boolean over) |
Implementation to set the widget highlight.
|
boolean |
isPushed() |
|
void |
reactivate() |
Reactive the button if it has been disabled.
|
void |
setCaptionFont(Font font) |
Change the font for the button text.
|
SimpleButton |
setCaptionText(be.yildizgames.common.client.translation.Key key) |
|
SimpleButton |
setCaptionText(String text) |
|
void |
setCaptionTextLeftAlignment(PositionRelativeLeft alignment) |
Set the caption horizontal alignment.
|
void |
setCaptionTextLeftAlignment(PositionRelativeLeft alignment,
int diff) |
Set the caption horizontal alignment.
|
void |
setCaptionTextTopAlignment(PositionRelativeTop alignment) |
Set the caption vertical alignment.
|
void |
setCaptionTextTopAlignment(PositionRelativeTop alignment,
int diff) |
Set the caption vertical alignment.
|
void |
setData(ButtonData data) |
Replace all existing data for this button by new one.
|
void |
setHighlightMaterial(Material material) |
Change the highlighted button background.
|
void |
setInactiveMaterial(Material material) |
Set a material for the button when in inactive state.
|
void |
setMaterial(ButtonMaterial material) |
Change the button materials.
|
void |
setMaterial(Material material) |
Change the button background.
|
protected Element |
setPositionImpl(int left,
int top) |
Implementation to update the widget position.
|
void |
setPushed() |
Set the button in pushed state.
|
void |
setPushedMaterial(Material pushedMaterial) |
|
protected void |
setSizeImpl(int width,
int height) |
Implementation to set the widget size.
|
void |
setUnpushed() |
Set the button in not pushed state.
|
protected void |
showImpl() |
Show caption and icon, not highlight.
|
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, toStringaddMouseLeftClickListener, addMouseMoveListener, addOnMouseOverListener, contains, highlight, mouseLeftClick, setFocusabledetachFromParent, 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, addMouseReleaseListener, addMouseWheelListener, addSpecialKeyListener, align, contains, focus, getAbsoluteLeft, getAbsoluteTop, isFocusable, playAnimation, registerAnimation, removeAllClickListeners, stopAnimationpublic SimpleButton(String name, AbstractTextElement captionText, SimpleContainer container, ButtonMaterial materials, SimpleContainer parent)
name - GuiButton name, must be unique.captionText - Caption associated to the button.container - Background container.materials - GuiButton materials.parent - Container holding the button.public void setData(ButtonData data)
Buttonpublic void setCaptionTextLeftAlignment(PositionRelativeLeft alignment, int diff)
ButtonsetCaptionTextLeftAlignment in interface Buttonalignment - Caption alignment.diff - Offset in pixels.public void setCaptionTextLeftAlignment(PositionRelativeLeft alignment)
ButtonsetCaptionTextLeftAlignment in interface Buttonalignment - Caption alignment.public void setCaptionTextTopAlignment(PositionRelativeTop alignment, int diff)
ButtonsetCaptionTextTopAlignment in interface Buttonalignment - Caption alignment.diff - Offset in pixels.public void setCaptionTextTopAlignment(PositionRelativeTop alignment)
ButtonsetCaptionTextTopAlignment in interface Buttonalignment - Caption alignment.public SimpleButton setCaptionText(String text)
setCaptionText in interface Buttonpublic SimpleButton setCaptionText(be.yildizgames.common.client.translation.Key key)
setCaptionText in interface Buttonprotected void highlightImpl(boolean over)
BaseWidgethighlightImpl in class BaseWidgetover - If true the base image will show and the highlight image will hide, false will invert it.public void delete()
BaseElementdelete in class BaseElementpublic void desactivate()
Buttondesactivate in interface Buttonpublic void reactivate()
Buttonreactivate in interface Buttonpublic void setUnpushed()
public void setPushed()
protected void showImpl()
showImpl in class BaseElementprotected void hideImpl()
hideImpl in class BaseElementprotected void setSizeImpl(int width,
int height)
BaseElementsetSizeImpl in class BaseElementwidth - New width.height - New height.protected Element setPositionImpl(int left, int top)
BaseElementsetPositionImpl in class BaseElementleft - New widget x position.top - New widget y position.public Material getInactiveMaterial()
getInactiveMaterial in interface Buttonpublic Font getInactiveFont()
getInactiveFont in interface Buttonpublic void setInactiveMaterial(Material material)
ButtonsetInactiveMaterial in interface Buttonmaterial - Material to use in inactive state.public PositionRelativeLeft getCaptionHorizontalAlignment()
getCaptionHorizontalAlignment in interface Buttonpublic int getCaptionHorizontalPadding()
getCaptionHorizontalPadding in interface Buttonpublic PositionRelativeTop getCaptionVerticalAlignment()
getCaptionVerticalAlignment in interface Buttonpublic int getCaptionVerticalPadding()
getCaptionVerticalPadding in interface Buttonpublic void setMaterial(Material material)
setMaterial in interface Buttonmaterial - new Material to use.public String getCaptionText()
public Material getMaterial()
getMaterial in interface Buttonpublic void setMaterial(ButtonMaterial material)
ButtonsetMaterial in interface Buttonmaterial - Background, highlight and inactive material data.public Material getHighlightMaterial()
getHighlightMaterial in interface Buttonpublic void setHighlightMaterial(Material material)
material - New Material to use.public Font getCaptionFont()
getCaptionFont in interface Buttonpublic void setCaptionFont(Font font)
ButtonsetCaptionFont in interface Buttonfont - New font to use.public boolean isPushed()
public void setPushedMaterial(Material pushedMaterial)
setPushedMaterial in interface ButtonCopyright © 2014–2018. All rights reserved.