|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jcontrol.ui.wombat.Component jcontrol.ui.wombat.AbstractFocusComponent jcontrol.ui.wombat.Slider
public class Slider
This class implements a slider user interface object.
The slider can be moved using the keyboard or the touch screen
to simulate analog input. The slider issues notificiation
by throwing an ActionEvent of the type ActionEvent.VALUE_CHANGED
when it is moved.
(c) Copyright 2005-2007 DOMOLOGIC GmbH
Field Summary | |
---|---|
static int |
ORIENTATION_HORIZONTAL
|
static int |
ORIENTATION_VERTICAL
|
Fields inherited from class jcontrol.ui.wombat.AbstractFocusComponent |
---|
BORDER_WIDTH, listener |
Fields inherited from interface jcontrol.ui.wombat.IFocusable |
---|
TRANSFER_FOCUS_BACKWARD, TRANSFER_FOCUS_FORWARD |
Fields inherited from interface jcontrol.ui.wombat.event.TouchListener |
---|
RESULT_ACCEPTED, RESULT_EXECUTED, RESULT_NONE |
Constructor Summary | |
---|---|
Slider(int x,
int y,
int width,
int height,
int min,
int max,
int orientation)
Constructs a slider. |
Method Summary | |
---|---|
int |
getValue()
Get the slider's value. |
KeyEvent |
onKeyEvent(KeyEvent event)
Handle key events. |
int |
onTouchEvent(TouchEvent e)
Every time a touch event is fired, this method will be called. |
void |
paint(XGraphics g)
Paint the Slider. |
void |
setStep(int step)
Sets the step value for the slider. |
boolean |
setValue(int value)
Set the slider value. |
Methods inherited from class jcontrol.ui.wombat.AbstractFocusComponent |
---|
clearCorners, drawBevelRect, drawButton, drawDottedRect, drawFocusRect, getActionListener, onActionEvent, requestFocus, setActionListener, setEnabled, setVisible |
Methods inherited from class jcontrol.ui.wombat.Component |
---|
drawDisabledImage, getFrame, isEnabled, isVisible, isVisibleInternal, redrawInternalAndParent, repaint, repaintAll, safeExec, setBackgroundColor, setBackgroundColorInternal, setBounds, setDirty, setFont, setForegroundColor, setForegroundColorInternal, setParametersInternal, setRedraw, setTransparentColor, unsafeExec, update |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, notifyAll, toString, wait |
Field Detail |
---|
public static final int ORIENTATION_HORIZONTAL
public static final int ORIENTATION_VERTICAL
Constructor Detail |
---|
public Slider(int x, int y, int width, int height, int min, int max, int orientation)
x
- the upper left x coordinate.y
- the upper left y coordinate.width
- the width of the slider (must be horizontal)height
- the height of the slider (must be vertical)min
- the slider's minimum value (>= 0)max
- the slider's maximum value.orientation
- ORIENTATION_HORIZONTAL or ORIENTATION_VERTICALMethod Detail |
---|
public void setStep(int step)
step
- the step.public boolean setValue(int value)
value
- The new value.
public int getValue()
public void paint(XGraphics g)
paint
in class Component
g
- the application's graphics object.public KeyEvent onKeyEvent(KeyEvent event)
onKeyEvent
in interface KeyListener
onKeyEvent
in class AbstractFocusComponent
event
- the key event
null
if the KeyEvent has been consumed by the KeyListener,public int onTouchEvent(TouchEvent e)
TouchListener
onTouchEvent
in interface TouchListener
onTouchEvent
in class AbstractFocusComponent
e
- The touch event.
RESULT_ACCEPTED
if the TouchEvent has been consumed by the TouchListener,RESULT_EXECUTED
if the TouchEvent has been consumed by the TouchListener and some important action has been performed, e.g. an action event has been invoked,RESULT_NONE
if the TouchEvent should be passed on to the next TouchListener.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |