public class SpinList extends Control
SpinList sl = new SpinList(..., !Settings.fingerTouch);This way, in finger-touch devices, it will use the horizontal appearance, which is easier to deal on such devices.
Control.TranslucentShape
Modifier and Type | Field and Description |
---|---|
boolean |
allowsNoneSelected
Allows -1 as selected index (nothing selected).
|
protected java.lang.String[] |
choices |
int |
choicesLen
By default, equals the choices' length.
|
int |
hAlign
The horizontal text alignment of the SpinList: LEFT, CENTER or RIGHT
|
protected int |
selected |
protected TimerEvent |
timer |
int |
timerInitialDelay
Number of ticks of the timer interval that will be waiten until the scroll starts.
|
int |
timerInterval
Timer interval in which the scroll will be done.
|
boolean |
useCalculatorBox
Set to true if there are only numbers in the SpinList and you want to open a NumericBox to let the user
enter a value.
|
boolean |
useNumericBox
Set to true if there are only numbers in the SpinList and you want to open a NumericBox to let the user
enter a value.
|
boolean |
wrapAround
Set to false to disallow the wrap around that happens when the user is at the first or last items.
|
AFTER, alphaValue, appId, appObj, asContainer, asWindow, backColor, BEFORE, BOTTOM, BOTTOM_OF, BRIGHTER_BACKGROUND, callListenersOnAllTargets, CENTER, CENTER_OF, clearValueInt, clearValueStr, DARKER_BACKGROUND, DP, effect, enableUpdateScreen, esce, eventsEnabled, FILL, fillColor, FIT, floating, fm, fmH, focusHandler, focusLess, focusOnPenDown, focusTraversable, font, FONTSIZE, foreColor, height, ignoreInsets, isHighlighting, isTablet, KEEP, keepDisabled, keepEnabled, LEFT, next, nextTabControl, npParts, offscreen, offscreen0, onEventFirst, parent, PARENTSIZE, PARENTSIZEMAX, PARENTSIZEMIN, PREFERRED, prev, RANGE, repositionAllowed, RIGHT, RIGHT_OF, SAME, SCREENSIZE, SCREENSIZEMAX, SCREENSIZEMIN, setFont, setH, setRel, setW, setX, SETX_NOT_SET, setY, tempW, textShadowColor, TOP, translucentShape, transparentBackground, uiAdjustmentsBasedOnFontHeightIsSupported, uiAndroid, UICONST, uiFlat, uiHolo, uiMaterial, uiVista, visible, width, WILL_RESIZE, x, y
Constructor and Description |
---|
SpinList(java.lang.String[] choices)
Constructs a vertical SpinList with the given choices, selecting index 0 by default.
|
SpinList(java.lang.String[] choices,
boolean isVertical)
Constructs a vertical SpinList with the given choices, selecting index 0 by default.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears this control, selecting element clearValueInt.
|
static void |
expand(Vector v,
java.lang.String str)
Expands the items in the format "prefix [start,end] suffix", where prefix and suffix are optional.
|
java.lang.String[] |
getChoices()
Returns the choices array, after the expansion (if any).
|
int |
getPreferredHeight()
Returns the preferred height of this control.
|
int |
getPreferredWidth()
Returns the preferred width of this control.
|
int |
getSelectedIndex()
Returns the selected index.
|
java.lang.String |
getSelectedItem()
Returns the selected item.
|
Control |
handleGeographicalFocusChangeKeys(KeyEvent ke)
Used by the main event loop to give the currently focused control an opportunity to act directly on
the KeyEvent.
|
int |
indexOf(java.lang.String elem)
Returns the index of the given item.
|
void |
insertInOrder(java.lang.String elem)
Inserts the given element in order (based in the assumption that the original choices was ordered).
|
void |
onEvent(Event event)
Called to process key, pen, control and other posted events.
|
void |
onPaint(Graphics g)
Called to draw the control.
|
java.lang.String |
removeAt(int index)
Removes the item at the given index.
|
java.lang.String |
removeCurrent()
Removes the current item
|
void |
replaceChoices(java.lang.String[] choices)
Just replaces the choices array.
|
void |
setChoices(java.lang.String[] choices)
Sets the choices to the given ones.
|
void |
setSelectedIndex(int i)
Sets the selected item; -1 is NOT accepted.
|
void |
setSelectedIndex(int i,
boolean sendPress)
Sets the selected item; -1 is NOT accepted.
|
void |
setSelectedItem(java.lang.String item)
Selects the given item.
|
void |
setSelectedItem(java.lang.String item,
boolean sendPress)
Selects the given item.
|
_onEvent, addEnabledStateListener, addFocusListener, addFontChangeHandler, addGridListener, addHandler, addHighlightListener, addKeyListener, addListContainerListener, addMouseListener, addMultiTouchListener, addPenListener, addPressListener, addPushNotificationListener, addSizeChangeHandler, addTimer, addTimer, addTimerListener, addValueChangeHandler, addWindowListener, bringToFront, changeHighlighted, contains, drawTranslucentBackground, getAbsoluteRect, getBackColor, getDoEffect, getEffectH, getEffectW, getEffectX, getEffectY, getEventListeners, getFont, getForeColor, getGap, getGraphics, getHeight, getNext, getParent, getParentWindow, getPos, getPressedEvent, getPrev, getRect, getSize, getTextShadowColor, getWidth, getX, getX2, getY, getY2, hadParentScrolled, hasFocus, internalSetEnabled, intXYWH, isActionEvent, isChildOf, isDisplayed, isEnabled, isFloating, isInsideOrNear, isObscured, isTopMost, isVisible, isVisibleAndInside, onBoundsChanged, onColorsChanged, onFontChanged, onWindowPaintFinished, post, postEvent, postPressedEvent, releaseScreenShot, removeEnabledStateListener, removeFocusListener, removeGridListener, removeHandler, removeHighlightListener, removeKeyListener, removeListContainerListener, removeMouseListener, removeMultiTouchListener, removePenListener, removePressListener, removePushNotificationListener, removeTimer, removeTimerListener, removeWindowListener, repaint, repaintNow, reposition, reposition, repositionChildren, requestFocus, resetSetPositions, resetStyle, safeRepaintNow, safeUpdateScreen, sendToBack, setBackColor, setBackForeColors, setDoEffect, setEnabled, setFloating, setFocusLess, setFont, setForeColor, setNinePatch, setNinePatch, setRect, setRect, setRect, setRect, setSet, setTextShadowColor, setTranslucent, setVisible, showTip, takeInitialScreenShot, takeScreenShot, translateFromOrigin, uiStyleChanged, updateScreen, updateTemporary, willOpenKeyboard
protected java.lang.String[] choices
protected int selected
protected TimerEvent timer
public int timerInterval
public int timerInitialDelay
public int hAlign
public boolean useNumericBox
public boolean useCalculatorBox
public boolean wrapAround
public int choicesLen
public boolean allowsNoneSelected
public SpinList(java.lang.String[] choices) throws InvalidNumberException
InvalidNumberException
setChoices(java.lang.String[])
public SpinList(java.lang.String[] choices, boolean isVertical) throws InvalidNumberException
InvalidNumberException
setChoices(java.lang.String[])
public int getPreferredWidth()
Control
getPreferredWidth
in class Control
public int getPreferredHeight()
Control
getPreferredHeight
in class Control
public void setChoices(java.lang.String[] choices) throws InvalidNumberException
"Day 1","Day 2",...,"Day 31"
.InvalidNumberException
public void replaceChoices(java.lang.String[] choices) throws InvalidNumberException
InvalidNumberException
public static void expand(Vector v, java.lang.String str) throws InvalidNumberException
"Day 1","Day 2",...,"Day 31"
.InvalidNumberException
public java.lang.String[] getChoices()
public java.lang.String getSelectedItem()
public int getSelectedIndex()
public void setSelectedIndex(int i)
public void setSelectedIndex(int i, boolean sendPress)
public void setSelectedItem(java.lang.String item)
public void setSelectedItem(java.lang.String item, boolean sendPress)
public java.lang.String removeAt(int index)
public java.lang.String removeCurrent()
public int indexOf(java.lang.String elem)
public void insertInOrder(java.lang.String elem)
public void onPaint(Graphics g)
Control
public void onEvent(Event event)
Control
public void clear()
public Control handleGeographicalFocusChangeKeys(KeyEvent ke)
Control
handleGeographicalFocusChangeKeys
in class Control
ke
- The KeyEvent to be processedSettings.geographicalFocus