Package heronarts.glx.ui.component
Class UICollapsibleSection
java.lang.Object
heronarts.glx.ui.UIEventHandler
heronarts.glx.ui.UIObject
heronarts.glx.ui.UI2dComponent
heronarts.glx.ui.UI2dContainer
heronarts.glx.ui.component.UICollapsibleSection
- All Implemented Interfaces:
UIContainer,UIMouseFocus,LXLoopTask,Iterable<UIObject>
- Direct Known Subclasses:
UIAudio,UICamera,UIComponentManager,UIDmxManager,UIEnvelop,UIFixtureErrors,UIFixtureInspector,UIFixtureManager,UIMidiInputs,UIMidiMappings,UIMidiSurfaces,UIMidiTemplate,UIMidiTemplates.Picker,UIModelInspector,UIOscManager,UIOutputManager,UIPackageManager,UIPalette,UIPerformanceAudio,UIPerformancePalette,UIPluginManager,UIReaper,UISnapshots,UISoundStageManager,UIViews
Section with a title which can collapse/expand
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class heronarts.glx.ui.UI2dContainer
UI2dContainer.ArrowKeyFocus, UI2dContainer.Layout, UI2dContainer.PositionNested classes/interfaces inherited from class heronarts.glx.ui.UI2dComponent
UI2dComponent.Scissor, UI2dComponent.Scissored, UI2dComponent.UIDragReorder -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intprotected static final intprotected static final intFields inherited from class heronarts.glx.ui.UI2dContainer
bottomPadding, childSpacingX, childSpacingY, leftPadding, rightPadding, topPaddingFields inherited from class heronarts.glx.ui.UI2dComponent
borderRoundingBottomLeft, borderRoundingBottomRight, borderRoundingTopLeft, borderRoundingTopRight, debug, debugName, hasBorderRounding, height, marginBottom, marginLeft, marginRight, marginTop, redraw, scissor, textAlignHorizontal, textAlignVertical, textOffsetX, textOffsetY, width, x, y -
Constructor Summary
ConstructorsConstructorDescriptionUICollapsibleSection(UI ui, float w, float h) UICollapsibleSection(UI ui, float x, float y, float w, float h) Constructs a new collapsible sectionUICollapsibleSection(UI ui, float w, float h, BooleanParameter expandedParameter) -
Method Summary
Modifier and TypeMethodDescriptionprotected UI2dContainercontrolRow(UI ui, String label, UI2dComponent control) voiddispose()static voiddrawHorizontalExpansionTriangle(UI ui, VGraphics vg, boolean expanded) Returns the object that elements are added to when placed in this container.booleanWhether the section is presently expandedvoidSubclasses should override this method to perform their drawing functions.voidonKeyPressed(KeyEvent keyEvent, char keyChar, int keyCode) Subclasses override to receive key eventsvoidonMousePressed(MouseEvent mouseEvent, float mx, float my) Subclasses override to receive mouse eventssetExpanded(boolean expanded) Sets the expanded state of this sectionsetExpandedParameter(BooleanParameter expandedParameter) Set the section to follow and update a parameter for its expansion stateprotected voidsetFooter(UI2dComponent footer) protected voidsetFooterVisible(boolean footerVisible) Sets the title of the sectionprotected UICollapsibleSectionsetTitleX(float x) toggle()Toggles the expansion state of the sectionprotected voidMethods inherited from class heronarts.glx.ui.UI2dContainer
addChildren, addTopLevelComponent, getBottomPadding, getChild, getChildren, getChildSpacingX, getChildSpacingY, getContentHeight, getContentWidth, getLeftPadding, getRightPadding, getScrollHeight, getScrollWidth, getTopPadding, hasDragToReorder, isEmpty, iterator, newHorizontalContainer, newHorizontalContainer, newHorizontalContainer, newVerticalContainer, newVerticalContainer, newVerticalContainer, onReflow, reflow, removeAllChildren, removeAllChildren, setArrowKeyFocus, setChildMargin, setChildSpacing, setChildSpacing, setChildSpacingX, setChildSpacingY, setContentHeight, setContentSize, setContentTarget, setContentWidth, setDragToReorder, setLayout, setLayout, setMinHeight, setMinWidth, setPadding, setPadding, setPaddingMethods inherited from class heronarts.glx.ui.UI2dComponent
addAfterSibling, addBeforeSibling, addToContainer, addToContainer, addToContainer, addToContainer, addToContainer, addToContainer, addToContainer, addToContainer, assertValidContainer, clipTextToWidth, clipTextToWidth, contains, dbch, drawBackground, drawBorder, drawComponentBackground, drawFocus, drawFocusCorners, drawFocusCorners, drawParentBackground, getAbsoluteX, getAbsoluteY, getBackgroundColor, getBorderColor, getBorderWeight, getBottomMargin, getContainer, getDebugClassHierarchy, getDebugClassHierarchy, getFocusColor, getFocusSize, getFont, getFontColor, getHeight, getLeftMargin, getMappableParameter, getNextSibling, getNextSibling, getParent, getPrevSibling, getPrevSibling, getRightMargin, getTopMargin, getWidth, getX, getY, hasBackground, hasBorder, hasFont, hasFontColor, isMappable, onResize, redraw, removeFromContainer, removeFromContainer, setBackground, setBackgroundColor, setBackgroundColor, setBorder, setBorderColor, setBorderColor, setBorderRounding, setBorderRounding, setBorderWeight, setBottomMargin, setContainerIndex, setContainerPosition, setDebug, setDebug, setDescription, setFocusBackground, setFocusBackgroundColor, setFocusBackgroundColor, setFocusColor, setFocusColor, setFocusCorners, setFont, setFontColor, setFontColor, setFontColor, setHeight, setLeftMargin, setMappable, setMargin, setMargin, setMargin, setPosition, setPosition, setPosition, setPosition, setRightMargin, setSize, setTextAlignment, setTextAlignment, setTextOffset, setTopMargin, setVisible, setWidth, setX, setY, vgRoundedRect, vgRoundedRect, vgRoundedRectMethods inherited from class heronarts.glx.ui.UIObject
addListener, addListener, addLoopTask, addLoopTask, blur, bringToFront, focus, getDescription, getFocusedChild, getLX, getUI, hasDirectFocus, hasFocus, isVisible, isVisible, loop, onBlur, onFocus, onUIResize, removeLoopTask, requireUIThread, setConsumeMousePress, setDebugId, setMouseCursor, toggleVisible, toStringMethods inherited from class heronarts.glx.ui.UIEventHandler
onGamepadAxisChanged, onGamepadButtonPressed, onGamepadButtonReleased, onKeyReleased, onMouseDragged, onMouseMoved, onMouseOut, onMouseOver, onMouseReleased, onMouseScrollMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
PADDING
protected static final int PADDING- See Also:
-
TITLE_X
protected static final int TITLE_X- See Also:
-
BAR_HEIGHT
public static final int BAR_HEIGHT- See Also:
-
-
Constructor Details
-
UICollapsibleSection
-
UICollapsibleSection
-
UICollapsibleSection
Constructs a new collapsible section- Parameters:
ui- UIx- Xposy- Yposw- Widthh- Height
-
-
Method Details
-
setAlwaysOpen
-
isExpanded
public boolean isExpanded()Whether the section is presently expanded- Returns:
- Whether section is expanded
-
setExpandedParameter
Set the section to follow and update a parameter for its expansion state- Parameters:
expandedParameter- Parameter to follow and update for expansion changes- Returns:
- this
-
setTitleX
-
setTitle
Sets the title of the section- Parameters:
title- Title- Returns:
- this
-
drawHorizontalExpansionTriangle
-
onDraw
Description copied from class:UI2dComponentSubclasses should override this method to perform their drawing functions.- Overrides:
onDrawin classUI2dContainer- Parameters:
ui- UI contextvg- Graphics context
-
toggle
Toggles the expansion state of the section- Returns:
- this
-
setExpanded
Sets the expanded state of this section- Parameters:
expanded- Whether section is expanded- Returns:
- this
-
updateHeight
protected void updateHeight() -
onMousePressed
Description copied from class:UIEventHandlerSubclasses override to receive mouse events- Overrides:
onMousePressedin classUIEventHandler- Parameters:
mouseEvent- Mouse eventmx- x-coordinatemy- y-coordinate
-
onKeyPressed
Description copied from class:UIEventHandlerSubclasses override to receive key events- Overrides:
onKeyPressedin classUI2dContainer- Parameters:
keyEvent- Key eventkeyChar- Key characterkeyCode- Key code value
-
getContentTarget
Description copied from class:UI2dContainerReturns the object that elements are added to when placed in this container. In most cases, it will be "this" - but some elements have special subcontainers.- Specified by:
getContentTargetin interfaceUIContainer- Overrides:
getContentTargetin classUI2dContainer- Returns:
- Element
-
controlRow
-
dispose
public void dispose()
-