public class ScrollBox extends Div
UiElementsasyncRemoveAll, children, renderNodedeferredLayout, deferredRender, deferredUpdate, effects, height, styleId, visibility, width, x, y, zIndex| Constructor and Description |
|---|
ScrollBox()
Constructor.
|
ScrollBox(float x,
float y,
float width,
float height)
Constructor
|
ScrollBox(java.lang.String id)
Constructor
|
ScrollBox(java.lang.String id,
float x,
float y,
float width,
float height)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
addScrollListener(ScrollListener listener)
Adds a
ScrollListener to this ScrollBox |
protected ParentRenderNode<?,?> |
createRenderNode(ParentRenderNode<?,?> parent)
Creates the
ParentRenderNode for this UiElement |
float |
getMaxHeight()
Returns the maximum height for this
ScrollBox |
float |
getMinHeight()
Returns the minimum height for this
ScrollBox. |
float |
getScrollContentHeight()
Returns the height of the content within the scroll view
|
float |
getScrollFactor()
Returns how much this
ScrollBox scrolls when the up/down buttons
are clicked (expressed as a % between 0.0 and 1.0) |
Visibility |
getScrollTrackVisibility() |
void |
notifyScrollListeners(float scrollThumbPosition)
Notifies all
ScrollListener instances that a scroll occurred on
this ScrollBox |
void |
removeScrollListener(ScrollListener listener)
Removes a
ScrollListener from this ScrollBox |
void |
resizeScrollContentHeightToContents()
Sets the scroll view height to be equal to the max Y of the child elements
|
void |
scrollTo(UiElement element,
boolean immediate)
Moves the scroll thumb until the
UiElement is visible |
void |
scrollToBottom(boolean immediate)
Scrolls to the last element in the
ScrollBox |
void |
scrollToTop(boolean immediate)
Scrolls to the first element in the
ScrollBox |
void |
setMaxHeight(float maxHeight)
Sets the maximum height for this
ScrollBox |
void |
setMinHeight(float minHeight)
Sets the minimum height for this
ScrollBox. |
void |
setScrollContentHeight(float scrollContentHeight)
Sets the scroll view height.
|
void |
setScrollFactor(float scrollFactor)
Sets how much this
ScrollBox scrolls when the up/down buttons are
clicked |
void |
setScrollTrackVisibility(Visibility scrollTrackVisibility) |
void |
syncWithUpdate(UiContainerRenderTree rootNode)
Syncs data between the
UiElement and RenderNode during update |
getStyleRule, withElements, withElementsadd, add, attach, detach, get, getChild, getElementById, getFlexLayout, getRenderHeight, getRenderWidth, getRenderX, getRenderY, getTotalChildren, invokeBeginHover, invokeEndHover, isFlexLayout, isInitialLayoutOccurred, isInitialUpdateOccurred, isOverflowClipped, isRenderNodeDirty, remove, remove, removeAll, removeAllAsync, setFlex, setFlexLayout, setHeightFlex, setOverflowClipped, setRenderNodeDirty, setStyleId, setVisibility, setWidthFlex, setXFlex, setXYFlex, setYFlex, setZIndex, shrinkToContents, shrinkToContentsaddEffectListener, addHoverListener, addNodeStateListener, alignAbove, alignBelow, alignEdgeToEdge, alignLeftOf, alignRightOf, applyEffect, deferUntilLayout, deferUntilLayout, deferUntilRender, deferUntilRender, deferUntilUpdate, deferUntilUpdate, deferUntilUpdate, deferUntilUpdate, equals, getContentHeight, getContentWidth, getHeight, getId, getMarginBottom, getMarginLeft, getMarginRight, getMarginTop, getPaddingBottom, getPaddingLeft, getPaddingRight, getPaddingTop, getStyleId, getVisibility, getWidth, getX, getY, getZIndex, hashCode, isDebugEnabled, isInitialised, notifyEffectListenersOnFinished, notifyHoverListenersOnBeginHover, notifyHoverListenersOnEndHover, notifyNodeStateListeners, removeEffectListener, removeHoverListener, removeNodeStateListener, set, setContentHeight, setContentWidth, setDebugEnabled, setHeight, setHeightToContentHeightOf, setHeightToHeightOf, setWidth, setWidthToContentWidthOf, setWidthToWidthOf, setX, setXY, setY, snapTo, snapTo, syncWithLayout, syncWithRenderpublic ScrollBox()
ScrollBoxpublic ScrollBox(java.lang.String id)
id - The unique ID for this ScrollBoxpublic ScrollBox(float x,
float y,
float width,
float height)
x - The x coordinate of this element relative to its parenty - The y coordinate of this element relative to its parentwidth - The width of this elementheight - The height of this elementpublic ScrollBox(java.lang.String id,
float x,
float y,
float width,
float height)
id - The unique ID for this element (if null an ID will be generated)x - The x coordinate of this element relative to its parenty - The y coordinate of this element relative to its parentwidth - The width of this elementheight - The height of this elementprotected ParentRenderNode<?,?> createRenderNode(ParentRenderNode<?,?> parent)
ParentUiElementParentRenderNode for this UiElementcreateRenderNode in class Divparent - The parent of this nodeParentRenderNodepublic void syncWithUpdate(UiContainerRenderTree rootNode)
UiElementUiElement and RenderNode during updatesyncWithUpdate in class ParentUiElementpublic void scrollTo(UiElement element, boolean immediate)
UiElement is visiblepublic void scrollToTop(boolean immediate)
ScrollBoximmediate - True if the ScrollBox should "jump" to the element.
False if the scrolling should be smooth.public void scrollToBottom(boolean immediate)
ScrollBoximmediate - True if the ScrollBox should "jump" to the element.
False if the scrolling should be smooth.public float getMinHeight()
ScrollBox. When set to
Float.MIN_VALUE the value will be taken from the style.Float.MIN_VALUE by defaultpublic void setMinHeight(float minHeight)
ScrollBox. Setting this value
overrides the style's minHeight value.minHeight - The minimum height to setpublic float getMaxHeight()
ScrollBoxFloat.MAX_VALUE by defaultpublic void setMaxHeight(float maxHeight)
ScrollBoxmaxHeight - The maximum height to setpublic float getScrollFactor()
ScrollBox scrolls when the up/down buttons
are clicked (expressed as a % between 0.0 and 1.0)DEFAULT_SCROLL_FACTOR by defaultpublic void setScrollFactor(float scrollFactor)
ScrollBox scrolls when the up/down buttons are
clickedscrollFactor - A % between 0.0 and 1.0public void addScrollListener(ScrollListener listener)
ScrollListener to this ScrollBoxlistener - The ScrollListener to addpublic void removeScrollListener(ScrollListener listener)
ScrollListener from this ScrollBoxlistener - The ScrollListener to removepublic void notifyScrollListeners(float scrollThumbPosition)
ScrollListener instances that a scroll occurred on
this ScrollBoxscrollThumbPosition - The position of the scroll thumb (between 0.0 and 1.0)public float getScrollContentHeight()
public void setScrollContentHeight(float scrollContentHeight)
scrollContentHeight - public Visibility getScrollTrackVisibility()
public void setScrollTrackVisibility(Visibility scrollTrackVisibility)
public void resizeScrollContentHeightToContents()