public static class UIItemList.ScrollList extends UI2dScrollContext implements UIItemList, UIFocus
UI2dContainer.ArrowKeyFocus, UI2dContainer.Layout
UIItemList.BasicList, UIItemList.Impl, UIItemList.Item, UIItemList.Listener, UIItemList.ScrollList, UIItemList.Section
bottomMargin, height, leftMargin, rightMargin, textAlignHorizontal, textAlignVertical, textOffsetX, textOffsetY, topMargin, width, x, y
children, hasFocus, mousePressContextMenu, visible
Constructor and Description |
---|
ScrollList(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.
|
getScrollHeight, getScrollWidth, getScrollX, getScrollY, onMouseWheel, onResize, setContentSize, setHorizontalScrollingEnabled, setMaxHeight, setScrollHeight, setScrollSize, setScrollWidth, setScrollX, setScrollY, setVerticalScrollingEnabled
drawBackground, getGraphics
addChildren, addTopLevelComponent, getChild, getChildren, getContentHeight, getContentTarget, getContentWidth, iterator, newHorizontalContainer, newHorizontalContainer, newHorizontalContainer, newVerticalContainer, newVerticalContainer, newVerticalContainer, reflow, removeAllChildren, setArrowKeyFocus, setChildMargin, setChildSpacing, setChildSpacing, setContentHeight, setContentTarget, setContentWidth, setLayout, setMinHeight, setMinWidth, setPadding, setPadding, setPadding
addToContainer, addToContainer, breakTextToWidth, clipTextToWidth, contains, drawBorder, drawFocusCorners, drawFocusCorners, getBackgroundColor, getBorderColor, getBorderRounding, getBorderWeight, getContainer, getFocusColor, getFocusSize, getFont, getFontColor, getHeight, getNextSibling, getParent, getPrevSibling, getWidth, getX, getY, hasBackground, hasBorder, hasFont, hasFontColor, isMappable, 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, setY
addLoopTask, beginDraw, blur, bringToFront, consumeKeyEvent, consumeMousePress, consumeMouseWheelEvent, endDraw, focus, getDescription, getFocusedChild, getLX, getUI, hasDirectFocus, hasFocus, isVisible, keyEventConsumed, loop, mousePressConsumed, onUIResize, removeLoopTask, toggleVisible
onKeyTyped, onMouseMoved, onMouseOut, onMouseOver
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public ScrollList(UI ui, float x, float y, float w, float h)
public UIItemList setFocusIndex(int focusIndex)
UIItemList
setFocusIndex
in interface UIItemList
focusIndex
- Index of item to focuspublic int getFocusedIndex()
UIItemList
getFocusedIndex
in interface UIItemList
public UIItemList.Item getFocusedItem()
UIItemList
getFocusedItem
in interface UIItemList
public UIItemList addSection(UIItemList.Section section)
UIItemList
addSection
in interface UIItemList
section
- Sectionpublic UIItemList addItem(int index, UIItemList.Item item)
UIItemList
addItem
in interface UIItemList
index
- Index to add the item atitem
- Item to addpublic UIItemList addItem(UIItemList.Item item)
UIItemList
addItem
in interface UIItemList
item
- Item to addpublic UIItemList moveItem(UIItemList.Item item, int index)
UIItemList
moveItem
in interface UIItemList
item
- Item to moveindex
- Index to move topublic UIItemList removeItem(UIItemList.Item item)
UIItemList
removeItem
in interface UIItemList
item
- Item to removepublic UIItemList setItems(List<? extends UIItemList.Item> items)
UIItemList
setItems
in interface UIItemList
items
- Itemspublic UIItemList clearItems()
UIItemList
clearItems
in interface UIItemList
public List<? extends UIItemList.Item> getItems()
UIItemList
getItems
in interface UIItemList
public UIItemList setSingleClickActivate(boolean singleClickActivate)
UIItemList
setSingleClickActivate
in interface UIItemList
singleClickActivate
- Whether to activate on a single clickpublic UIItemList setShowCheckboxes(boolean showCheckboxes)
UIItemList
setShowCheckboxes
in interface UIItemList
showCheckboxes
- Whether to show checkboxespublic UIItemList setRenamable(boolean isRenamable)
UIItemList
setRenamable
in interface UIItemList
isRenamable
- If items may be renamedpublic UIItemList setMomentary(boolean momentary)
UIItemList
setMomentary
in interface UIItemList
momentary
- Whether items are momentarypublic UIItemList setReorderable(boolean reorderable)
UIItemList
setReorderable
in interface UIItemList
reorderable
- Whether items are reorderablepublic UIItemList setControlSurfaceFocus(int index, int length)
UIItemList
setControlSurfaceFocus
in interface UIItemList
index
- Start of the surface focuslength
- Length of the surface focus blockpublic UIItemList addListener(UIItemList.Listener listener)
UIItemList
addListener
in interface UIItemList
listener
- Listenerpublic UIItemList removeListener(UIItemList.Listener listener)
UIItemList
removeListener
in interface UIItemList
listener
- Listenerpublic void drawFocus(UI ui, PGraphics pg)
UI2dComponent
drawFocus
in class UI2dComponent
ui
- UIpg
- PGraphicspublic void onDraw(UI ui, PGraphics pg)
UIObject
public void onMouseClicked(MouseEvent mouseEvent, float mx, float my)
UIEventHandler
onMouseClicked
in class UIEventHandler
mouseEvent
- Mouse eventmx
- x-coordinatemy
- y-coordinatepublic void onMouseDragged(MouseEvent mouseEvent, float mx, float my, float dx, float dy)
UIEventHandler
onMouseDragged
in class UIEventHandler
mouseEvent
- Mouse eventmx
- x-coordinatemy
- y-coordinatedx
- movement in xdy
- movement in ypublic void onMousePressed(MouseEvent mouseEvent, float mx, float my)
UIEventHandler
onMousePressed
in class UIEventHandler
mouseEvent
- Mouse eventmx
- x-coordinatemy
- y-coordinatepublic void onMouseReleased(MouseEvent mouseEvent, float mx, float my)
UIEventHandler
onMouseReleased
in class UIEventHandler
mouseEvent
- Mouse eventmx
- x-coordinatemy
- y-coordinatepublic void onBlur()
UIObject
public void onKeyPressed(KeyEvent keyEvent, char keyChar, int keyCode)
UIEventHandler
onKeyPressed
in class UI2dContainer
keyEvent
- Key eventkeyChar
- Key characterkeyCode
- Key code valuepublic void onKeyReleased(KeyEvent keyEvent, char keyChar, int keyCode)
UIEventHandler
onKeyReleased
in class UIEventHandler
keyEvent
- Key eventkeyChar
- Key characterkeyCode
- Key code valueLX library by Mark C. Slee. © 2012-2020