public static class UIItemList.BasicList extends UI2dContainer implements UIItemList, UIFocus
UI2dContainer.ArrowKeyFocus, UI2dContainer.LayoutUIItemList.BasicList, UIItemList.Impl, UIItemList.Item, UIItemList.Listener, UIItemList.ScrollList, UIItemList.SectionbottomMargin, height, leftMargin, rightMargin, textAlignHorizontal, textAlignVertical, textOffsetX, textOffsetY, topMargin, width, x, ychildren, hasFocus, mousePressContextMenu, visible| Constructor and Description |
|---|
BasicList(UI ui,
float x,
float y,
float w,
float h) |
| Modifier and Type | Method and Description |
|---|---|
UIItemList |
addItem(int index,
UIItemList.Item item)
Adds an item to the list at the given index
|
UIItemList |
addItem(UIItemList.Item item)
Adds an item to the list
|
UIItemList |
addListener(UIItemList.Listener listener)
Adds a listener to receive notifications about list operations
|
UIItemList |
addSection(UIItemList.Section section)
Add a section to the list
|
UIItemList |
clearItems()
Clears all items in the list
|
void |
drawFocus(UI ui,
PGraphics pg)
Draws focus on this object.
|
int |
getFocusedIndex()
Returns the index of the currently focused item in the list
|
UIItemList.Item |
getFocusedItem()
Retrieves the currently focused item in the list.
|
List<? extends UIItemList.Item> |
getItems()
Get the items in the list
|
UIItemList |
moveItem(UIItemList.Item item,
int index)
Moves an item to another location in the list
|
void |
onBlur()
Subclasses override when element loses focus
|
void |
onDraw(UI ui,
PGraphics pg)
Subclasses should override this method to perform their drawing functions.
|
void |
onFocus(Event event)
Subclasses override when element is focused
|
void |
onKeyPressed(KeyEvent keyEvent,
char keyChar,
int keyCode)
Subclasses override to receive key events
|
void |
onKeyReleased(KeyEvent keyEvent,
char keyChar,
int keyCode)
Subclasses override to receive key events
|
void |
onMouseClicked(MouseEvent mouseEvent,
float mx,
float my)
Subclasses override to receive mouse events
|
void |
onMouseDragged(MouseEvent mouseEvent,
float mx,
float my,
float dx,
float dy)
Subclasses override to receive mouse events
|
void |
onMousePressed(MouseEvent mouseEvent,
float mx,
float my)
Subclasses override to receive mouse events
|
void |
onMouseReleased(MouseEvent mouseEvent,
float mx,
float my)
Subclasses override to receive mouse events
|
UIItemList |
removeItem(UIItemList.Item item)
Removes an item from the list
|
UIItemList |
removeListener(UIItemList.Listener listener)
Removes a listener from receiving notifications about list operations
|
UIItemList |
setControlSurfaceFocus(int index,
int length)
Sets a control focus range that is highlighted in the list
|
UIItemList |
setFocusIndex(int focusIndex)
Sets the index of the focused item in the list.
|
UIItemList |
setItems(List<? extends UIItemList.Item> items)
Sets the items in the list and redraws it
|
UIItemList |
setMomentary(boolean momentary)
Sets whether the item list is momentary.
|
UIItemList |
setRenamable(boolean isRenamable)
Sets whether renaming items is allowed
|
UIItemList |
setReorderable(boolean reorderable)
Sets whether the list is reorderable.
|
UIItemList |
setShowCheckboxes(boolean showCheckboxes)
Sets whether a column of checkboxes should be shown on the item list, to the
left of the labels.
|
UIItemList |
setSingleClickActivate(boolean singleClickActivate)
Sets whether single-clicks on an item should activate them.
|
addChildren, addTopLevelComponent, getChild, getChildren, getContentHeight, getContentTarget, getContentWidth, iterator, newHorizontalContainer, newHorizontalContainer, newHorizontalContainer, newVerticalContainer, newVerticalContainer, newVerticalContainer, reflow, removeAllChildren, setArrowKeyFocus, setChildMargin, setChildSpacing, setChildSpacing, setContentHeight, setContentSize, setContentTarget, setContentWidth, setLayout, setMinHeight, setMinWidth, setPadding, setPadding, setPaddingaddToContainer, addToContainer, breakTextToWidth, clipTextToWidth, contains, drawBackground, drawBorder, drawFocusCorners, drawFocusCorners, getBackgroundColor, getBorderColor, getBorderRounding, getBorderWeight, getContainer, getFocusColor, getFocusSize, getFont, getFontColor, getHeight, getNextSibling, getParent, getPrevSibling, getWidth, getX, getY, hasBackground, hasBorder, hasFont, hasFontColor, isMappable, onResize, redraw, removeFromContainer, setBackground, setBackgroundColor, setBorder, setBorderColor, setBorderRounding, setBorderWeight, setBottomMargin, setContainerIndex, setDescription, setFocusBackground, setFocusBackgroundColor, setFocusColor, setFocusCorners, setFont, setFontColor, setFontColor, setHeight, setLeftMargin, setMappable, setMargin, setMargin, setMargin, setPosition, setPosition, setPosition, setPosition, setRightMargin, setSize, setTextAlignment, setTextAlignment, setTextOffset, setTopMargin, setVisible, setWidth, setX, setYaddLoopTask, beginDraw, blur, bringToFront, consumeKeyEvent, consumeMousePress, consumeMouseWheelEvent, endDraw, focus, getDescription, getFocusedChild, getLX, getUI, hasDirectFocus, hasFocus, isVisible, keyEventConsumed, loop, mousePressConsumed, onUIResize, removeLoopTask, toggleVisibleonKeyTyped, onMouseMoved, onMouseOut, onMouseOver, onMouseWheelclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorpublic BasicList(UI ui, float x, float y, float w, float h)
public UIItemList setFocusIndex(int focusIndex)
UIItemListsetFocusIndex in interface UIItemListfocusIndex - Index of item to focuspublic int getFocusedIndex()
UIItemListgetFocusedIndex in interface UIItemListpublic UIItemList.Item getFocusedItem()
UIItemListgetFocusedItem in interface UIItemListpublic UIItemList addSection(UIItemList.Section section)
UIItemListaddSection in interface UIItemListsection - Sectionpublic UIItemList addItem(int index, UIItemList.Item item)
UIItemListaddItem in interface UIItemListindex - Index to add the item atitem - Item to addpublic UIItemList addItem(UIItemList.Item item)
UIItemListaddItem in interface UIItemListitem - Item to addpublic UIItemList moveItem(UIItemList.Item item, int index)
UIItemListmoveItem in interface UIItemListitem - Item to moveindex - Index to move topublic UIItemList removeItem(UIItemList.Item item)
UIItemListremoveItem in interface UIItemListitem - Item to removepublic UIItemList setItems(List<? extends UIItemList.Item> items)
UIItemListsetItems in interface UIItemListitems - Itemspublic UIItemList clearItems()
UIItemListclearItems in interface UIItemListpublic List<? extends UIItemList.Item> getItems()
UIItemListgetItems in interface UIItemListpublic UIItemList setSingleClickActivate(boolean singleClickActivate)
UIItemListsetSingleClickActivate in interface UIItemListsingleClickActivate - Whether to activate on a single clickpublic UIItemList setShowCheckboxes(boolean showCheckboxes)
UIItemListsetShowCheckboxes in interface UIItemListshowCheckboxes - Whether to show checkboxespublic UIItemList setRenamable(boolean isRenamable)
UIItemListsetRenamable in interface UIItemListisRenamable - If items may be renamedpublic UIItemList setMomentary(boolean momentary)
UIItemListsetMomentary in interface UIItemListmomentary - Whether items are momentarypublic UIItemList setReorderable(boolean reorderable)
UIItemListsetReorderable in interface UIItemListreorderable - Whether items are reorderablepublic UIItemList setControlSurfaceFocus(int index, int length)
UIItemListsetControlSurfaceFocus in interface UIItemListindex - Start of the surface focuslength - Length of the surface focus blockpublic UIItemList addListener(UIItemList.Listener listener)
UIItemListaddListener in interface UIItemListlistener - Listenerpublic UIItemList removeListener(UIItemList.Listener listener)
UIItemListremoveListener in interface UIItemListlistener - Listenerpublic void drawFocus(UI ui, PGraphics pg)
UI2dComponentdrawFocus in class UI2dComponentui - UIpg - PGraphicspublic void onDraw(UI ui, PGraphics pg)
UIObjectpublic void onMouseClicked(MouseEvent mouseEvent, float mx, float my)
UIEventHandleronMouseClicked in class UIEventHandlermouseEvent - Mouse eventmx - x-coordinatemy - y-coordinatepublic void onMouseDragged(MouseEvent mouseEvent, float mx, float my, float dx, float dy)
UIEventHandleronMouseDragged in class UIEventHandlermouseEvent - Mouse eventmx - x-coordinatemy - y-coordinatedx - movement in xdy - movement in ypublic void onMousePressed(MouseEvent mouseEvent, float mx, float my)
UIEventHandleronMousePressed in class UIEventHandlermouseEvent - Mouse eventmx - x-coordinatemy - y-coordinatepublic void onMouseReleased(MouseEvent mouseEvent, float mx, float my)
UIEventHandleronMouseReleased in class UIEventHandlermouseEvent - Mouse eventmx - x-coordinatemy - y-coordinatepublic void onBlur()
UIObjectpublic void onKeyPressed(KeyEvent keyEvent, char keyChar, int keyCode)
UIEventHandleronKeyPressed in class UI2dContainerkeyEvent - Key eventkeyChar - Key characterkeyCode - Key code valuepublic void onKeyReleased(KeyEvent keyEvent, char keyChar, int keyCode)
UIEventHandleronKeyReleased in class UIEventHandlerkeyEvent - Key eventkeyChar - Key characterkeyCode - Key code valueLX library by Mark C. Slee. © 2012-2020