public class UICollapsibleSection extends UI2dContainer implements UIMouseFocus
UI2dContainer.ArrowKeyFocus, UI2dContainer.Layout
bottomMargin, height, leftMargin, rightMargin, textAlignHorizontal, textAlignVertical, textOffsetX, textOffsetY, topMargin, width, x, y
children, hasFocus, mousePressContextMenu, visible
Constructor and Description |
---|
UICollapsibleSection(UI ui,
float x,
float y,
float w,
float h)
Constructs a new collapsible section
|
Modifier and Type | Method and Description |
---|---|
UI2dContainer |
getContentTarget()
Returns the object that elements are added to when placed in this container.
|
boolean |
isExpanded() |
void |
onDraw(UI ui,
PGraphics pg)
Subclasses should override this method to perform their drawing functions.
|
void |
onKeyPressed(KeyEvent keyEvent,
char keyChar,
int keyCode)
Subclasses override to receive key events
|
void |
onMousePressed(MouseEvent mouseEvent,
float mx,
float my)
Subclasses override to receive mouse events
|
UICollapsibleSection |
setExpanded(boolean expanded)
Sets the expanded state of this section
|
UICollapsibleSection |
setTitle(String title)
Sets the title of the section
|
protected UICollapsibleSection |
setTitleX(float x) |
UICollapsibleSection |
toggle()
Toggles the expansion state of the section
|
addChildren, addTopLevelComponent, getChild, getChildren, getContentHeight, getContentWidth, iterator, newHorizontalContainer, newHorizontalContainer, newHorizontalContainer, newVerticalContainer, newVerticalContainer, newVerticalContainer, reflow, removeAllChildren, setArrowKeyFocus, setChildMargin, setChildSpacing, setChildSpacing, setContentHeight, setContentSize, setContentTarget, setContentWidth, setLayout, setMinHeight, setMinWidth, setPadding, setPadding, setPadding
addToContainer, addToContainer, breakTextToWidth, clipTextToWidth, contains, drawBackground, drawBorder, drawFocus, 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, setY
addLoopTask, beginDraw, blur, bringToFront, consumeKeyEvent, consumeMousePress, consumeMouseWheelEvent, endDraw, focus, getDescription, getFocusedChild, getLX, getUI, hasDirectFocus, hasFocus, isVisible, keyEventConsumed, loop, mousePressConsumed, onBlur, onFocus, onUIResize, removeLoopTask, toggleVisible
onKeyReleased, onKeyTyped, onMouseClicked, onMouseDragged, onMouseMoved, onMouseOut, onMouseOver, onMouseReleased, onMouseWheel
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public UICollapsibleSection(UI ui, float x, float y, float w, float h)
ui
- UIx
- Xposy
- Yposw
- Widthh
- Heightpublic boolean isExpanded()
protected UICollapsibleSection setTitleX(float x)
public UICollapsibleSection setTitle(String title)
title
- Titlepublic void onDraw(UI ui, PGraphics pg)
UIObject
public UICollapsibleSection toggle()
public UICollapsibleSection setExpanded(boolean expanded)
expanded
- Whether section is expandedpublic void onMousePressed(MouseEvent mouseEvent, float mx, float my)
UIEventHandler
onMousePressed
in class UIEventHandler
mouseEvent
- Mouse eventmx
- x-coordinatemy
- y-coordinatepublic void onKeyPressed(KeyEvent keyEvent, char keyChar, int keyCode)
UIEventHandler
onKeyPressed
in class UI2dContainer
keyEvent
- Key eventkeyChar
- Key characterkeyCode
- Key code valuepublic UI2dContainer getContentTarget()
UI2dContainer
getContentTarget
in interface UIContainer
getContentTarget
in class UI2dContainer
LX library by Mark C. Slee. © 2012-2020