public abstract class BasicList extends Menu implements ISimpleList
Inherit from List to create a List that gets its items from a Vector of stored Strings or MenuItems. Note that this will use a lot of memory for very large lists.
Inherit from SimpleList to create a List that does not get its items from a Vector of stored Strings or MenuItems. SimpleList uses specific method calls to get the items which are to be displayed and these methods should be overridden to provide the most efficient method of item storage and retrieval.
Modifier and Type | Field and Description |
---|---|
protected boolean |
amScrolling |
boolean |
multiSelect
This specifies whether the list allows multiple selections or not.
|
static int |
OPTION_CURSOR_EXIT_DOWN |
static int |
OPTION_CURSOR_EXIT_LEFT |
static int |
OPTION_CURSOR_EXIT_RIGHT |
static int |
OPTION_CURSOR_EXIT_UP |
static int |
OPTION_SELECT_FIRST_ON_KEY_FOCUS |
int |
options |
boolean |
penSelectMode
If this is true then pen presses act as if CONTROL is always pressed.
|
autoSelectFirst, border3D, defaultBackground, defaultUseScrollBarSize, dontInheritFont, dontSearchForKeys, exitOnLeft, filter, followPen, keepFrame, myFrame, parentBar, parentMenu, popupController, pressedItem, use3DPopup, useScrollBarSize, wasSelected
blockColor, blockSelected, calculateWidth, clipBuffer, container, dimRect, displayRows, dontAutoScroll, dropButtonWidth, dropDownButton, dummyItem, firstItem, indentDropItems, innerRect, isAList, isSingleLine, itemHeight, items, mouseOverItem, mouseOverItemColor, newClip, noItems, notifyDataChangeOnSelect, notPopupBlockColor, noWrapAround, selectedIndex, shortenItems, spacing, unselectedItem, useMenuItems, xOffset, xShift
backGround, beforeRemoved, borderColor, borderStyle, borderWidth, children, columns, constraints, curFont, debugModify, debugRepaintNow, disabledBackground, dragging, dragResolution, dragTime, exitKeys, fieldTransfer, font, fontChange, fontFrom, foreGround, height, holdDownPause, holdTick, hotKey, image, lastSelected, listeners, lockPaint, maxHeight, maxWidth, menuState, minHeight, minWidth, modifiers, name, next, parent, penStatus, preferredHeight, preferredWidth, prev, prompt, promptControl, rows, ss, startDragResolution, tags, tail, text, toolTip, width, x, y
clipItems, clipObject, clipOwner, debugControl, debugFlag, doubleBuffer, doubleClickTime, doubleSizedFontHeight, firstPress, globalEditable, globalEnabled, PEN_STATUS_DID_HOLD_DOWN, PEN_STATUS_GOT_PEN_DOWN, PEN_STATUS_PEN_IS_ON, pressPoint, TAG_BOOLEAN_KEEP_BELOW_SIP, TAG_HOVER_TIME_INT, TAG_LAST_USER_DATA, TAG_USER_DATA, TAKE_FIRST_PRESS, unnamed
GoHigher, GoLower, Horizontal, OPTION_INDICATOR_ONLY, PageHigher, PageLower, ScrollHigher, ScrollLower, TrackTo, Vertical
BDR_DOTTED, BDR_INNER, BDR_NOBORDER, BDR_OUTER, BDR_OUTLINE, BDR_RAISEDINNER, BDR_RAISEDOUTER, BDR_SUNKENINNER, BDR_SUNKENOUTER, BF_ABUT_ANY, BF_ABUT_BOTTOM, BF_ABUT_LEFT, BF_ABUT_RIGHT, BF_ABUT_TOP, BF_BOTTOM, BF_BOTTOMLEFT, BF_BOTTOMRIGHT, BF_BUTTON, BF_DIAGONAL, BF_DIAGONAL_ENDBOTTOMLEFT, BF_DIAGONAL_ENDBOTTOMRIGHT, BF_DIAGONAL_ENDTOPLEFT, BF_DIAGONAL_ENDTOPRIGHT, BF_EXACT, BF_FLAT, BF_LEFT, BF_MIDDLE, BF_MONO, BF_PALM, BF_RECT, BF_RIGHT, BF_SOFT, BF_SQUARE, BF_TOP, BF_TOPLEFT, BF_TOPRIGHT, EDGE_BUMP, EDGE_ETCHED, EDGE_RAISED, EDGE_SUNKEN
ALWAYS_STRETCHABLE, BOTTOM, CELLFLAG, CELLMASK, CENTER, CONTROLMASK, DONTCHANGE, DONTFILL, DONTSTRETCH, EAST, FILL, GROW, HCENTER, HCONTRACT, HEXPAND, HFILL, HGROW, HSHRINK, HSTRETCH, INITIALLY_CLOSED, INITIALLY_HIDDEN, INITIALLY_MINIMIZED, INITIALLY_PREFERRED_SIZE, INSETS, LEFT, MAXIMUMSIZE, MINIMUMSIZE, NORTH, NORTHEAST, NORTHWEST, PREFERREDSIZE, RECT, RIGHT, SHRINK, SOUTH, SOUTHEAST, SOUTHWEST, SPAN, STRETCH, TAG_BACKGROUND_IMAGE, TAG_BUSY_DISPLAY, TAG_COLORS, TAG_CONTROL_PAINTER, TAG_EXPOSE_GROUP, TAG_FIXEDSIZE, TAG_GRAY_BACKGROUND, TAG_HIDE_CONTROL_OBJECT, TAG_HIDE_PARENT, TAG_INNER_TEXT_INSETS, TAG_INPUT_STACK_PARENT, TAG_INSETS, TAG_MAKE_VISIBLE, TAG_MAXIMUMSIZE, TAG_MINIMUMSIZE, TAG_PAINT_CONTROL_LIST, TAG_PREFERRED_TEXT_SIZE, TAG_PREFERRED_TEXT_SIZE_HEIGHT, TAG_PREFERRED_TEXT_SIZE_WIDTH, TAG_PREFERREDSIZE, TAG_RECT, TAG_SHADOW_INSETS, TAG_SPAN, TAG_SWIPER, TAG_TEMPORARY_ERROR, TAG_TEXT_INSETS, TAG_TEXTSIZE, TEXTSIZE, TOP, VCENTER, VCONTRACT, VEXPAND, VFILL, VGROW, VSHRINK, VSTRETCH, WEST
All, AlwaysEnabled, AlwaysRecalculateSizes, ByDeferredMouse, ByDeferredPen, ByFrameChange, ByKeyboard, ByMouse, ByPen, ByRequest, CalculatedSizes, ContainerDontPaintChildren, Disabled, DisablePopupMenu, DisplayOnly, DontBuffer, Down, DrawFlat, Flag, ForceResize, HasData, Invisible, KeepImage, KeepSIP, Left, MakeMenuAtLeastAsWide, Maximize, Minimize, ModifiersInheritedFromWindow, MouseSensitive, NoFocus, NotAnEditor, NotEditable, PaintDataOnly, PaintOutsideOnly, PenTransparent, PreferredSizeOnly, Right, SendUpUIEvents, ShowSIP, ShrinkToNothing, SmallControl, TakeChildUIEvents, TakeControlEvents, TakesKeyFocus, Transparent, Up, WantDrag, WantHoldDown
KEEP_VISIBLE
Constructor and Description |
---|
BasicList() |
BasicList(int rows,
int columns,
boolean multi) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
allowNotOnMeSelection() |
protected void |
calculateSizes()
Override this to calculate the preferred, minimum and maximum size of your control.
|
int |
countListItems()
Count the number of list items.
|
int |
countSelectedIndexes()
Returns the number of items that are currently selected.
|
void |
dragged(DragContext dc)
This is called during the drag operation.
|
abstract Object[] |
getListItems()
Get all the list items.
|
ScrollablePanel |
getScrollablePanel() |
abstract int |
getSelectedIndex(int selectedIndexIndex)
This returns one of the selected index.
|
abstract int[] |
getSelectedIndexes()
Get a list of all the currently selected items as an array of indexes.
|
void |
gotFocus(int how)
This is called when the Control gets the focus.
|
abstract boolean |
isSelected(int index)
Checks if an item is selected.
|
void |
onKeyEvent(KeyEvent ev) |
void |
penClicked(Point p)
Called if the Pen or Mouse button is quickly pressed and released.
|
void |
penDoubleClicked(Point where)
Called if the Pen or Mouse button is double clicked on the Control.
|
void |
penPressed(Point p)
Called when the Pen or Mouse button is pressed on the control.
|
void |
penReleased(Point p)
Called when the Pen or Mouse button is released on the control.
|
protected void |
pressedNewSelected(int oldSel,
Point where) |
protected void |
releasedOnNothing() |
abstract void |
selectAll(boolean select)
This either selects all the items (select == true) or none of the items (select = false).
|
boolean |
selectAndView(int row)
This selects the item at the specified row (index) exclusively and then ensures that
it is visible.
|
abstract void |
setListItems(Object[] items)
Set the list items.
|
abstract void |
setSelectedIndexes(int[] indexes)
Set which indexes should be selected.
|
canGo, canScreenScroll, close, doActionKey, doDropMenu, doDropMenu, doMenu, doScroll, exec, getActual, getCarrierFrame, getCarrierFrame, getCarrierFrame, getCurrent, getItemRect, getMenuWidth, getTextRect, getVisible, modifyActionItems, modifyActionItems, mouseNowOverItem, needScrollBar, noMenu, onEvent, onPenEvent, postEvent, postEventNormally, prepareForDisplay, pressedNewSelected, resetCachedProperties, selectNewItem, setMouseOverColor, toString, trySubMenu, updateItems, whichItem
addItem, addItems, addItems, addSection, blocked, centerItem, centerSelected, changeItem, changeModifiers, checkOnlyOne, deleteItem, doBorder, doPaint, doPaintData, findItem, findKeyed, getBlockColor, getDataRect, getDisplayRows, getDisplayString, getDropButtonWidth, getInt, getItemAt, getItemHeight, getItemsHaveIcons, getItemToAdd, getMenuHeight, getMenuItemAt, getMenuWidth, getScreenRows, getSelectedItem, getText, indexOf, insertItemAt, itemIsVisible, itemsSize, make, makeItemVisible, makeVisible, modifyItems, notifySelection, paintBox, paintItem, paintItem, refresh, removeAll, repaintItem, select, select, selectItem, selectItem, selectItems, selectNext, selectOrUnselect, selectPrev, setData, setInt, setText, trySelectItem
acceptsData, activate, addListener, amOnTopFrame, applyFontChange, baseOnPenEvent, bufferGraphics, bufferGraphics, bufferGraphics, bufferGraphics, bufferGraphics, cache, calculatedSizes, calculateTextSize, calculateTextSize, calculateTextSize, cancelHoldDown, cancelPenPress, canEdit, change, changeDimension, changeTag, checkClipboardOperations, checkExitKey, checkMenu, checkMenuKey, checkModifiers, checkParentInterceptsUIEvent, checkPenTransparent, childrenPainted, clearTag, clipboardToString, clipboardTransfer, closeMenu, contains, contains, createNewMenu, dataAccepted, dataBeingRemoved, dataDraggedOff, dataDraggedOver, dataDraggedOver, dataDroppedOn, dataTransferCancelled, deactivate, defaultTo, deferInWindowThread, doAction, doBackground, doHotKey, dontAcceptDrop, doPaintChildren, doPaintData, doShowMenu, draw, draw, draw, exitEntry, fillBackground, fillBackgroundNotInFrame, findTagInParents, fontChanged, formClosing, free, fromClipboard, fromField, fromField, getAllDescendants, getAllSubControls, getAncestor, getAncestor, getAncestorProperty, getBackground, getCached, getCachedChildren, getCachedDim, getCachedDim, getCachedRect, getCachedRect, getCachedSubControls, getChildAnchor, getChildren, getChildren, getChildrenBackwards, getClipboardMenu, getClipObject, getContentsInsets, getContentsInsets, getContentsRect, getDataToCopy, getDataToDragAndDrop, getDim, getDisplayText, getDragAndDropContext, getFieldTransfer, getFont, getFontMetrics, getFontMetrics, getFontMetricsForSizeCalculations, getForeground, getFrame, getFrameOrContainer, getGraphics, getGraphics, getHeight, getHideParent, getImage, getLastSelected, getLocation, getLock, getMaximumSize, getMenu, getMinimumSize, getModifiedBorderFlags, getModifiers, getNext, getNextKeyFocus, getPaintParameters, getParent, getParent, getParent, getParentOrListener, getPasswordCharacter, getPosInFrame, getPosInFrame, getPosInParent, getPosInParent, getPreferredSize, getPreferredSizeByParent, getPreferredTextSize, getPrompt, getPromptText, getRect, getRect, getServer, getSize, getSizes, getSubControls, getSubControls, getTag, getToolTip, getWidth, getWindow, getWindowGraphics, hasModifier, hasPopupFormAttached, hasTag, hide, inheritModifiers, insetToContents, interceptChildUIEvent, isChildOf, isDirectChildOfWindow, isHidden, isModal, isOnMe, isOnMe, isOnMe, isSomeonesHotKey, lostFocus, makeFrameTopMost, makeHot, makeHot, makeInvisible, makeVisible, markAsTemporaryError, menuIsActive, menuStateChanged, modify, modifyAll, modifyAll, modifyFlags, mouseHover, newEventThread, notifyAction, notifyDataChange, notifyDataChange, notifyMenuItemSelected, notifyStructureChanged, onControlEvent, onLabelPenEvent, paintBackground, paintWithControlPainter, pauseEventThread, penHeld, penRightReleased, popupBeep, popupMenuClosed, popupMenuEvent, popupMenuEvent, postInWindowThread, postUIEvent, putInside, queueKeyEvent, queuePenEvent, readLock, recalculatePreferredSize, redisplay, releaseBufferedGraphics, removed, removeListener, repaint, repaint, repaintDataNow, repaintInWindowThread, repaintInWindowThread, repaintNow, repaintNow, repaintNow, repaintNow, requestPaint, requestResizeTo, resetAllCachedProperties, resetRect, resizeTo, restore, restoreBorderModifiers, restoreFlags, resumeEventThread, scrollAndRepaint, sendToListeners, set, setAllFonts, setBackgroundImage, setBorder, setBorderModifiers, setCell, setChildAnchor, setClipObject, setControl, setCursor, setFieldTransfer, setFixedSize, setFont, setFontChange, setFreeDragging, setHidden, setHiddenParent, setHotKey, setHotKey, setLocation, setMaximumSize, setMenu, setMinimumSize, setPreferredSize, setPreferredTextSize, setPreferredTextSize, setPromptControl, setRect, setRect, setScaledBackgroundImage, setServer, setShadow, setSwiping, setTag, setTags, setTextSize, setTiledBackgroundImage, setToolTip, showHoldDownIndicator, shown, simulateClickOn, simulateKeyPresses, simulateKeyType, standardOnKeyEvent, startDragAndDrop, startDragAndDrop, startDragging, stopDragging, takeData, takeFocus, takeFromClipboard, takePromptControl, testInWindowThread, ticked, tipIsDisplayed, toClipboard, toField, toField, toIDString, toTextData, transferPenPress, transferPenPress, tryDragAndDrop, tryGetGraphics, tryNext, tryStartMenu, unhide, unlock, updateData, updateDCDuringDD, updateFrom, updateTo, verifyWantDrag, verifyWantHoldDown, waitEventThread, willAcceptDrop, willShowFrame, windowHasFloatingControls, writeLock
doubleSizeIt, getGuiTextHeight, isDoubleSized, isDoubleSizedFont, loadImage, tryLoadImage
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getListItem, itemIsVisible, makeItemVisible, updateItems
select
getServer, setServer
protected boolean amScrolling
public boolean multiSelect
public boolean penSelectMode
public int options
public static final int OPTION_CURSOR_EXIT_UP
public static final int OPTION_CURSOR_EXIT_DOWN
public static final int OPTION_CURSOR_EXIT_LEFT
public static final int OPTION_CURSOR_EXIT_RIGHT
public static final int OPTION_SELECT_FIRST_ON_KEY_FOCUS
public BasicList()
public BasicList(int rows, int columns, boolean multi)
protected boolean allowNotOnMeSelection()
allowNotOnMeSelection
in class Menu
public void dragged(DragContext dc)
Control
protected void releasedOnNothing()
public void penPressed(Point p)
Control
Within this method you can use the Control.Gui.currentPenPress() value to find out more about the PenEvent that caused this - including any modifiers (e.g. SHIFT keys) or determine if the left or right mouse button was pressed.
penPressed
in class Menu
p
- The point on the Control where the pen was pressed.public void penReleased(Point p)
Control
Within this method you can use the Control.Gui.currentPenPress() value to find out more about the PenEvent that caused this - including any modifiers (e.g. SHIFT keys) or determine if the left or right mouse button was pressed.
penReleased
in class Menu
p
- The point on the Control where the pen was released.public void penClicked(Point p)
Control
Within this method you can use the Control.Gui.currentPenPress() value to find out more about the PenEvent that caused this - including any modifiers (e.g. SHIFT keys) or determine if the left or right mouse button was pressed.
By default this method simply calls the penReleased() method.
penClicked
in class Control
p
- The point on the Control where the pen was clicked.public void penDoubleClicked(Point where)
Control
Within this method you can use the Control.Gui.currentPenPress() value to find out more about the PenEvent that caused this - including any modifiers (e.g. SHIFT keys) or determine if the left or right mouse button was pressed.
By default this method simply calls the penClicked() method.
penDoubleClicked
in class Control
where
- The point on the Control where the pen was double-clicked.protected void pressedNewSelected(int oldSel, Point where)
pressedNewSelected
in class Menu
public abstract void selectAll(boolean select)
public abstract void setSelectedIndexes(int[] indexes)
IIndexSelectable
setSelectedIndexes
in interface IIndexSelectable
indexes
- an array of integer indexes to be set as the selection.public abstract int getSelectedIndex(int selectedIndexIndex)
IIndexSelectable
getSelectedIndex
in interface IIndexSelectable
selectedIndexIndex
- which of the selected indexes to return.public abstract int[] getSelectedIndexes()
IIndexSelectable
getSelectedIndexes
in interface IIndexSelectable
public abstract boolean isSelected(int index)
IIndexSelectable
isSelected
in interface IIndexSelectable
isSelected
in class ChoiceControl
index
- the index of the item.public int countSelectedIndexes()
IIndexSelectable
countSelectedIndexes
in interface IIndexSelectable
public boolean selectAndView(int row)
row
- The row to select exclusively.public int countListItems()
ISimpleList
countListItems
in interface ISimpleList
public abstract Object[] getListItems()
ISimpleList
getListItems
in interface ISimpleList
public abstract void setListItems(Object[] items)
ISimpleList
setListItems
in interface ISimpleList
protected void calculateSizes()
Control
calculateSizes
in class ChoiceControl
public ScrollablePanel getScrollablePanel()
public void gotFocus(int how)
Control
public void onKeyEvent(KeyEvent ev)
onKeyEvent
in class Menu