public class Slider extends Widget
Slider can be vertical or horizontal. Vertical slider can be created if the width of the object is smaller than its height.
Modifier and Type | Field and Description |
---|---|
static int |
MODE_NORMAL
normal mode
|
static int |
MODE_RANGE
range mode
|
SCROLL_DIR_ALL, SCROLL_DIR_BOTTOM, SCROLL_DIR_HORIZONTAL, SCROLL_DIR_LEFT, SCROLL_DIR_NONE, SCROLL_DIR_RIGHT, SCROLL_DIR_TOP, SCROLL_DIR_VERTICAL, SCROLLBAR_MODE_ACTIVE, SCROLLBAR_MODE_AUTO, SCROLLBAR_MODE_OFF, SCROLLBAR_MODE_ON, STATE_CHECKED, STATE_DEFAULT, STATE_DISABLED, STATE_SCROLLED
ALIGN_BOTTOM, ALIGN_CENTER, ALIGN_DEFAULT, ALIGN_LEFT, ALIGN_RIGHT, ALIGN_TOP, objImpl, SIDE_BOTTOM, SIDE_FULL, SIDE_LEFT, SIDE_RIGHT, SIDE_TOP, SIZE_CONTENT, TEXT_DECOR_NONE, TEXT_DECOR_STRIKETHROUGH, TEXT_DECOR_UNDERLINE
Constructor and Description |
---|
Slider() |
Modifier and Type | Method and Description |
---|---|
UIObject |
getIndicator()
Gets a virtual ui object which represents the indicator of the object.
|
UIObject |
getIndicatorOfState(int state)
Gets a virtual ui object which represents the indicator of the object in
specified state.
|
int |
getMaxValue()
Gets the maximum value of the slider
|
int |
getMinValue()
Gets the minimum value of the slider
|
int |
getMode()
Gets the mode of the slider.
|
int |
getStartValue()
Gets the start value of the slider
|
int |
getValue()
Gets the value of the slider
|
void |
setMode(int newMode)
Sets the mode of the slider.
|
void |
setRange(int min,
int max)
Sets minimum and maximum values of the slider
|
void |
setStartValue(int value)
Sets a new start value of the slider.
The start value should be smaller than the value. |
void |
setValue(int value)
Sets a new value of the slider
|
getContainer
getObjectOfState, getScrollbar, getScrollbarMode, getScrollbarOfState, getScrollBottom, getScrollDirection, getScrollLeft, getScrollRight, getScrollTop, getScrollX, getScrollY, isChecked, isClickable, isDisabled, isFloating, isHidden, isIgnoreLayout, isScrollable, isScrolled, resetAllListeners, scrollToView, scrollToView, scrollToX, scrollToX, scrollToY, scrollToY, setCancelListener, setChecked, setClickable, setClickedListener, setDisabled, setFloating, setHidden, setIgnoreLayout, setReadyListener, setScrollable, setScrollbarMode, setScrollDirection, setScrollListener, setValueChangedListener
enableClipCorner, forceNewTrack, getBackgroundColor, getBorderColor, getBorderWidth, getColumnPadding, getCoordinates, getFlexGrow, getHeight, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getName, getPadding, getParent, getPropertyBooleanValue, getPropertyIntValue, getRadius, getRowPadding, getShadowColor, getShadowOffsetX, getShadowOffsetY, getShadowWidth, getTextColor, getTextLetterSpace, getTextLineSpace, getTranslateX, getTranslateY, getUserData, getWidth, getX, getY, isClipCornerEnabled, setAlign, setBackgroundColor, setBorderColor, setBorderWidth, setColumnPadding, setFlexGrow, setHeight, setMaxHeight, setMaxWidth, setMinHeight, setMinWidth, setName, setPadding, setPadding, setParent, setPos, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setRadius, setRecolor, setRowPadding, setShadowColor, setShadowOffsetX, setShadowOffsetY, setShadowWidth, setSize, setTextAlign, setTextColor, setTextDecor, setTextFont, setTextLetterSpace, setTextLineSpace, setTranslateX, setTranslateY, setUserData, setWidth, setX, setY
public static final int MODE_NORMAL
Start value is equal to minimum value.
public static final int MODE_RANGE
Start value can be set.
public void setValue(int value)
value
- the new valuepublic int getValue()
public void setRange(int min, int max)
min
- minimum valuemax
- maximum valuepublic int getMinValue()
public int getMaxValue()
public void setMode(int newMode)
newMode
- the new modeMODE_NORMAL
or MODE_RANGE
public int getMode()
public void setStartValue(int value)
Only valid for slider in mode MODE_RANGE
value
- the new start valuepublic int getStartValue()
public UIObject getIndicator()
public UIObject getIndicatorOfState(int state)
state
- a combination of states. such as
STATE_CHECKED
,
STATE_SCROLLED
, ...