|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.lwuit.Component com.sun.lwuit.Label com.sun.lwuit.Slider
public class Slider
The slider component serves both as a slider widget to allow users to select a value on a scale via touch/arrows and also to indicate progress. The slider defaults to percentage display but can represent any positive set of values.
Field Summary |
---|
Fields inherited from class com.sun.lwuit.Component |
---|
BOTTOM, BRB_CENTER_OFFSET, BRB_CONSTANT_ASCENT, BRB_CONSTANT_DESCENT, BRB_OTHER, CENTER, LEFT, RIGHT, TOP |
Constructor Summary | |
---|---|
Slider()
The default constructor uses internal rendering to draw its state |
Method Summary | |
---|---|
void |
addDataChangedListener(DataChangedListener l)
Adds a listener to data changed events |
boolean |
animate()
Allows the animation to reduce "repaint" calls when it returns false. |
protected Dimension |
calcPreferredSize()
Return the size we would generally like for the component |
static Slider |
createInfinite()
Creates an infinite progress slider |
void |
deinitialize()
Invoked to indicate that the component initialization is being reversed since the component was detached from the container hierarchy. |
protected void |
fireClicked()
When working in 3 softbutton mode "fire" key (center softbutton) is sent to this method in order to allow 3 button devices to work properly. |
int |
getIncrements()
The increments when the user presses a key to the left/right/up/down etc. |
int |
getMaxValue()
|
int |
getMinValue()
|
int |
getProgress()
Indicates the value of progress made |
Style |
getStyle()
Returns the Component Style allowing us to manipulate the look of the component |
Image |
getThumbImage()
The thumb image is drawn on top of the current progress |
void |
initComponent()
Allows subclasses to bind functionality that relies on fully initialized and "ready for action" component state |
boolean |
isEditable()
Indicates the slider is modifyable |
boolean |
isInfinite()
The infinite slider functionality is used to animate progress for which there is no defined value. |
boolean |
isRenderPercentageOnTop()
Indicates that the value of the slider should be rendered with a percentage sign on top of the slider. |
boolean |
isRenderValueOnTop()
|
protected boolean |
isSelectableInteraction()
This method allows a component to indicate that it is interested in an "implicit" select command to appear in the "fire" button when 3 softbuttons are defined in a device. |
boolean |
isVertical()
Indicates the slider is vertical |
void |
keyPressed(int code)
If this Component is focused, the key pressed event will call this method |
void |
paintBackground(Graphics g)
Paint the progress indicator |
void |
pointerDragged(int x,
int y)
If this Component is focused, the pointer dragged event will call this method |
void |
pointerPressed(int x,
int y)
If this Component is focused, the pointer pressed event will call this method |
void |
pointerReleased(int x,
int y)
If this Component is focused, the pointer released event will call this method |
void |
refreshTheme()
Makes sure the component is up to date with the current style object |
void |
removeDataChangedListener(DataChangedListener l)
Removes a listener from data changed events |
void |
setEditable(boolean editable)
Indicates the slider is modifyable |
void |
setIncrements(int increments)
The increments when the user presses a key to the left/right/up/down etc. |
void |
setInfinite(boolean i)
Activates/disables the infinite slider functionality used to animate progress for which there is no defined value. |
void |
setMaxValue(int maxValue)
|
void |
setMinValue(int minValue)
|
void |
setProgress(int value)
Indicates the value of progress made, this method is thread safe and can be invoked from any thread although discression should still be kept so one thread doesn't regress progress made by another thread... |
void |
setRenderPercentageOnTop(boolean renderPercentageOnTop)
Indicates that the value of the slider should be rendered with a percentage sign on top of the slider. |
void |
setRenderValueOnTop(boolean renderValueOnTop)
|
void |
setThumbImage(Image thumbImage)
The thumb image is drawn on top of the current progress |
void |
setUIID(java.lang.String id)
This method sets the Component the Unique identifier. |
void |
setVertical(boolean vertical)
Indicates the slider is vertical |
Methods inherited from class com.sun.lwuit.Label |
---|
getAlignment, getBaselineResizeBehavior, getGap, getIcon, getShiftText, getText, getTextPosition, getVerticalAlignment, isDefaultTickerEnabled, isEndsWith3Points, isTickerEnabled, isTickerRunning, paint, paramString, setAlignment, setDefaultTickerEnabled, setEndsWith3Points, setGap, setIcon, setShiftText, setText, setTextPosition, setTickerEnabled, setVerticalAlignment, shouldTickerStart, startTicker, startTicker, stopTicker |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Slider()
Method Detail |
---|
public void setUIID(java.lang.String id)
Component
setUIID
in class Component
id
- UIID unique identifier for component typepublic void initComponent()
Component
initComponent
in class Component
public void deinitialize()
Component
deinitialize
in class Component
public boolean animate()
Animation
Display
class.
animate
in interface Animation
animate
in class Label
public boolean isInfinite()
public void setInfinite(boolean i)
i
- true for infinite progresspublic static Slider createInfinite()
public void refreshTheme()
Component
refreshTheme
in class Component
public int getProgress()
public void setProgress(int value)
value
- new value for progresspublic Style getStyle()
Component
getStyle
in class Component
protected Dimension calcPreferredSize()
calcPreferredSize
in class Label
public void paintBackground(Graphics g)
paintBackground
in class Component
g
- the component graphicspublic boolean isVertical()
public void setVertical(boolean vertical)
vertical
- true if the slider is verticalpublic boolean isEditable()
public void setEditable(boolean editable)
editable
- true if the slider is editablepublic void pointerPressed(int x, int y)
Component
pointerPressed
in class Component
x
- the pointer x coordinatey
- the pointer y coordinatepublic void pointerDragged(int x, int y)
Component
pointerDragged
in class Component
x
- the pointer x coordinatey
- the pointer y coordinateprotected void fireClicked()
Component
fireClicked
in class Component
protected boolean isSelectableInteraction()
Component
isSelectableInteraction
in class Component
public void pointerReleased(int x, int y)
Component
pointerReleased
in class Component
x
- the pointer x coordinatey
- the pointer y coordinatepublic void keyPressed(int code)
Component
keyPressed
in class Component
code
- the key code value to indicate a physical key.public int getIncrements()
public void setIncrements(int increments)
increments
- increment valuepublic void addDataChangedListener(DataChangedListener l)
l
- new listenerpublic void removeDataChangedListener(DataChangedListener l)
l
- listener to removepublic boolean isRenderPercentageOnTop()
public void setRenderPercentageOnTop(boolean renderPercentageOnTop)
renderPercentageOnTop
- true to render percentagespublic boolean isRenderValueOnTop()
public void setRenderValueOnTop(boolean renderValueOnTop)
renderValueOnTop
- the renderValueOnTop to setpublic int getMaxValue()
public void setMaxValue(int maxValue)
maxValue
- the maxValue to setpublic int getMinValue()
public void setMinValue(int minValue)
minValue
- the minValue to setpublic Image getThumbImage()
public void setThumbImage(Image thumbImage)
thumbImage
- the thumbImage to set
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |