public abstract class CustomUiElement extends UiElement implements Actionable
UiElementsdeferredLayout, deferredRender, deferredUpdate, effects, height, styleId, visibility, width, x, y, zIndex| Constructor and Description |
|---|
CustomUiElement()
Constructor.
|
CustomUiElement(float x,
float y,
float width,
float height)
Constructor
|
CustomUiElement(java.lang.String id)
Constructor
|
CustomUiElement(java.lang.String id,
float x,
float y,
float width,
float height)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
addActionListener(ActionListener listener) |
void |
attach(ParentRenderNode<?,?> parentRenderNode)
Attaches a
RenderNode for this element to a parent
RenderNode |
void |
detach(ParentRenderNode<?,?> parentRenderNode)
Detaches this element's
RenderNode from a parent
RenderNode |
int |
getRenderHeight()
Returns the height this element is currently rendering at
|
int |
getRenderWidth()
Returns the width this element is currently rendering at
|
int |
getRenderX()
Returns X coordinate of where this element is currently rendering
|
int |
getRenderY()
Returns Y coordinate of where this element is currently rendering
|
StyleRule |
getStyleRule() |
abstract void |
interpolate(float alpha)
Interpoalte the UI state
|
void |
invokeBeginHover()
Triggers the begin hover event
|
void |
invokeEndHover()
Triggers the end hover event
|
boolean |
isEnabled() |
boolean |
isInitialLayoutOccurred() |
boolean |
isInitialUpdateOccurred() |
boolean |
isRenderNodeDirty() |
void |
notifyActionListenersOfBeginEvent(EventTrigger eventTrigger,
EventTriggerParams eventTriggerParams) |
void |
notifyActionListenersOfEndEvent(EventTrigger eventTrigger,
EventTriggerParams eventTriggerParams) |
void |
onMouseDown(int mouseX,
int mouseY,
int pointer,
int button)
An overridable method that is called when the mouse/touch is pressed down on this element
|
void |
onMouseMoved(int mouseX,
int mouseY)
An overridable method that is called when the mouse moves
|
void |
onMouseUp(int mouseX,
int mouseY,
int pointer,
int button)
An overridable method that is called when the mouse/touch is released after being pressed down on this element
|
void |
removeActionListener(ActionListener listener) |
abstract void |
render(Graphics g,
CustomUiElementRenderNode renderNode)
Render the
UiElement |
void |
setEnabled(boolean enabled) |
void |
setRenderNodeDirty() |
void |
setStyleId(java.lang.String styleId)
Sets the style if for this
UiElement |
void |
setVisibility(Visibility visibility)
Sets the current
Visibility of this UiElement |
void |
setZIndex(int zIndex)
Sets the Z index of this
UiElement. |
abstract void |
update(UiContainerRenderTree uiContainer,
float delta)
Update the UI state
|
addEffectListener, addHoverListener, addNodeStateListener, alignAbove, alignBelow, alignEdgeToEdge, alignLeftOf, alignRightOf, applyEffect, deferUntilLayout, deferUntilLayout, deferUntilRender, deferUntilRender, deferUntilUpdate, deferUntilUpdate, deferUntilUpdate, deferUntilUpdate, equals, getContentHeight, getContentWidth, getElementById, getHeight, getId, getMarginBottom, getMarginLeft, getMarginRight, getMarginTop, getPaddingBottom, getPaddingLeft, getPaddingRight, getPaddingTop, getStyleId, getVisibility, getWidth, getX, getY, getZIndex, hashCode, isDebugEnabled, isFlexLayout, isInitialised, notifyEffectListenersOnFinished, notifyHoverListenersOnBeginHover, notifyHoverListenersOnEndHover, notifyNodeStateListeners, removeEffectListener, removeHoverListener, removeNodeStateListener, set, setContentHeight, setContentWidth, setDebugEnabled, setHeight, setHeightToContentHeightOf, setHeightToHeightOf, setWidth, setWidthToContentWidthOf, setWidthToWidthOf, setX, setXY, setY, snapTo, snapTo, syncWithLayout, syncWithRender, syncWithUpdateclone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitaddHoverListener, getId, notifyHoverListenersOnBeginHover, notifyHoverListenersOnEndHover, removeHoverListenerpublic CustomUiElement()
Checkboxpublic CustomUiElement(java.lang.String id)
id - The unique ID for this Checkboxpublic CustomUiElement(float x,
float y,
float width,
float height)
x - The x coordinate of this element relative to its parenty - The y coordinate of this element relative to its parentwidth - The width of this elementheight - The height of this elementpublic CustomUiElement(java.lang.String id,
float x,
float y,
float width,
float height)
id - The unique ID for this element (if null an ID will be generated)x - The x coordinate of this element relative to its parenty - The y coordinate of this element relative to its parentwidth - The width of this elementheight - The height of this elementpublic abstract void update(UiContainerRenderTree uiContainer, float delta)
uiContainer - The root UiElementdelta - The time since the last updatepublic abstract void interpolate(float alpha)
alpha - public abstract void render(Graphics g, CustomUiElementRenderNode renderNode)
UiElementg - The Graphics contextrenderNode - The RenderNode detailing where to render the elementpublic void onMouseMoved(int mouseX,
int mouseY)
mouseX - The mouse screen X coordinatemouseY - The mouse screen Y coordinatepublic void onMouseDown(int mouseX,
int mouseY,
int pointer,
int button)
mouseX - The mouse/touch screen X coordinatemouseY - The mouse/touch screen Y coordinatepointer - The pointer IDbutton - The button ID (see Input.buttons)public void onMouseUp(int mouseX,
int mouseY,
int pointer,
int button)
mouseX - The mouse/touch screen X coordinatemouseY - The mouse/touch screen Y coordinatepointer - The pointer IDbutton - The button ID (see Input.buttons)public void attach(ParentRenderNode<?,?> parentRenderNode)
UiElementRenderNode for this element to a parent
RenderNodeattach in class UiElementparentRenderNode - The parent RenderNode to attach topublic void detach(ParentRenderNode<?,?> parentRenderNode)
UiElementRenderNode from a parent
RenderNodedetach in class UiElementparentRenderNode - The parent RenderNode to detach frompublic void invokeBeginHover()
HoverableinvokeBeginHover in interface Hoverablepublic void invokeEndHover()
HoverableinvokeEndHover in interface Hoverablepublic void setVisibility(Visibility visibility)
UiElementVisibility of this UiElementsetVisibility in class UiElementvisibility - The Visibility to setpublic void setStyleId(java.lang.String styleId)
UiElementUiElementsetStyleId in class UiElementstyleId - The style id to setpublic void setZIndex(int zIndex)
UiElementUiElement. Elements will be rendered on
different Z layers in ascending Z order (negatives values first, positive values last)public StyleRule getStyleRule()
getStyleRule in class UiElementpublic boolean isRenderNodeDirty()
isRenderNodeDirty in class UiElementpublic void setRenderNodeDirty()
setRenderNodeDirty in class UiElementpublic boolean isInitialLayoutOccurred()
isInitialLayoutOccurred in class UiElementpublic boolean isInitialUpdateOccurred()
isInitialUpdateOccurred in class UiElementpublic void notifyActionListenersOfBeginEvent(EventTrigger eventTrigger, EventTriggerParams eventTriggerParams)
notifyActionListenersOfBeginEvent in interface Actionablepublic void notifyActionListenersOfEndEvent(EventTrigger eventTrigger, EventTriggerParams eventTriggerParams)
notifyActionListenersOfEndEvent in interface Actionablepublic boolean isEnabled()
isEnabled in interface Actionablepublic void setEnabled(boolean enabled)
setEnabled in interface Actionablepublic void addActionListener(ActionListener listener)
addActionListener in interface Actionablepublic void removeActionListener(ActionListener listener)
removeActionListener in interface Actionablepublic int getRenderX()
UiElementgetRenderX in class UiElementInteger.MIN_VALUE if not renderingpublic int getRenderY()
UiElementgetRenderY in class UiElementInteger.MIN_VALUE if not renderingpublic int getRenderWidth()
UiElementgetRenderWidth in class UiElementpublic int getRenderHeight()
UiElementgetRenderHeight in class UiElement