public class Spinner extends List
Modifier and Type | Field and Description |
---|---|
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
|
FIXED_CENTER, FIXED_LEAD, FIXED_NONE, FIXED_NONE_CYCLIC, FIXED_NONE_ONE_ELEMENT_MARGIN_FROM_EDGE, FIXED_TRAIL, HORIZONTAL, VERTICAL
BOTTOM, BRB_CENTER_OFFSET, BRB_CONSTANT_ASCENT, BRB_CONSTANT_DESCENT, BRB_OTHER, CENTER, LEFT, RIGHT, TOP
Modifier and Type | Method and Description |
---|---|
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"
|
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.
|
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 |
setValue(Object o)
Set the value of the spinner to a number or a date based on the spinner type
|
addActionListener, addItem, addSelectionListener, fireActionEvent, fireClicked, getBorderGap, getFixedSelection, getItemGap, getMinElementHeight, getModel, getOrientation, getRenderer, getRenderingPrototype, getSelectedIndex, getSelectedItem, getVisibleBounds, isCommandList, isIgnoreFocusComponentWhenUnfocused, isMutableRendererBackgrounds, isNumericKeyActions, isScrollableX, isScrollableY, isSelectableInteraction, isTactileTouch, laidOut, listSelectionChanged, longPointerPress, modelChanged, paramString, pointerDragged, pointerHover, pointerHoverReleased, pointerPressed, pointerReleased, refreshTheme, removeActionListener, removeSelectionListener, scrollRectToVisible, setBorderGap, setCommandList, setFireOnClick, setFixedSelection, setHandlesInput, setIgnoreFocusComponentWhenUnfocused, setInputOnFocus, setItemGap, setListCellRenderer, setMinElementHeight, setModel, setMutableRendererBackgrounds, setNumericKeyActions, setOrientation, setPaintFocusBehindList, setRenderingPrototype, setScrollToSelected, setSelectedIndex, setSelectedIndex, setSelectedItem, setShouldCalcPreferredSize, size
addFocusListener, contains, deinitialize, deinitializeCustomStyle, dragInitiated, focusGained, focusLost, getAbsoluteX, getAbsoluteY, getBaseline, getBaselineResizeBehavior, getBorder, getBottomGap, getBounds, getClientProperty, getComponentForm, getDirtyRegion, getHeight, getLabelForComponent, getNextFocusDown, getNextFocusLeft, getNextFocusRight, getNextFocusUp, getParent, getPreferredH, getPreferredSize, getPreferredW, getScrollAnimationSpeed, getScrollDimension, getScrollX, getScrollY, getSelectCommandText, getSelectedStyle, getSideGap, getStyle, getUIID, getUnselectedStyle, getWidth, getX, getY, handlesInput, hasFocus, initCustomStyle, isBorderPainted, isDragActivated, isEnabled, isFocusable, isFocusPainted, isInitialized, isScrollable, isScrollVisible, isSmoothScrolling, isTactileTouch, isTensileDragEnabled, isVisible, keyRepeated, longKeyPress, paintBackground, paintBackgrounds, paintBorder, paintComponent, paintComponent, paintScrollbars, paintScrollbarX, paintScrollbarY, pointerDragged, pointerPressed, pointerReleased, putClientProperty, refreshTheme, removeFocusListener, repaint, repaint, requestFocus, scrollRectToVisible, scrollRectToVisible, setBorderPainted, setCellRenderer, setDirtyRegion, setEnabled, setFocus, setFocusable, setFocusPainted, setHeight, setInitialized, setIsScrollVisible, setLabelForComponent, setNextFocusDown, setNextFocusLeft, setNextFocusRight, setNextFocusUp, setPreferredH, setPreferredSize, setPreferredW, setScrollAnimationSpeed, setScrollSize, setScrollX, setScrollY, setSelectCommandText, setSelectedStyle, setSize, setSmoothScrolling, setStyle, setTactileTouch, setTensileDragEnabled, setUIID, setUnselectedStyle, setUnSelectedStyle, setVisible, setWidth, setX, setY, styleChanged, toString
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
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 itpublic 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 fieldpublic 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 modelpublic 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 modelprotected 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(Object o)
o
- a number or a datepublic 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
public void setRTL(boolean rtl)
Component
public void paint(Graphics g)
Component
public boolean animate()
Animation
Display
class.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