|
||||||||||
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.List com.sun.lwuit.spinner.Spinner
public class Spinner
A spinner allows us to select a numeric, date or time value using the arrow keys in a similar way to a list or a combo box.
Field Summary | |
---|---|
static int |
DATE_FORMAT_DD_MM_YY
Value for create date renderer represnting Day-Month-2 Digit Year |
static int |
DATE_FORMAT_DD_MM_YYYY
Value for create date renderer represnting Day-Month-4 Digit Year |
static int |
DATE_FORMAT_MM_DD_YY
Value for create date renderer represnting Month-Day-2 Digit Year |
static int |
DATE_FORMAT_MM_DD_YYYY
Value for create date renderer represnting Month-Day-4 Digit Year |
Fields inherited from class com.sun.lwuit.List |
---|
FIXED_CENTER, FIXED_LEAD, FIXED_NONE, FIXED_NONE_CYCLIC, FIXED_NONE_ONE_ELEMENT_MARGIN_FROM_EDGE, FIXED_TRAIL, HORIZONTAL, VERTICAL |
Fields inherited from class com.sun.lwuit.Component |
---|
BOTTOM, BRB_CENTER_OFFSET, BRB_CONSTANT_ASCENT, BRB_CONSTANT_DESCENT, BRB_OTHER, CENTER, LEFT, RIGHT, TOP |
Method Summary | |
---|---|
boolean |
animate()
Allows the animation to reduce "repaint" calls when it returns false. |
protected Dimension |
calcPreferredSize()
Calculates the preferred size based on component content. |
protected Dimension |
calcScrollSize()
Method that can be overriden to represent the actual size of the component when it differs from the desireable size for the viewport |
static Spinner |
create(double min,
double max,
double currentValue,
double step)
Creates a new numeric spinner instance |
static Spinner |
create(int min,
int max,
int currentValue,
int step)
Creates a new numeric spinner instance |
static Spinner |
createDate(long min,
long max,
long currentValue,
char separatorChar,
int format)
Creates a new date spinner instance |
static Spinner |
createTime(int min,
int max,
int currentValue,
int step,
boolean twentyFourHours,
boolean showSeconds)
Creates a new time spinner instance, time is an integer represented in seconds since mindnight |
static int |
getInputSkipDelay()
Indicates the time after which the skip input area for entering spinner values manually will disappear |
static Image |
getSpinnerHandle()
The image appearing on the side of the spinner widget to indicate its "spinnability" |
java.lang.Object |
getValue()
Returns the value of the spinner to a number or a date based on the spinner type |
protected void |
initComponent()
Allows subclasses to bind functionality that relies on fully initialized and "ready for action" component state |
boolean |
isRTL()
Is the component a bidi RTL component |
void |
keyPressed(int code)
If this Component is focused, the key pressed event will call this method |
void |
keyReleased(int code)
If this Component is focused, the key released event will call this method |
void |
paint(Graphics g)
This method paints the Component on the screen, it should be overriden by subclasses to perform custom drawing or invoke the UI API's to let the PLAF perform the rendering. |
void |
refreshTheme()
Makes sure the component is up to date with the current style object |
static void |
setInputSkipDelay(int aInputSkipDelay)
Indicates the time after which the skip input area for entering spinner values manually will disappear |
void |
setRTL(boolean rtl)
Is the component a bidi RTL component |
static void |
setSpinnerHandle(Image aSpinnerHandle)
The image appearing on the side of the spinner widget to indicate its "spinnability" |
void |
setUIID(java.lang.String id)
This method sets the Component the Unique identifier. |
void |
setValue(java.lang.Object o)
Set the value of the spinner to a number or a date based on the spinner type |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int DATE_FORMAT_DD_MM_YYYY
public static final int DATE_FORMAT_MM_DD_YYYY
public static final int DATE_FORMAT_DD_MM_YY
public static final int DATE_FORMAT_MM_DD_YY
Method Detail |
---|
public static Spinner createTime(int min, int max, int currentValue, int step, boolean twentyFourHours, boolean showSeconds)
min
- lowest value allowed in seconds since midnightmax
- maximum value allowed in seconds since midnightcurrentValue
- the starting value in seconds since midnightstep
- increments in the spinner (in seconds)twentyFourHours
- show the value as 24 hour values or AM/PMshowSeconds
- show the value of the seconds as well or hide it
public static Spinner createDate(long min, long max, long currentValue, char separatorChar, int format)
min
- lowest value allowedmax
- maximum value allowedcurrentValue
- the starting value for the modeseparatorChar
- character to separate the entries during renderingformat
- formatting type for the field
public static Spinner create(int min, int max, int currentValue, int step)
min
- lowest value allowedmax
- maximum value allowedcurrentValue
- the starting value for the modestep
- the value by which we increment the entries in the model
public static Spinner create(double min, double max, double currentValue, double step)
min
- lowest value allowedmax
- maximum value allowedcurrentValue
- the starting value for the modestep
- the value by which we increment the entries in the model
protected void initComponent()
Component
initComponent
in class Component
protected Dimension calcScrollSize()
Component
calcScrollSize
in class Component
protected Dimension calcPreferredSize()
Component
calcPreferredSize
in class List
public void keyPressed(int code)
Component
keyPressed
in class List
code
- the key code value to indicate a physical key.public void setValue(java.lang.Object o)
o
- a number or a datepublic java.lang.Object getValue()
public void keyReleased(int code)
Component
keyReleased
in class List
code
- the key code value to indicate a physical key.public boolean isRTL()
Component
isRTL
in class Component
public void setRTL(boolean rtl)
Component
setRTL
in class Component
rtl
- true if the component should work in a right to left modepublic void setUIID(java.lang.String id)
Component
setUIID
in class Component
id
- UIID unique identifier for component typepublic void refreshTheme()
Component
refreshTheme
in class List
public void paint(Graphics g)
Component
paint
in interface Animation
paint
in class List
g
- the component graphicspublic boolean animate()
Animation
Display
class.
animate
in interface Animation
animate
in class List
public static Image getSpinnerHandle()
public static void setSpinnerHandle(Image aSpinnerHandle)
aSpinnerHandle
- the spinnerHandle to setpublic static int getInputSkipDelay()
public static void setInputSkipDelay(int aInputSkipDelay)
aInputSkipDelay
- the time for disappearing
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |