Package heronarts.glx.ui
Class UI2dScrollContainer
java.lang.Object
heronarts.glx.ui.UIEventHandler
heronarts.glx.ui.UIObject
heronarts.glx.ui.UI2dComponent
heronarts.glx.ui.UI2dContainer
heronarts.glx.ui.UI2dScrollContainer
- All Implemented Interfaces:
UI2dScrollInterface,UIContainer,LXLoopTask,Iterable<UIObject>
- Direct Known Subclasses:
UITimeline.Body,UITimeline.LensScrollContainer
-
Nested Class Summary
Nested 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.UIDragReorderNested classes/interfaces inherited from interface heronarts.glx.ui.UI2dScrollInterface
UI2dScrollInterface.ScrollChange, UI2dScrollInterface.ScrollListener -
Field Summary
Fields 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanfloatfloatfloatGets the total height of scrollable content, which could be larger than the size of the container itself if vertical scrolling is occurring.floatGets the total width of scrollable content, which could be larger than the size of the container itself if horizontal scrolling is occurring.floatfloatbooleanbooleanbooleanprotected voidonMouseDragged(MouseEvent mouseEvent, float mx, float my, float dx, float dy) Subclasses override to receive mouse eventsprotected voidonMouseScroll(MouseEvent mouseEvent, float mx, float my, float dx, float dy) Subclasses override to receive mouse eventsprotected voidonResize()Subclasses may override this method, invoked when the component is resizedprotected voidDeprecated.protected voidonScrollChange(UI2dScrollInterface.ScrollChange scrollChange) setContentSize(float w, float h) setHorizontalScrollingEnabled(boolean horizontalScrollingEnabled) setMaxHeight(float maxHeight) Sets a maximum height on the scroll container.setMaxHeight(float maxHeight, boolean reflow) Sets a maximum height on the scroll container.setMaxWidth(float maxWidth) Sets a maximum width on the scroll container.setMaxWidth(float maxWidth, boolean reflow) Sets a maximum width on the scroll container.setScrollHeight(float scrollHeight) setScrollSize(float scrollWidth, float scrollHeight) Sets the size of the scrolled content, which could potentially be larger than the actual size of this element itselfsetScrollWidth(float scrollWidth) setScrollX(float scrollX) setScrollY(float scrollY) setVerticalScrollingEnabled(boolean verticalScrollingEnabled) Methods inherited from class heronarts.glx.ui.UI2dContainer
addChildren, addTopLevelComponent, getBottomPadding, getChild, getChildren, getChildSpacingX, getChildSpacingY, getContentHeight, getContentTarget, getContentWidth, getLeftPadding, getRightPadding, getTopPadding, hasDragToReorder, isEmpty, iterator, newHorizontalContainer, newHorizontalContainer, newHorizontalContainer, newVerticalContainer, newVerticalContainer, newVerticalContainer, onDraw, onKeyPressed, onReflow, reflow, removeAllChildren, removeAllChildren, setArrowKeyFocus, setChildMargin, setChildSpacing, setChildSpacing, setChildSpacingX, setChildSpacingY, setContentHeight, 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, 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, onMouseMoved, onMouseOut, onMouseOver, onMousePressed, onMouseReleasedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface heronarts.glx.ui.UI2dScrollInterface
getHeight, getWidth, hasScroll, hasScrollX, hasScrollY
-
Constructor Details
-
UI2dScrollContainer
-
-
Method Details
-
addScrollListener
- Specified by:
addScrollListenerin interfaceUI2dScrollInterface
-
removeScrollListener
- Specified by:
removeScrollListenerin interfaceUI2dScrollInterface
-
hasDynamicHeight
public boolean hasDynamicHeight() -
hasDynamicWidth
public boolean hasDynamicWidth() -
getMaxHeight
public float getMaxHeight() -
getMaxWidth
public float getMaxWidth() -
setMaxWidth
Sets a maximum width on the scroll container. Resize or dynamic layout operations up to this size will actually resize the container and texture itself. But past that point, scroll operation occurs.- Parameters:
maxWidth- Maximum width before scrolling kicks in- Returns:
- this
-
setMaxWidth
Sets a maximum width on the scroll container. Resize or dynamic layout operations up to this size will actually resize the container and texture itself. But past that point, scroll operation occurs.- Parameters:
maxWidth- Maximum width before scrolling kicks inreflow- Reflow on this call- Returns:
- this
-
setMaxHeight
Sets a maximum height on the scroll container. Resize or dynamic layout operations up to this size will actually resize the container and texture itself. But past that point, scroll operation occurs.- Parameters:
maxHeight- Maximum height before scrolling kicks in- Returns:
- this
-
setMaxHeight
Sets a maximum height on the scroll container. Resize or dynamic layout operations up to this size will actually resize the container and texture itself. But past that point, scroll operation occurs.- Parameters:
maxHeight- Maximum height before scrolling kicks inreflow- Reflow on this call- Returns:
- this
-
setContentSize
- Overrides:
setContentSizein classUI2dContainer
-
setScrollSize
Sets the size of the scrolled content, which could potentially be larger than the actual size of this element itself- Specified by:
setScrollSizein interfaceUI2dScrollInterface- Parameters:
scrollWidth- Width of scrollable virtual panescrollHeight- Height of scrollable virtual pane- Returns:
-
getScrollHeight
public float getScrollHeight()Gets the total height of scrollable content, which could be larger than the size of the container itself if vertical scrolling is occurring.- Specified by:
getScrollHeightin interfaceUI2dScrollInterface- Overrides:
getScrollHeightin classUI2dContainer- Returns:
- Height of scrollable content
-
setScrollHeight
- Specified by:
setScrollHeightin interfaceUI2dScrollInterface
-
getScrollWidth
public float getScrollWidth()Gets the total width of scrollable content, which could be larger than the size of the container itself if horizontal scrolling is occurring.- Specified by:
getScrollWidthin interfaceUI2dScrollInterface- Overrides:
getScrollWidthin classUI2dContainer- Returns:
- Width of scrollable content
-
setScrollWidth
- Specified by:
setScrollWidthin interfaceUI2dScrollInterface
-
getHorizontalScrollingEnabled
public boolean getHorizontalScrollingEnabled() -
getVerticalScrollingEnabled
public boolean getVerticalScrollingEnabled() -
setHorizontalScrollingEnabled
-
setVerticalScrollingEnabled
-
onResize
protected void onResize()Description copied from class:UI2dComponentSubclasses may override this method, invoked when the component is resized- Overrides:
onResizein classUI2dComponent
-
getScrollX
public float getScrollX()- Specified by:
getScrollXin interfaceUI2dScrollInterface
-
getScrollY
public float getScrollY()- Specified by:
getScrollYin interfaceUI2dScrollInterface
-
onScrollChange
Deprecated. -
onScrollChange
-
setScrollX
- Specified by:
setScrollXin interfaceUI2dScrollInterface
-
setScrollY
- Specified by:
setScrollYin interfaceUI2dScrollInterface
-
onMouseDragged
Description copied from class:UIEventHandlerSubclasses override to receive mouse events- Overrides:
onMouseDraggedin classUIEventHandler- Parameters:
mouseEvent- Mouse eventmx- x-coordinatemy- y-coordinatedx- movement in xdy- movement in y
-
onMouseScroll
Description copied from class:UIEventHandlerSubclasses override to receive mouse events- Overrides:
onMouseScrollin classUIEventHandler- Parameters:
mouseEvent- Mouse eventmx- x-coordinatemy- y-coordinatedx- Amount of horizontal scrolldy- Amount of vertical scroll
-