public class Slider extends UiElement implements Actionable
deferredLayout, deferredRender, deferredUpdate, effects, height, styleId, visibility, width, x, y, zIndex
Constructor and Description |
---|
Slider()
Constructor.
|
Slider(float x,
float y,
float width,
float height)
Constructor
|
Slider(java.lang.String id)
Constructor
|
Slider(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() |
float |
getValue()
Returns the
Slider value |
float |
getValueStep()
Returns the amount to change the value by on each keyboard/gamepad
event
|
void |
invokeBeginHover()
Triggers the begin hover event
|
void |
invokeEndHover()
Triggers the end hover event
|
boolean |
isChangedOnBeginEvent()
Returns if the value should change when a keyboard/gamepad event
begins and change the value until the event ends.
|
boolean |
isEnabled() |
boolean |
isInitialLayoutOccurred() |
boolean |
isInitialUpdateOccurred() |
boolean |
isRenderNodeDirty() |
void |
notifyActionListenersOfBeginEvent(EventTrigger eventTrigger,
EventTriggerParams eventTriggerParams) |
void |
notifyActionListenersOfEndEvent(EventTrigger eventTrigger,
EventTriggerParams eventTriggerParams) |
void |
removeActionListener(ActionListener listener) |
void |
setChangedOnBeginEvent(boolean changedOnBeginEvent)
Sets if the value should change when a keyboard/gamepad event
begins and change the value until the event ends.
|
void |
setEnabled(boolean enabled) |
void |
setRenderNodeDirty() |
void |
setStyleId(java.lang.String styleId)
Sets the style if for this
UiElement |
void |
setValue(float value)
Sets the
Slider value. |
void |
setValueStep(float valueStep)
Sets the amount to change the value by on each keyboard/gamepad event
|
void |
setVisibility(Visibility visibility)
Sets the current
Visibility of this UiElement |
void |
setZIndex(int zIndex)
Sets the Z index of this
UiElement . |
void |
syncWithUpdate(UiContainerRenderTree rootNode)
Syncs data between the
UiElement and RenderNode during update |
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
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
addHoverListener, getId, notifyHoverListenersOnBeginHover, notifyHoverListenersOnEndHover, removeHoverListener
public Slider()
Slider
public Slider(java.lang.String id)
id
- The unique ID for this Slider
public Slider(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 Slider(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 void attach(ParentRenderNode<?,?> parentRenderNode)
UiElement
RenderNode
for this element to a parent
RenderNode
attach
in class UiElement
parentRenderNode
- The parent RenderNode
to attach topublic void detach(ParentRenderNode<?,?> parentRenderNode)
UiElement
RenderNode
from a parent
RenderNode
detach
in class UiElement
parentRenderNode
- The parent RenderNode
to detach frompublic void invokeBeginHover()
Hoverable
invokeBeginHover
in interface Hoverable
public void invokeEndHover()
Hoverable
invokeEndHover
in interface Hoverable
public void setVisibility(Visibility visibility)
UiElement
Visibility
of this UiElement
setVisibility
in class UiElement
visibility
- The Visibility
to setpublic void setStyleId(java.lang.String styleId)
UiElement
UiElement
setStyleId
in class UiElement
styleId
- The style id to setpublic void syncWithUpdate(UiContainerRenderTree rootNode)
UiElement
UiElement
and RenderNode
during updatesyncWithUpdate
in class UiElement
public void setZIndex(int zIndex)
UiElement
UiElement
. Elements will be rendered on
different Z layers in ascending Z order (negatives values first, positive values last)public StyleRule getStyleRule()
getStyleRule
in class UiElement
public boolean isEnabled()
isEnabled
in interface Actionable
public void setEnabled(boolean enabled)
setEnabled
in interface Actionable
public void notifyActionListenersOfBeginEvent(EventTrigger eventTrigger, EventTriggerParams eventTriggerParams)
notifyActionListenersOfBeginEvent
in interface Actionable
public void notifyActionListenersOfEndEvent(EventTrigger eventTrigger, EventTriggerParams eventTriggerParams)
notifyActionListenersOfEndEvent
in interface Actionable
public void addActionListener(ActionListener listener)
addActionListener
in interface Actionable
public void removeActionListener(ActionListener listener)
removeActionListener
in interface Actionable
public float getValue()
Slider
valuepublic void setValue(float value)
Slider
value.value
- A value between 0.0 and 1.0public float getValueStep()
public void setValueStep(float valueStep)
valueStep
- A non-zero valuepublic boolean isChangedOnBeginEvent()
public void setChangedOnBeginEvent(boolean changedOnBeginEvent)
changedOnBeginEvent
- False to only change on the end eventpublic boolean isRenderNodeDirty()
isRenderNodeDirty
in class UiElement
public void setRenderNodeDirty()
setRenderNodeDirty
in class UiElement
public boolean isInitialLayoutOccurred()
isInitialLayoutOccurred
in class UiElement
public boolean isInitialUpdateOccurred()
isInitialUpdateOccurred
in class UiElement
public int getRenderX()
UiElement
getRenderX
in class UiElement
Integer.MIN_VALUE
if not renderingpublic int getRenderY()
UiElement
getRenderY
in class UiElement
Integer.MIN_VALUE
if not renderingpublic int getRenderWidth()
UiElement
getRenderWidth
in class UiElement
public int getRenderHeight()
UiElement
getRenderHeight
in class UiElement