Package heronarts.glx.ui
Class UI2dContainer
java.lang.Object
heronarts.glx.ui.UIEventHandler
heronarts.glx.ui.UIObject
heronarts.glx.ui.UI2dComponent
heronarts.glx.ui.UI2dContainer
- All Implemented Interfaces:
UIContainer,LXLoopTask,Iterable<UIObject>
- Direct Known Subclasses:
UI2dContext,UI2dScrollContainer,UI2dScrollPane,UIAudio.GraphicMeter,UIAudio.UIOutputControls,UIBottomTray,UIButtonGroup,UIChannelDevice.PlaylistControls,UIClipButton,UIClipEnvelope.UIClipLaneMetadata,UIClipGridStrip,UIClipInspector,UIClipLauncher,UICollapsibleSection,UIColorPicker.UIColorOverlay,UIContentPicker,UIContextMenu,UICredits,UIDevice,UIDeviceBin,UIDeviceBin.UIPatternBin,UIDeviceModulators,UIDialogBox,UIFixture,UIFixture.Section,UIFixturePicker,UIImagePattern.ImageControls,UIItemList.BasicList,UIItemList.ScrollList,UILane,UIMidiTemplates,UIMixer,UIMixerStrip,UIMixerStripControls,UIModelManager,UIModulationMappings,UIModulationMappings.UIModulation,UIModulator,UIModulatorPicker,UIOscManager.UIOutput,UIPalette.SavedSwatch,UIPalette.Swatch,UIPane,UIPatternLauncher,UIPatternLauncher.PatternButton,UIPerformanceContainer,UIPerformancePane.Section,UIPreferences,UIProject.UIScheduler,UISceneLauncher,UISceneStrip,UISolidPattern.UILinkedColorColumn,UIStatusBar,UITimeline,UITimeline.Body.SideBar,UIToolbar,UIToolbarSection,UIVariableLFO.UIPeriodControl,UIWave
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic enumstatic enumNested classes/interfaces inherited from class heronarts.glx.ui.UI2dComponent
UI2dComponent.Scissor, UI2dComponent.Scissored, UI2dComponent.UIDragReorder -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected floatprotected floatprotected floatprotected floatprotected floatprotected floatFields 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddChildren(UI2dComponent... children) protected UI2dContainerfloatgetChild(int i) floatfloatfloatReturns the height of the content containerReturns the object that elements are added to when placed in this container.floatReturns the width of the content containerfloatfloatfloatReturns the height of scrolling content.floatReturns the width of scrolling content.floatbooleanbooleanisEmpty()iterator()static UI2dContainernewHorizontalContainer(float height) static UI2dContainernewHorizontalContainer(float height, float childSpacing) static UI2dContainernewHorizontalContainer(float height, float childSpacing, UI2dComponent... children) static UI2dContainernewVerticalContainer(float width) static UI2dContainernewVerticalContainer(float width, float childSpacing) static UI2dContainernewVerticalContainer(float width, float childSpacing, UI2dComponent... children) protected voidSubclasses should override this method to perform their drawing functions.protected voidonKeyPressed(KeyEvent keyEvent, char keyChar, int keyCode) Subclasses override to receive key eventsprotected voidonReflow()protected final voidreflow()removeAllChildren(boolean dispose) setArrowKeyFocus(UI2dContainer.ArrowKeyFocus keyFocus) setChildMargin(float childMargin) Deprecated.setChildSpacing(float childSpacing) setChildSpacing(float childSpacingY, float childSpacingX) setChildSpacingX(float childSpacingX) setChildSpacingY(float childSpacingY) setContentHeight(float h) setContentSize(float w, float h) protected UI2dContainersetContentTarget(UI2dContainer contentTarget) setContentWidth(float w) setDragToReorder(boolean dragToReorder) setLayout(UI2dContainer.Layout layout) setLayout(UI2dContainer.Layout layout, float childSpacing) setMinHeight(float minHeight) setMinWidth(float minWidth) setPadding(float padding) setPadding(float yPadding, float xPadding) setPadding(float topPadding, float rightPadding, float bottomPadding, float leftPadding) Methods 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, dispose, 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, onMousePressed, 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
-
topPadding
protected float topPadding -
rightPadding
protected float rightPadding -
bottomPadding
protected float bottomPadding -
leftPadding
protected float leftPadding -
childSpacingX
protected float childSpacingX -
childSpacingY
protected float childSpacingY
-
-
Constructor Details
-
UI2dContainer
public UI2dContainer(float x, float y, float w, float h)
-
-
Method Details
-
newHorizontalContainer
-
newHorizontalContainer
-
newHorizontalContainer
public static UI2dContainer newHorizontalContainer(float height, float childSpacing, UI2dComponent... children) -
newVerticalContainer
-
newVerticalContainer
-
newVerticalContainer
public static UI2dContainer newVerticalContainer(float width, float childSpacing, UI2dComponent... children) -
setPadding
-
setPadding
-
setPadding
public UI2dContainer setPadding(float topPadding, float rightPadding, float bottomPadding, float leftPadding) -
getTopPadding
public float getTopPadding() -
getRightPadding
public float getRightPadding() -
getBottomPadding
public float getBottomPadding() -
getLeftPadding
public float getLeftPadding() -
getChildSpacingX
public float getChildSpacingX() -
getChildSpacingY
public float getChildSpacingY() -
setChildMargin
Deprecated.Deprecated. UsesetChildSpacing(float)instead- Parameters:
childMargin- Child margin- Returns:
- this
-
setChildSpacing
-
setChildSpacingX
-
setChildSpacingY
-
setChildSpacing
-
setMinWidth
-
setMinHeight
-
setLayout
-
setLayout
-
setDragToReorder
-
hasDragToReorder
public boolean hasDragToReorder() -
setArrowKeyFocus
-
addChildren
-
reflow
protected final void reflow() -
onReflow
protected void onReflow() -
setContentTarget
-
addTopLevelComponent
-
getContentTarget
Returns 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- Returns:
- Element
-
getScrollWidth
public float getScrollWidth()Returns the width of scrolling content. By default this is the same as the width of the container itself, but if the container scrolls then the scroll width may be a larger value.- Returns:
- Width of scrollable content
-
getScrollHeight
public float getScrollHeight()Returns the height of scrolling content. By default this is the same as the height of the container itself, but if the container scrolls then the scroll height may be a larger value.- Returns:
- Height of scrollable content
-
getContentWidth
public float getContentWidth()Description copied from interface:UIContainerReturns the width of the content container- Specified by:
getContentWidthin interfaceUIContainer- Returns:
- width of content section
-
getContentHeight
public float getContentHeight()Description copied from interface:UIContainerReturns the height of the content container- Specified by:
getContentHeightin interfaceUIContainer- Returns:
- height of the content section
-
setContentWidth
-
setContentHeight
-
setContentSize
-
removeAllChildren
-
removeAllChildren
-
iterator
-
isEmpty
public boolean isEmpty() -
getChildren
-
getChild
-
onKeyPressed
Description copied from class:UIEventHandlerSubclasses override to receive key events- Overrides:
onKeyPressedin classUIEventHandler- Parameters:
keyEvent- Key eventkeyChar- Key characterkeyCode- Key code value
-
onDraw
Description copied from class:UI2dComponentSubclasses should override this method to perform their drawing functions.- Overrides:
onDrawin classUI2dComponent- Parameters:
ui- UI contextvg- Graphics context
-