be.yildizgames.common.util.Registerable, ElementAbstractIconElement, AbstractTextElement, BaseWidgetpublic abstract class BaseElement extends be.yildizgames.common.util.BaseRegisterable implements Element
Element.Alignment| Modifier and Type | Field | Description |
|---|---|---|
static int |
MAX_OPACITY |
Value for maximum opacity.
|
protected int |
virtualHeight |
| Modifier | Constructor | Description |
|---|---|---|
protected |
BaseElement(String name,
BaseCoordinate coordinates) |
Full constructor.
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
addToLeft(int value) |
Move the element left or right by adding a value to its current x value.
|
void |
addToPosition(int xValue,
int yValue) |
Move the widget.
|
void |
addToTop(int value) |
Move the element up or down by adding a value to its current y value.
|
abstract void |
delete() |
Delete the widget.
|
int |
getBottom() |
|
BaseCoordinate |
getCoordinates() |
|
int |
getHeight() |
|
int |
getLeft() |
|
int |
getOpacity() |
|
int |
getRight() |
|
int |
getTop() |
|
int |
getWidth() |
|
Element |
hide() |
Set the element invisible on screen.
|
protected abstract void |
hideImpl() |
Implementation to set the widget invisible.
|
boolean |
isVisible() |
|
void |
multiplySize(float factor) |
Multiply the size of the element.
|
void |
resetVirtualHeight() |
|
void |
setCoordinates(Coordinates coordinates) |
Set the position and size coordinates.
|
void |
setHeight(int value) |
Set the widget height.
|
Element |
setLeft(int leftValue) |
Set the element left position.
|
BaseElement |
setLeft(Element other,
PositionRelativeLeft relative) |
Set the element left position relative to an other widget.
|
BaseElement |
setLeft(Element other,
PositionRelativeLeft relative,
int diff) |
Set the element left position relative to an other element with a position difference.
|
BaseElement |
setLeft(Element other,
PositionRelativeLeft left,
Relative relativeDiff) |
Set the element left position relative to an other element with a position difference relative to the width of the parent.
|
Element |
setPosition(int leftPosition,
int topPosition) |
Set the left and top element position.
|
Element |
setPosition(be.yildizgames.common.geometry.Point2D position) |
Set the element position.
|
BaseElement |
setPosition(Element other) |
Set at the same position as the other element.
|
protected abstract Element |
setPositionImpl(int newLeft,
int newTop) |
Implementation to update the widget position.
|
void |
setSize(int newWidth,
int newHeight) |
Update the widget size.
|
void |
setSize(Size size) |
Update the widget size.
|
protected abstract void |
setSizeImpl(int newWidth,
int newHeight) |
Implementation to set the widget size.
|
Element |
setTop(int topValue) |
Set the element top position.
|
BaseElement |
setTop(Element other,
PositionRelativeTop relative) |
Set the element top position relative to an other widget.
|
BaseElement |
setTop(Element other,
PositionRelativeTop relative,
int diff) |
Set the element top position relative to an other element with a position difference.
|
BaseElement |
setTop(Element other,
PositionRelativeTop top,
Relative relativeDiff) |
Set the element top position relative to an other element with a position difference relative to the height of the parent.
|
void |
setVirtualHeight(int height) |
|
Element |
setVisible(boolean visible) |
Show or hide the element.
|
void |
setWidth(int value) |
Set the widget width.
|
Element |
show() |
Set the element visible on screen.
|
protected abstract void |
showImpl() |
Implementation to set the widget visible.
|
void |
updateAddPositionValue(int left,
int top) |
Update position value without updating the widget.
|
equals, getName, hashCode, toStringpublic static final int MAX_OPACITY
protected int virtualHeight
protected BaseElement(String name, BaseCoordinate coordinates)
name - Element name, must be unique.coordinates - Element size and position.public final BaseElement setLeft(Element other, PositionRelativeLeft relative, int diff)
public final BaseElement setLeft(Element other, PositionRelativeLeft left, Relative relativeDiff)
public final Element setVisible(boolean visible)
setVisible in interface Elementvisible - true will set the element visible, false will hide it.public final BaseElement setLeft(Element other, PositionRelativeLeft relative)
public final void updateAddPositionValue(int left,
int top)
left - Value to add to left value.top - Value to add to top value.public final BaseElement setTop(Element other, PositionRelativeTop relative, int diff)
public final BaseElement setTop(Element other, PositionRelativeTop top, Relative relativeDiff)
public final BaseElement setTop(Element other, PositionRelativeTop relative)
public final BaseElement setPosition(Element other)
setPosition in interface Elementother - Other element to get the position.public final Element show()
Elementpublic final Element hide()
Elementpublic final void addToPosition(int xValue,
int yValue)
addToPosition in interface ElementxValue - Add this value to the container current X position.yValue - Add this value to the container current Y position.public final void addToLeft(int value)
public final void addToTop(int value)
public final void multiplySize(float factor)
factor - Multiplication factor.public abstract void delete()
protected abstract void showImpl()
protected abstract void hideImpl()
public final Element setPosition(int leftPosition, int topPosition)
setPosition in interface ElementleftPosition - Left position.topPosition - Top position.public final Element setPosition(be.yildizgames.common.geometry.Point2D position)
setPosition in interface Elementposition - New position.public final Element setTop(int topValue)
Elementpublic final Element setLeft(int leftValue)
Elementpublic final int getBottom()
public final void setSize(Size size)
public final void setHeight(int value)
public final void setWidth(int value)
public final BaseCoordinate getCoordinates()
getCoordinates in interface Elementpublic final void setCoordinates(Coordinates coordinates)
setCoordinates in interface Elementcoordinates - Coordinates to set.public final void setSize(int newWidth,
int newHeight)
public final int getWidth()
public final int getHeight()
public final int getLeft()
public final int getTop()
public final int getOpacity()
public final int getRight()
public final void setVirtualHeight(int height)
setVirtualHeight in interface Elementpublic final void resetVirtualHeight()
resetVirtualHeight in interface Elementprotected abstract void setSizeImpl(int newWidth,
int newHeight)
newWidth - New width.newHeight - New height.protected abstract Element setPositionImpl(int newLeft, int newTop)
newLeft - New widget x position.newTop - New widget y position.Copyright © 2014–2018. All rights reserved.