Interface Button
-
- All Superinterfaces:
ContainerChild,Element,be.yildizgames.common.util.Registerable,Widget
public interface Button extends Widget, ContainerChild
- Author:
- Grégory Van den Borre
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface be.yildizgames.module.graphic.gui.internal.Element
Element.Alignment
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddMouseLeftClickListener(be.yildizgames.module.window.input.MouseLeftClickListener l)Add a new MouseClickListener on this widget.voidaddMouseMoveListener(be.yildizgames.module.window.input.MouseMoveListener l)Add a new MouseMoveListener on this widget.voidaddOnMouseOverListener(OnMouseOverListener l)Add a new OnMouseOverListener on this widget.booleancontains(be.yildizgames.module.window.input.MousePosition position)Check if a point in contained in this container.voiddesactivate()The button will no longer be clickable nor highlitable.FontgetCaptionFont()PositionRelativeLeftgetCaptionHorizontalAlignment()intgetCaptionHorizontalPadding()PositionRelativeTopgetCaptionVerticalAlignment()intgetCaptionVerticalPadding()MaterialgetHighlightMaterial()FontgetInactiveFont()MaterialgetInactiveMaterial()MaterialgetMaterial()voidhighlight(boolean contains)voidmouseLeftClick(be.yildizgames.module.window.input.MousePosition position)voidreactivate()Reactive the button if it has been disabled.voidsetCaptionFont(Font font)Change the font for the button text.ButtonsetCaptionText(be.yildizgames.common.client.translation.TranslationKey text)ButtonsetCaptionText(String text)voidsetCaptionTextLeftAlignment(PositionRelativeLeft alignment)Set the caption horizontal alignment.voidsetCaptionTextLeftAlignment(PositionRelativeLeft alignment, int diff)Set the caption horizontal alignment.voidsetCaptionTextTopAlignment(PositionRelativeTop alignment)Set the caption vertical alignment.voidsetCaptionTextTopAlignment(PositionRelativeTop alignment, int diff)Set the caption vertical alignment.voidsetData(ButtonData data)Replace all existing data for this button by new one.voidsetFocusable(boolean b)voidsetInactiveMaterial(Material material)Set a material for the button when in inactive state.voidsetMaterial(ButtonMaterial material)Change the button materials.voidsetMaterial(Material m)voidsetPushed()voidsetPushedMaterial(Material pushed)voidsetUnpushed()-
Methods inherited from interface be.yildizgames.module.graphic.gui.ContainerChild
detachFromParent, getParent, setLeftFromParent, setLeftFromParent, setTopFromParent, setTopFromParent, updateAddPositionValue, updateSizeAfterZoom
-
Methods inherited from interface be.yildizgames.module.graphic.gui.internal.Element
addToLeft, addToPosition, addToTop, getBottom, getCoordinates, getHeight, getLeft, getRight, getTop, getWidth, hide, isVisible, resetVirtualHeight, setCoordinates, setHeight, setLeft, setLeft, setLeft, setLeft, setPosition, setPosition, setSize, setSize, setTop, setTop, setTop, setTop, setVirtualHeight, setVisible, setWidth, show
-
Methods inherited from interface be.yildizgames.module.graphic.gui.Widget
addEmptyZone, addKeyboardListener, addMouseDoubleLeftClickListener, addMouseDragListener, addMouseReleaseListener, addMouseRightClickListener, addMouseWheelListener, align, contains, focus, getAbsoluteLeft, getAbsoluteTop, isFocusable, playAnimation, registerAnimation, removeAllClickListeners, stopAnimation
-
-
-
-
Method Detail
-
setCaptionText
Button setCaptionText(be.yildizgames.common.client.translation.TranslationKey text)
-
getCaptionFont
Font getCaptionFont()
-
setCaptionFont
void setCaptionFont(Font font)
Change the font for the button text.- Parameters:
font- New font to use.
-
setMaterial
void setMaterial(ButtonMaterial material)
Change the button materials.- Parameters:
material- Background, highlight and inactive material data.
-
getMaterial
Material getMaterial()
-
setMaterial
void setMaterial(Material m)
-
getHighlightMaterial
Material getHighlightMaterial()
-
addOnMouseOverListener
void addOnMouseOverListener(OnMouseOverListener l)
Description copied from interface:WidgetAdd a new OnMouseOverListener on this widget.- Specified by:
addOnMouseOverListenerin interfaceWidget- Parameters:
l- Listener to add.
-
addMouseMoveListener
void addMouseMoveListener(be.yildizgames.module.window.input.MouseMoveListener l)
Description copied from interface:WidgetAdd a new MouseMoveListener on this widget.- Specified by:
addMouseMoveListenerin interfaceWidget- Parameters:
l- Listener to add.
-
addMouseLeftClickListener
void addMouseLeftClickListener(be.yildizgames.module.window.input.MouseLeftClickListener l)
Description copied from interface:WidgetAdd a new MouseClickListener on this widget.- Specified by:
addMouseLeftClickListenerin interfaceWidget- Parameters:
l- Listener to add.
-
mouseLeftClick
void mouseLeftClick(be.yildizgames.module.window.input.MousePosition position)
-
contains
boolean contains(be.yildizgames.module.window.input.MousePosition position)
Description copied from interface:WidgetCheck if a point in contained in this container.
-
setData
void setData(ButtonData data)
Replace all existing data for this button by new one. Old materials and click listeners will be removed and replaced by this ones.- Parameters:
data- New data for this button.
-
desactivate
void desactivate()
The button will no longer be clickable nor highlitable.
-
reactivate
void reactivate()
Reactive the button if it has been disabled.
-
setFocusable
void setFocusable(boolean b)
-
setCaptionTextLeftAlignment
void setCaptionTextLeftAlignment(PositionRelativeLeft alignment, int diff)
Set the caption horizontal alignment.- Parameters:
alignment- Caption alignment.diff- Offset in pixels.
-
setCaptionTextLeftAlignment
void setCaptionTextLeftAlignment(PositionRelativeLeft alignment)
Set the caption horizontal alignment.- Parameters:
alignment- Caption alignment.
-
setCaptionTextTopAlignment
void setCaptionTextTopAlignment(PositionRelativeTop alignment)
Set the caption vertical alignment.- Parameters:
alignment- Caption alignment.
-
setCaptionTextTopAlignment
void setCaptionTextTopAlignment(PositionRelativeTop alignment, int diff)
Set the caption vertical alignment.- Parameters:
alignment- Caption alignment.diff- Offset in pixels.
-
getInactiveMaterial
Material getInactiveMaterial()
-
getInactiveFont
Font getInactiveFont()
-
setInactiveMaterial
void setInactiveMaterial(Material material)
Set a material for the button when in inactive state. If no material is set, base material will be used.- Parameters:
material- Material to use in inactive state.
-
getCaptionHorizontalAlignment
PositionRelativeLeft getCaptionHorizontalAlignment()
-
getCaptionHorizontalPadding
int getCaptionHorizontalPadding()
-
getCaptionVerticalAlignment
PositionRelativeTop getCaptionVerticalAlignment()
-
getCaptionVerticalPadding
int getCaptionVerticalPadding()
-
setPushedMaterial
void setPushedMaterial(Material pushed)
-
setUnpushed
void setUnpushed()
-
setPushed
void setPushed()
-
-