public abstract class SimpleContainer extends BaseWidget implements Container
Element.AlignmentMAX_OPACITY, virtualHeightemptyZones| Modifier | Constructor | Description |
|---|---|---|
protected |
SimpleContainer(String name,
BaseCoordinate coordinates,
Material backgroundMaterial,
boolean widget) |
Full container.
|
protected |
SimpleContainer(String name,
BaseCoordinate coordinates,
Material backgroundMaterial,
SimpleContainer parent,
boolean widget) |
Full container.
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
addChildrenLeft(int left) |
Move all children left or right by adding a value to its current x value.
|
void |
addChildrenPosition(int left,
int top) |
Move all children by adding a value to its current position.
|
protected abstract void |
addChildrenPositionImpl(int left,
int top) |
Implementation specific add children position.
|
void |
addChildrenTop(int top) |
Move all children up or down by adding a value to its current y value.
|
protected void |
addEmptyZoneImpl(be.yildizgames.common.geometry.Rectangle zone) |
|
void |
addWidget(ContainerChild child) |
|
void |
addWidget(BaseContainerChild child) |
Add a new Widget in the container.
|
void |
disableHighlight() |
|
abstract String |
getElementName(int x,
int y) |
|
String |
getElementName(be.yildizgames.common.geometry.Point2D position) |
Retrieve a child element from its position.
|
List<Widget> |
getElements(be.yildizgames.common.geometry.Rectangle rectangle) |
Retrieve all child elements contained in a rectangle.
|
Material |
getMaterial() |
|
Widget |
getNextFocusableElement() |
Get the next child with focusable status.
|
Optional<Widget> |
getWidgetAt(int x,
int y) |
|
Optional<Widget> |
getWidgetAt(be.yildizgames.common.geometry.Point2D position) |
|
Optional<Widget> |
getWidgetAt(MousePosition position) |
|
Zorder |
getZ() |
|
void |
hideContent() |
Hide all the container sub elements.
|
protected void |
highlightImpl(boolean over) |
Does nothing.
|
void |
ignore(BaseWidget widget) |
|
void |
remove(ContainerChild child) |
|
void |
remove(BaseContainerChild element) |
Remove and delete a Widget from the GuiContainer.
|
void |
setContentVisible(boolean visible) |
Show or hide the content of this container.
|
void |
setCurrentFocus(BaseWidget widget) |
Set a child widget as focused.
|
void |
setCurrentFocus(Widget focus) |
|
void |
setMaterial(Material newMaterial) |
Set the GuiContainer material.
|
protected abstract void |
setMaterialImpl(Material newMaterial) |
Set the Material in implementation.
|
void |
setZ(Zorder z) |
Set the container Z order.
|
protected abstract void |
setZImpl(Zorder z) |
Implementation specific to set the Z order.
|
void |
showContent() |
Show all the container sub elements.
|
void |
zoom(float zoomFactor) |
Make a zoom on the container.
|
protected abstract void |
zoomImpl(float factor) |
Zoom the GuiContainer in implementation.
|
addToLeft, addToPosition, addToTop, delete, getBottom, getCoordinates, getHeight, getLeft, getOpacity, getRight, getTop, getWidth, hide, hideImpl, isVisible, multiplySize, resetVirtualHeight, setCoordinates, setHeight, setLeft, setLeft, setLeft, setLeft, setPosition, setPosition, setPosition, setPositionImpl, setSize, setSize, setSizeImpl, setTop, setTop, setTop, setTop, setVirtualHeight, setVisible, setWidth, show, showImpl, updateAddPositionValueaddEmptyZone, addKeyboardListener, addMouseDoubleLeftClickListener, addMouseDragListener, addMouseLeftClickListener, addMouseMoveListener, addMouseReleaseListener, addMouseWheelListener, addOnMouseOverListener, addSpecialKeyListener, align, contains, contains, deleteKeyPressed, disableEmptyZone, enableEmptyZone, enterKeyPressed, findParent, focus, forceContainsFalse, getAbsoluteLeft, getAbsolutePosition, getAbsoluteTop, highlight, isContainer, isFocusable, isMouseOver, keyPressed, mouseLeftClick, playAnimation, registerAnimation, removeAllClickListeners, setFocusable, setHighlightable, setMouseClickActive, setMouseOver, setStatic, stopAnimation, toStringaddToLeft, 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, stopAnimationprotected SimpleContainer(String name, BaseCoordinate coordinates, Material backgroundMaterial, SimpleContainer parent, boolean widget)
name - Container name, must be unique.coordinates - Container size and position.backgroundMaterial - The Material to use for background.parent - Parent container.widget - Flag to set this container being considered as container or widget.protected SimpleContainer(String name, BaseCoordinate coordinates, Material backgroundMaterial, boolean widget)
name - Container name, must be unique.coordinates - Container size and position.backgroundMaterial - The Material to use for background.widget - Flag to set this container being considered as container or widget.public final void zoom(float zoomFactor)
zoomFactor - Zoom value.public final void showContent()
showContent in interface Containerpublic final void hideContent()
hideContent in interface Containerpublic final String getElementName(be.yildizgames.common.geometry.Point2D position)
position - Element position.public abstract String getElementName(int x, int y)
public final List<Widget> getElements(be.yildizgames.common.geometry.Rectangle rectangle)
rectangle - Rectangle containing the elements.public final void addChildrenLeft(int left)
left - Value to add to the children current x position.public final void addChildrenTop(int top)
top - Value to add to the children current y position.public final void addChildrenPosition(int left,
int top)
left - Value to add to the children current x position.top - Value to add to the children current y position.protected final void addEmptyZoneImpl(be.yildizgames.common.geometry.Rectangle zone)
addEmptyZoneImpl in class BaseWidgetprotected abstract void addChildrenPositionImpl(int left,
int top)
left - Value to add to the children current x position.top - Value to add to the children current y position.public final void addWidget(BaseContainerChild child)
child - Element to add.public void ignore(BaseWidget widget)
public final void remove(BaseContainerChild element)
element - Element to remove.protected final void highlightImpl(boolean over)
highlightImpl in class BaseWidgetover - Unused.protected abstract void zoomImpl(float factor)
factor - Factor of zoom.public final void setCurrentFocus(BaseWidget widget)
widget - Child to focus.public final Widget getNextFocusableElement()
getNextFocusableElement in interface Containernull if none found.public final void setMaterial(Material newMaterial)
setMaterial in interface ContainernewMaterial - Material to use for background..protected abstract void setMaterialImpl(Material newMaterial)
newMaterial - New Material to use.public final void setContentVisible(boolean visible)
visible - true will display the content, false
will hide it.public final void setZ(Zorder z)
protected abstract void setZImpl(Zorder z)
z - Z order.public final void disableHighlight()
disableHighlight in interface Containerpublic final Optional<Widget> getWidgetAt(be.yildizgames.common.geometry.Point2D position)
getWidgetAt in interface Containerpublic final Optional<Widget> getWidgetAt(MousePosition position)
getWidgetAt in interface Containerpublic final Optional<Widget> getWidgetAt(int x, int y)
getWidgetAt in interface Containerpublic Material getMaterial()
public void addWidget(ContainerChild child)
public void remove(ContainerChild child)
public void setCurrentFocus(Widget focus)
setCurrentFocus in interface ContainerCopyright © 2014–2018. All rights reserved.