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
,UIAbstractGlobalModulator.UIModulation
,UIAudio.GraphicMeter
,UIAudio.UIOutputControls
,UIBottomTray
,UIButtonGroup
,UIChannelDevice.PlaylistControls
,UIClipButton
,UIClipGridStrip
,UIClipLauncher
,UIClipView
,UICollapsibleSection
,UIColorPicker.UIColorOverlay
,UIContentPicker
,UIContextMenu
,UIContextualHelpBar
,UICredits
,UIDevice
,UIDeviceBin
,UIDeviceBin.UIPatternBin
,UIDeviceModulators
,UIDialogBox
,UIFixture
,UIFixture.Section
,UIFixturePicker
,UIImagePattern.ImageControls
,UIItemList.BasicList
,UIItemList.ScrollList
,UIMixer
,UIMixerStrip
,UIMixerStripControls
,UIModelManager
,UIModulator
,UIModulatorPicker
,UIPalette.SavedSwatch
,UIPalette.Swatch
,UIPane
,UIPerformancePane.Section
,UIPerformanceTool
,UIPerformanceTool.Content
,UIPreferences
,UIProject.UIScheduler
,UISceneLauncher
,UISceneStrip
,UIToolbar
,UIToolbarSection
,UIVariableLFO.UIPeriodControl
,UIWave
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
static enum
static enum
Nested classes/interfaces inherited from class heronarts.glx.ui.UI2dComponent
UI2dComponent.Scissor, UI2dComponent.Scissored, UI2dComponent.UIDragReorder
-
Field Summary
Fields inherited from class heronarts.glx.ui.UI2dComponent
debug, debugName, height, marginBottom, marginLeft, marginRight, marginTop, redraw, scissor, textAlignHorizontal, textAlignVertical, textOffsetX, textOffsetY, width, x, y
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddChildren
(UI2dComponent... children) protected UI2dContainer
float
getChild
(int i) float
Returns the height of the content containerReturns the object that elements are added to when placed in this container.float
Returns the width of the content containerfloat
float
float
Returns the height of scrolling content.float
Returns the width of scrolling content.float
boolean
iterator()
static UI2dContainer
newHorizontalContainer
(float height) static UI2dContainer
newHorizontalContainer
(float height, float childSpacing) static UI2dContainer
newHorizontalContainer
(float height, float childSpacing, UI2dComponent... children) static UI2dContainer
newVerticalContainer
(float width) static UI2dContainer
newVerticalContainer
(float width, float childSpacing) static UI2dContainer
newVerticalContainer
(float width, float childSpacing, UI2dComponent... children) protected void
Subclasses should override this method to perform their drawing functions.protected void
onKeyPressed
(KeyEvent keyEvent, char keyChar, int keyCode) Subclasses override to receive key eventsprotected void
onReflow()
protected final void
reflow()
removeAllChildren
(boolean dispose) setArrowKeyFocus
(UI2dContainer.ArrowKeyFocus keyFocus) setChildMargin
(float childMargin) Deprecated.setChildSpacing
(float childSpacing) setChildSpacing
(float childSpacingY, float childSpacingX) setContentHeight
(float h) setContentSize
(float w, float h) protected UI2dContainer
setContentTarget
(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
addToContainer, addToContainer, addToContainer, addToContainer, addToContainer, addToContainer, addToContainer, addToContainer, assertValidContainer, clipTextToWidth, clipTextToWidth, contains, dbch, drawBackground, drawBorder, drawFocus, drawFocusCorners, drawFocusCorners, drawParentBackground, getAbsoluteX, getAbsoluteY, getBackgroundColor, getBorderColor, getBorderWeight, getContainer, getDebugClassHierarchy, getDebugClassHierarchy, getFocusColor, getFocusSize, getFont, getFontColor, getHeight, getMappableParameter, getNextSibling, getParent, getPrevSibling, 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, vgRoundedRect
Methods inherited from class heronarts.glx.ui.UIObject
addListener, addListener, addLoopTask, blur, bringToFront, dispose, focus, getDescription, getFocusedChild, getLX, getUI, hasDirectFocus, hasFocus, isVisible, loop, onBlur, onFocus, onUIResize, removeLoopTask, requireUIThread, setConsumeMousePress, setDebugId, toggleVisible, toString
Methods inherited from class heronarts.glx.ui.UIEventHandler
onKeyReleased, onMouseDragged, onMouseMoved, onMouseOut, onMouseOver, onMousePressed, onMouseReleased, onMouseScroll
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
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() -
setChildMargin
Deprecated.Deprecated. UsesetChildSpacing(float)
instead- Parameters:
childMargin
- Child margin- Returns:
- this
-
setChildSpacing
-
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:
getContentTarget
in 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:UIContainer
Returns the width of the content container- Specified by:
getContentWidth
in interfaceUIContainer
- Returns:
- width of content section
-
getContentHeight
public float getContentHeight()Description copied from interface:UIContainer
Returns the height of the content container- Specified by:
getContentHeight
in interfaceUIContainer
- Returns:
- height of the content section
-
setContentWidth
-
setContentHeight
-
setContentSize
-
removeAllChildren
-
removeAllChildren
-
iterator
-
getChildren
-
getChild
-
onKeyPressed
Description copied from class:UIEventHandler
Subclasses override to receive key events- Overrides:
onKeyPressed
in classUIEventHandler
- Parameters:
keyEvent
- Key eventkeyChar
- Key characterkeyCode
- Key code value
-
onDraw
Description copied from class:UI2dComponent
Subclasses should override this method to perform their drawing functions.- Overrides:
onDraw
in classUI2dComponent
- Parameters:
ui
- UI contextvg
- Graphics context
-