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:
UIPerformancePane
-
Nested Class Summary
Nested classes/interfaces inherited from class heronarts.glx.ui.UI2dContainer
UI2dContainer.ArrowKeyFocus, UI2dContainer.Layout, UI2dContainer.Position
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 TypeMethodDescriptionfloat
Gets the total height of scrollable content, which could be larger than the size of the container itself if vertical scrolling is occurring.float
Gets the total width of scrollable content, which could be larger than the size of the container itself if horizontal scrolling is occurring.float
float
boolean
protected void
onMouseDragged
(MouseEvent mouseEvent, float mx, float my, float dx, float dy) Subclasses override to receive mouse eventsprotected void
onMouseScroll
(MouseEvent mouseEvent, float mx, float my, float dx, float dy) Subclasses override to receive mouse eventsprotected void
onResize()
Subclasses may override this method, invoked when the component is resizedprotected void
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, getContentHeight, getContentTarget, getContentWidth, getLeftPadding, getRightPadding, getTopPadding, hasDragToReorder, iterator, newHorizontalContainer, newHorizontalContainer, newHorizontalContainer, newVerticalContainer, newVerticalContainer, newVerticalContainer, onDraw, onKeyPressed, onReflow, reflow, removeAllChildren, removeAllChildren, setArrowKeyFocus, setChildMargin, setChildSpacing, setChildSpacing, setContentHeight, setContentTarget, setContentWidth, setDragToReorder, setLayout, setLayout, setMinHeight, setMinWidth, setPadding, setPadding, setPadding
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, 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, onMouseMoved, onMouseOut, onMouseOver, onMousePressed, onMouseReleased
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
-
UI2dScrollContainer
-
-
Method Details
-
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:
setContentSize
in classUI2dContainer
-
setScrollSize
Sets the size of the scrolled content, which could potentially be larger than the actual size of this element itself- Specified by:
setScrollSize
in 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:
getScrollHeight
in interfaceUI2dScrollInterface
- Overrides:
getScrollHeight
in classUI2dContainer
- Returns:
- Height of scrollable content
-
setScrollHeight
- Specified by:
setScrollHeight
in 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:
getScrollWidth
in interfaceUI2dScrollInterface
- Overrides:
getScrollWidth
in classUI2dContainer
- Returns:
- Width of scrollable content
-
setScrollWidth
- Specified by:
setScrollWidth
in interfaceUI2dScrollInterface
-
setHorizontalScrollingEnabled
-
setVerticalScrollingEnabled
-
hasScroll
public boolean hasScroll() -
onResize
protected void onResize()Description copied from class:UI2dComponent
Subclasses may override this method, invoked when the component is resized- Overrides:
onResize
in classUI2dComponent
-
getScrollX
public float getScrollX()- Specified by:
getScrollX
in interfaceUI2dScrollInterface
-
getScrollY
public float getScrollY()- Specified by:
getScrollY
in interfaceUI2dScrollInterface
-
onScrollChange
protected void onScrollChange() -
setScrollX
- Specified by:
setScrollX
in interfaceUI2dScrollInterface
-
setScrollY
- Specified by:
setScrollY
in interfaceUI2dScrollInterface
-
onMouseDragged
Description copied from class:UIEventHandler
Subclasses override to receive mouse events- Overrides:
onMouseDragged
in classUIEventHandler
- Parameters:
mouseEvent
- Mouse eventmx
- x-coordinatemy
- y-coordinatedx
- movement in xdy
- movement in y
-
onMouseScroll
Description copied from class:UIEventHandler
Subclasses override to receive mouse events- Overrides:
onMouseScroll
in classUIEventHandler
- Parameters:
mouseEvent
- Mouse eventmx
- x-coordinatemy
- y-coordinatedx
- Amount of horizontal scrolldy
- Amount of vertical scroll
-