-
- All Superinterfaces:
Element,be.yildizgames.common.util.Registerable
- All Known Subinterfaces:
Button,ButtonList,CheckBox,Container,ContainerChild,Image,InputBox,ProgressBar,ProgressBarTimer,TextLine,TimeTextLine
- All Known Implementing Classes:
BaseContainerChild,BaseWidget,SimpleContainer,TabContainer
public interface Widget extends Element
- 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 voidaddEmptyZone(be.yildizgames.common.geometry.Rectangle zone)Add a zone to ignore when checking if the container contains the mouse, if the mouse position is inside this zone, it will be considered as outside of the container.voidaddKeyboardListener(be.yildizgames.module.window.input.KeyboardListener listener)Add a new KeyboardListener on this widget and set the widget focusable.voidaddMouseDoubleLeftClickListener(be.yildizgames.module.window.input.MouseDoubleLeftClickListener listener)Add a new MouseDoubleClickListener on this widget.voidaddMouseDragListener(be.yildizgames.module.window.input.MouseDragListener listener)Add a new MouseDragListener on this widget.voidaddMouseLeftClickListener(be.yildizgames.module.window.input.MouseLeftClickListener listener)Add a new MouseClickListener on this widget.voidaddMouseMoveListener(be.yildizgames.module.window.input.MouseMoveListener listener)Add a new MouseMoveListener on this widget.voidaddMouseReleaseListener(be.yildizgames.module.window.input.MouseReleaseListener listener)Add a new MouseReleaseClickListener on this widget.voidaddMouseRightClickListener(be.yildizgames.module.window.input.MouseRightClickListener listener)voidaddMouseWheelListener(be.yildizgames.module.window.input.MouseWheelListener listener)Add a new MouseWheelListener on this widget.voidaddOnMouseOverListener(OnMouseOverListener listener)Add a new OnMouseOverListener on this widget.voidalign(Element.Alignment alignment)Align the widgetbooleancontains(int x, int y)booleancontains(be.yildizgames.module.window.input.MousePosition position)Check if a point in contained in this container.voidfocus(boolean b)intgetAbsoluteLeft()Give the absolute left position instead of relative from parent.intgetAbsoluteTop()Give the absolute top position instead of relative from parent.voidhighlight(boolean b)booleanisFocusable()voidplayAnimation(String animation)voidregisterAnimation(BaseAnimationGui anim)voidremoveAllClickListeners()Clear the list of all click listeners.voidstopAnimation(String name)-
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
-
-
-
-
Method Detail
-
addMouseLeftClickListener
void addMouseLeftClickListener(be.yildizgames.module.window.input.MouseLeftClickListener listener)
Add a new MouseClickListener on this widget.- Parameters:
listener- Listener to add.
-
addMouseRightClickListener
void addMouseRightClickListener(be.yildizgames.module.window.input.MouseRightClickListener listener)
-
addMouseDoubleLeftClickListener
void addMouseDoubleLeftClickListener(be.yildizgames.module.window.input.MouseDoubleLeftClickListener listener)
Add a new MouseDoubleClickListener on this widget.- Parameters:
listener- Listener to add.
-
addMouseReleaseListener
void addMouseReleaseListener(be.yildizgames.module.window.input.MouseReleaseListener listener)
Add a new MouseReleaseClickListener on this widget.- Parameters:
listener- Listener to add.
-
removeAllClickListeners
void removeAllClickListeners()
Clear the list of all click listeners.
-
addKeyboardListener
void addKeyboardListener(be.yildizgames.module.window.input.KeyboardListener listener)
Add a new KeyboardListener on this widget and set the widget focusable.- Parameters:
listener- Listener to add.
-
addMouseMoveListener
void addMouseMoveListener(be.yildizgames.module.window.input.MouseMoveListener listener)
Add a new MouseMoveListener on this widget.- Parameters:
listener- Listener to add.
-
addMouseWheelListener
void addMouseWheelListener(be.yildizgames.module.window.input.MouseWheelListener listener)
Add a new MouseWheelListener on this widget.- Parameters:
listener- Listener to add.
-
addMouseDragListener
void addMouseDragListener(be.yildizgames.module.window.input.MouseDragListener listener)
Add a new MouseDragListener on this widget.- Parameters:
listener- Listener to add.
-
addOnMouseOverListener
void addOnMouseOverListener(OnMouseOverListener listener)
Add a new OnMouseOverListener on this widget.- Parameters:
listener- Listener to add.
-
contains
boolean contains(be.yildizgames.module.window.input.MousePosition position)
Check if a point in contained in this container.- Parameters:
position- Point coordinates.- Returns:
trueif the point is contained in this container,falseotherwise.
-
contains
boolean contains(int x, int y)
-
addEmptyZone
void addEmptyZone(be.yildizgames.common.geometry.Rectangle zone)
Add a zone to ignore when checking if the container contains the mouse, if the mouse position is inside this zone, it will be considered as outside of the container.- Parameters:
zone- Empty zone.
-
align
void align(Element.Alignment alignment)
Align the widget- Parameters:
alignment- New alignment value.
-
getAbsoluteLeft
int getAbsoluteLeft()
Give the absolute left position instead of relative from parent.- Returns:
- The parent left position + the widget left position.
-
getAbsoluteTop
int getAbsoluteTop()
Give the absolute top position instead of relative from parent.- Returns:
- The parent top position + the widget top position.
-
registerAnimation
void registerAnimation(BaseAnimationGui anim)
-
playAnimation
void playAnimation(String animation)
-
stopAnimation
void stopAnimation(String name)
-
focus
void focus(boolean b)
-
isFocusable
boolean isFocusable()
-
highlight
void highlight(boolean b)
-
-