Class ScrollContainerComponent
java.lang.Object
com.render.api.gui.GuiComponent<ContainerComponent>
com.render.api.gui.ContainerComponent
com.render.api.gui.ScrollContainerComponent
Retained two-axis scrolling container with independent overflow, overscroll,
scrollbar, and snap policies.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionanimatedBorder(GuiAnimatedBorder animatedBorder) Sets the animated border effect.animation(String name, GuiKeyframes keyframes) autoSize()backgroundColor(int argb) Deprecated.backgroundColor(RenderColor color) Sets the background color in ARGB format.borderColor(int argb) Deprecated.borderColor(RenderColor color) Sets the border color in ARGB format.borderWidth(float borderWidth) Sets the border width in design-space pixels.protected com.render.api.gui.GuiBoxReturns the box used to arrange descendants.protected floatprotected floatprotected booleanprotected booleancontainsChildClipPoint(float mouseX, float mouseY) cornerRadius(float cornerRadius) Sets the border corner radius in design-space pixels.disabled(Consumer<ContainerComponent> consumer) focused(Consumer<ContainerComponent> consumer) gap(float gap) Sets the spacing between flowed children in design-space pixels.Sets the component glow effect.gradient(GuiGradient gradient) Sets the background gradient.protected booleanhandlesMouseClick(float mouseX, float mouseY, int button) protected booleanhandlesMouseScroll(float mouseX, float mouseY) Sets a typed modern height.horizontalScrollIndicator(GuiScrollIndicator scrollIndicator) horizontalScrollStep(float scrollStep) hovered(Consumer<ContainerComponent> consumer) protected booleanlayout(ContainerLayout childLayout) Sets the layout mode used for child placement.protected voidlayoutChildren(com.render.api.gui.GuiRenderContext context) floatReturns the maximum vertical scroll offset in design-space pixels.floatprotected booleanonKeyPressed(com.render.api.gui.GuiRenderContext context, int keyCode, int scanCode, int modifiers) protected voidInvoked after this component's descendants have been arranged by the modern layout engine.protected booleanonMouseClicked(com.render.api.gui.GuiRenderContext context, float mouseX, float mouseY, int button) protected booleanonMouseDragged(com.render.api.gui.GuiRenderContext context, float mouseX, float mouseY, int button, double dragX, double dragY) protected booleanonMouseReleased(com.render.api.gui.GuiRenderContext context, float mouseX, float mouseY, int button) protected booleanonMouseScrolled(com.render.api.gui.GuiRenderContext context, float mouseX, float mouseY, double horizontalAmount, double verticalAmount) Sets independent horizontal and vertical overflow behavior.overflowX(GuiOverflowMode mode) overflowY(GuiOverflowMode mode) Controls whether unconsumed scrolling may chain to an ancestor.padding(float all) Sets uniform inner padding in design-space pixels.padding(float vertical, float horizontal) Sets symmetric inner padding in design-space pixels.padding(float top, float right, float bottom, float left) Sets per-side inner padding in design-space pixels.pageMovementFactor(float factor) Sets the fraction of a viewport moved by Page Up or Page Down.position(float x, float y) Sets the component position in design-space pixels.pressed(Consumer<ContainerComponent> consumer) protected voidrenderClippedChildren(com.render.api.gui.GuiRenderContext context) Paints descendants through this component's overflow clip.protected voidrenderOverlay(com.render.api.gui.GuiRenderContext context) protected voidresolveBaseProperties(com.render.api.gui.GuiPropertyValues properties) scrollAnchor(GuiComponent<?> child) Keeps an explicitly selected direct child visually stable when content before it changes size.Returns the gutter policy.scrollbarGutter(GuiScrollbarGutter gutter) Selects persistent scrollbar layout-space reservation.scrollBehavior(GuiScrollBehavior behavior) Selects immediate or retained smooth movement for wheel, keyboard, snap, and programmaticscrollTo(float, float)requests.scrollBy(float x, float y) Requests movement relative to the current retained target.scrollIndicator(GuiScrollIndicator scrollIndicator) Sets the scrollbar style.Returns a detached marker-group configuration.Enables retained marker navigation for registered snap children.Map<GuiComponent<?>, Long> Returns stable marker identities keyed by their retained snap target.floatReturns the current vertical scroll offset in design-space pixels.scrollOffset(float scrollOffset) Sets the target vertical scroll offset in design-space pixels.floatscrollOffsetX(float scrollOffset) scrollPadding(float all) scrollPadding(GuiScrollInsets insets) Insets the effective snap viewport without changing laid-out content.scrollPosition(float x, float y) scrollSnapType(GuiScrollSnapType value) scrollStartTarget(GuiComponent<?> child, GuiScrollSnapAlign x, GuiScrollSnapAlign y) Selects a direct child that is aligned once after the first usable layout.scrollStep(float scrollStep) Sets the amount of scroll applied per mouse-wheel step.scrollTo(float x, float y) Requests a position using the configured scroll behavior.scrollTo(float x, float y, GuiScrollBehavior behavior) Requests a position with an explicit behavior.scrollToChild(GuiComponent<?> child, GuiScrollSnapAlign x, GuiScrollSnapAlign y) Aligns a direct child within the effective snap viewport.Sets the component shadow effect.protected booleanshouldRouteToChildren(float mouseX, float mouseY) showHorizontalScrollIndicator(boolean enabled) showScrollIndicator(boolean enabled) Enables or disables the scrollbar, creating a default one if needed.size(float width, float height) Sets the component size in design-space pixels.smoothScroll(double durationSeconds, GuiEasing easing) Configures retained smooth-scroll timing.doubleReturns the configured smooth-scroll duration.Returns the configured smooth-scroll easing.snapChild(GuiComponent<?> child, GuiScrollSnapAlign x, GuiScrollSnapAlign y) Registers one direct child as a snap target on either axis.Moves enabled axes to their nearest registered snap target.protected voidtick()transition(double durationSeconds, double delaySeconds, GuiEasing easing, GuiProperty<?>... properties) transition(double durationSeconds, double delaySeconds, GuiEasing easing, GuiPropertyGroup... groups) transition(double durationSeconds, GuiEasing easing, GuiProperty<?>... properties) transition(double durationSeconds, GuiEasing easing, GuiPropertyGroup... groups) transitionAll(double durationSeconds, double delaySeconds, GuiEasing easing) transitionAll(double durationSeconds, GuiEasing easing) translate(float translateX, float translateY) translateX(float translateX) translateY(float translateY) Sets a typed modern width.Methods inherited from class ContainerComponent
childLayout, flowColumn, flowRow, preferredHeight, preferredWidth, renderSelf, stackMethods inherited from class GuiComponent
activeStateStyle, add, alignContent, alignItems, alignSelf, anchor, anchorName, anchorPlacement, applyStyle, aspectRatio, backdropFilters, backfaceVisibility, backgroundLayer, backgroundLayers, backgroundLayers, border, borderCollapse, borderSpacing, boxDecorationBreak, boxGlow, boxShadow, boxShadows, boxShadows, boxSizing, breakAfter, breakBefore, breakInside, captionSide, caretStyle, centered, childGap, children, clearChildren, clipChildren, clipPath, color, color, columnCount, columnFill, columnGap, columnRule, columnSpan, columnWidth, computedStyle, contextMenu, defaultDisplay, dirtyCategories, display, emptyCells, enabled, enabled, filters, findById, findById, flexBasis, flexDirection, flexGrow, flexShrink, flexWrap, focused, fragmentTree, gridAutoFlow, gridPlacement, gridTemplate, height, height, id, id, indeterminate, indeterminate, inlineStyle, inset, inset, intrinsicSize, invalidateModernLayout, isClippingChildren, justifyContent, justifyItems, justifySelf, lastInvalidationReason, layoutFragments, listStyleImage, listStylePosition, listStyleType, margin, margin, margin, marginBreak, markerGap, markerSide, maskLayers, maskLayers, matchesStyleState, maxHeight, maxWidth, minHeight, minWidth, motionPath, onCharTyped, onFocusChanged, opacity, order, orphans, outline, pageName, paint, parent, position, preferredHeightForWidth, pseudoElementBox, pseudoElementStyle, quotes, rangeState, rangeState, readOnly, readOnly, remove, removeStyleClass, renderChildren, requestFocus, required, required, rowGap, scrollMargin, scrollMargin, scrollSnapStop, self, startingStyle, stateProvider, styleAttribute, styleAttribute, styleClass, styleClasses, styledPseudoElements, styleOpen, styleState, styleState, tabIndex, tabIndex, tableLayout, tooltip, transform, transformBox, transformOrigin, transformStyle, transition, transition, transitionAll, validity, validity, verticalAlign, viewTransitionName, viewTransitionName, visible, visible, widows, width, width, writeModernInline, writeTextShadow, writingState, x, x, y, y, zIndex
-
Constructor Details
-
ScrollContainerComponent
public ScrollContainerComponent()
-
-
Method Details
-
scrollStep
Sets the amount of scroll applied per mouse-wheel step.- Parameters:
scrollStep- scroll amount in design-space pixels- Returns:
- this component
-
horizontalScrollStep
-
scrollBehavior
Selects immediate or retained smooth movement for wheel, keyboard, snap, and programmaticscrollTo(float, float)requests.- Parameters:
behavior- scrolling behavior- Returns:
- this component
-
smoothScroll
Configures retained smooth-scroll timing.- Parameters:
durationSeconds- positive durationeasing- progress easing- Returns:
- this component
-
smoothScrollDurationSeconds
public double smoothScrollDurationSeconds()Returns the configured smooth-scroll duration.- Returns:
- duration in seconds
-
smoothScrollEasing
Returns the configured smooth-scroll easing.- Returns:
- easing function
-
pageMovementFactor
Sets the fraction of a viewport moved by Page Up or Page Down.- Parameters:
factor- fraction in the range0..1- Returns:
- this component
-
scrollPadding
Insets the effective snap viewport without changing laid-out content.- Parameters:
insets- snap viewport insets- Returns:
- this component
-
scrollPadding
-
scrollbarGutter
Selects persistent scrollbar layout-space reservation.- Parameters:
gutter- gutter policy- Returns:
- this component
-
scrollbarGutter
-
scrollMarkerGroup
Enables retained marker navigation for registered snap children.- Parameters:
group- marker group, ornullto disable it- Returns:
- this component
-
scrollMarkerGroup
Returns a detached marker-group configuration.- Returns:
- marker group, or
null
-
scrollMarkerIdentities
Returns stable marker identities keyed by their retained snap target.- Returns:
- immutable target-to-identity map
-
overflow
Sets independent horizontal and vertical overflow behavior.- Parameters:
x- horizontal overflow behaviory- vertical overflow behavior- Returns:
- this component
-
overflowX
-
overflowY
-
overflowX
-
overflowY
-
overscrollBehavior
public ScrollContainerComponent overscrollBehavior(GuiOverscrollBehavior x, GuiOverscrollBehavior y) Controls whether unconsumed scrolling may chain to an ancestor.- Parameters:
x- horizontal boundary behaviory- vertical boundary behavior- Returns:
- this component
-
scrollSnapType
-
snapChild
public ScrollContainerComponent snapChild(GuiComponent<?> child, GuiScrollSnapAlign x, GuiScrollSnapAlign y) Registers one direct child as a snap target on either axis.- Parameters:
child- direct child targetx- horizontal alignmenty- vertical alignment- Returns:
- this component
-
scrollStartTarget
public ScrollContainerComponent scrollStartTarget(GuiComponent<?> child, GuiScrollSnapAlign x, GuiScrollSnapAlign y) Selects a direct child that is aligned once after the first usable layout.- Parameters:
child- direct child targetx- horizontal alignmenty- vertical alignment- Returns:
- this component
-
scrollAnchor
Keeps an explicitly selected direct child visually stable when content before it changes size.- Parameters:
child- anchor child, ornullto disable anchoring- Returns:
- this component
-
layout
Sets the layout mode used for child placement.- Overrides:
layoutin classContainerComponent- Parameters:
childLayout- child layout mode- Returns:
- this component
-
gap
Sets the spacing between flowed children in design-space pixels.- Overrides:
gapin classContainerComponent- Parameters:
gap- child gap- Returns:
- this component
-
position
Sets the component position in design-space pixels.- Overrides:
positionin classGuiComponent<ContainerComponent>- Parameters:
x- x positiony- y position- Returns:
- this component
-
translateX
- Overrides:
translateXin classGuiComponent<ContainerComponent>
-
translateY
- Overrides:
translateYin classGuiComponent<ContainerComponent>
-
translate
- Overrides:
translatein classGuiComponent<ContainerComponent>
-
size
Sets the component size in design-space pixels.- Overrides:
sizein classGuiComponent<ContainerComponent>- Parameters:
width- component widthheight- component height- Returns:
- this component
-
autoWidth
- Overrides:
autoWidthin classGuiComponent<ContainerComponent>
-
autoHeight
- Overrides:
autoHeightin classGuiComponent<ContainerComponent>
-
autoSize
- Overrides:
autoSizein classGuiComponent<ContainerComponent>
-
padding
Sets uniform inner padding in design-space pixels.- Overrides:
paddingin classGuiComponent<ContainerComponent>- Parameters:
all- padding for every side- Returns:
- this component
-
padding
Sets symmetric inner padding in design-space pixels.- Overrides:
paddingin classGuiComponent<ContainerComponent>- Parameters:
vertical- top and bottom paddinghorizontal- left and right padding- Returns:
- this component
-
padding
Sets per-side inner padding in design-space pixels.- Overrides:
paddingin classGuiComponent<ContainerComponent>- Parameters:
top- top paddingright- right paddingbottom- bottom paddingleft- left padding- Returns:
- this component
-
backgroundColor
Sets the background color in ARGB format.- Overrides:
backgroundColorin classGuiComponent<ContainerComponent>- Parameters:
color- background color- Returns:
- this component
-
width
Description copied from class:GuiComponentSets a typed modern width. This declaration is used only by a modern host.- Overrides:
widthin classGuiComponent<ContainerComponent>- Parameters:
width- typed width- Returns:
- this component
-
height
Description copied from class:GuiComponentSets a typed modern height.- Overrides:
heightin classGuiComponent<ContainerComponent>- Parameters:
height- typed height- Returns:
- this component
-
size
- Overrides:
sizein classGuiComponent<ContainerComponent>
-
backgroundColor
Deprecated.- Overrides:
backgroundColorin classGuiComponent<ContainerComponent>
-
shadow
Sets the component shadow effect.- Overrides:
shadowin classGuiComponent<ContainerComponent>- Parameters:
shadow- shadow configuration, ornullto clear it- Returns:
- this component
-
glow
Sets the component glow effect.- Overrides:
glowin classGuiComponent<ContainerComponent>- Parameters:
glow- glow configuration, ornullto clear it- Returns:
- this component
-
gradient
Sets the background gradient.- Overrides:
gradientin classGuiComponent<ContainerComponent>- Parameters:
gradient- gradient configuration, ornullto clear it- Returns:
- this component
-
animatedBorder
Sets the animated border effect.- Overrides:
animatedBorderin classGuiComponent<ContainerComponent>- Parameters:
animatedBorder- animated border configuration, ornullto clear it- Returns:
- this component
-
transitionAll
- Overrides:
transitionAllin classGuiComponent<ContainerComponent>
-
transitionAll
public ScrollContainerComponent transitionAll(double durationSeconds, double delaySeconds, GuiEasing easing) - Overrides:
transitionAllin classGuiComponent<ContainerComponent>
-
transition
public ScrollContainerComponent transition(double durationSeconds, GuiEasing easing, GuiProperty<?>... properties) - Overrides:
transitionin classGuiComponent<ContainerComponent>
-
transition
public ScrollContainerComponent transition(double durationSeconds, double delaySeconds, GuiEasing easing, GuiProperty<?>... properties) - Overrides:
transitionin classGuiComponent<ContainerComponent>
-
transition
public ScrollContainerComponent transition(double durationSeconds, GuiEasing easing, GuiPropertyGroup... groups) - Overrides:
transitionin classGuiComponent<ContainerComponent>
-
transition
public ScrollContainerComponent transition(double durationSeconds, double delaySeconds, GuiEasing easing, GuiPropertyGroup... groups) - Overrides:
transitionin classGuiComponent<ContainerComponent>
-
hovered
- Overrides:
hoveredin classGuiComponent<ContainerComponent>
-
pressed
- Overrides:
pressedin classGuiComponent<ContainerComponent>
-
focused
- Overrides:
focusedin classGuiComponent<ContainerComponent>
-
disabled
- Overrides:
disabledin classGuiComponent<ContainerComponent>
-
animation
- Overrides:
animationin classGuiComponent<ContainerComponent>
-
play
- Overrides:
playin classGuiComponent<ContainerComponent>
-
pause
- Overrides:
pausein classGuiComponent<ContainerComponent>
-
resume
- Overrides:
resumein classGuiComponent<ContainerComponent>
-
cancel
- Overrides:
cancelin classGuiComponent<ContainerComponent>
-
borderColor
Sets the border color in ARGB format.- Overrides:
borderColorin classGuiComponent<ContainerComponent>- Parameters:
color- border color- Returns:
- this component
-
borderColor
Deprecated.- Overrides:
borderColorin classGuiComponent<ContainerComponent>
-
borderWidth
Sets the border width in design-space pixels.- Overrides:
borderWidthin classGuiComponent<ContainerComponent>- Parameters:
borderWidth- border width- Returns:
- this component
-
cornerRadius
Sets the border corner radius in design-space pixels.- Overrides:
cornerRadiusin classGuiComponent<ContainerComponent>- Parameters:
cornerRadius- corner radius- Returns:
- this component
-
scrollIndicator
Sets the scrollbar style.- Parameters:
scrollIndicator- scrollbar configuration, ornullto disable it- Returns:
- this component
-
horizontalScrollIndicator
-
showScrollIndicator
Enables or disables the scrollbar, creating a default one if needed.- Parameters:
enabled-trueto render the scrollbar when scrolling is possible- Returns:
- this component
-
showHorizontalScrollIndicator
-
scrollOffset
public float scrollOffset()Returns the current vertical scroll offset in design-space pixels.- Returns:
- current scroll offset
-
scrollOffsetX
public float scrollOffsetX() -
scrollOffset
Sets the target vertical scroll offset in design-space pixels.- Parameters:
scrollOffset- scroll offset- Returns:
- this component
-
scrollOffsetX
-
scrollPosition
-
scrollTo
Requests a position using the configured scroll behavior.- Parameters:
x- horizontal offsety- vertical offset- Returns:
- this component
-
scrollTo
Requests a position with an explicit behavior.- Parameters:
x- horizontal offsety- vertical offsetbehavior- movement behavior- Returns:
- this component
-
scrollBy
Requests movement relative to the current retained target.- Parameters:
x- horizontal deltay- vertical delta- Returns:
- this component
-
scrollToChild
public ScrollContainerComponent scrollToChild(GuiComponent<?> child, GuiScrollSnapAlign x, GuiScrollSnapAlign y) Aligns a direct child within the effective snap viewport.- Parameters:
child- direct childx- horizontal alignmenty- vertical alignment- Returns:
- this component
-
maxScrollOffset
public float maxScrollOffset()Returns the maximum vertical scroll offset in design-space pixels.- Returns:
- maximum scroll offset
-
maxScrollOffsetX
public float maxScrollOffsetX() -
childLayoutViewport
protected com.render.api.gui.GuiBox childLayoutViewport()Description copied from class:GuiComponentReturns the box used to arrange descendants. Scroll containers override this to reserve persistent scrollbar gutters.- Overrides:
childLayoutViewportin classGuiComponent<ContainerComponent>
-
clipsChildren
protected boolean clipsChildren()- Overrides:
clipsChildrenin classGuiComponent<ContainerComponent>
-
renderClippedChildren
protected void renderClippedChildren(com.render.api.gui.GuiRenderContext context) Description copied from class:GuiComponentPaints descendants through this component's overflow clip.- Overrides:
renderClippedChildrenin classGuiComponent<ContainerComponent>
-
shouldRouteToChildren
protected boolean shouldRouteToChildren(float mouseX, float mouseY) - Overrides:
shouldRouteToChildrenin classGuiComponent<ContainerComponent>
-
containsChildClipPoint
protected boolean containsChildClipPoint(float mouseX, float mouseY) - Overrides:
containsChildClipPointin classGuiComponent<ContainerComponent>
-
childOffsetX
protected float childOffsetX()- Overrides:
childOffsetXin classGuiComponent<ContainerComponent>
-
childOffsetY
protected float childOffsetY()- Overrides:
childOffsetYin classGuiComponent<ContainerComponent>
-
resolveBaseProperties
protected void resolveBaseProperties(com.render.api.gui.GuiPropertyValues properties) - Overrides:
resolveBasePropertiesin classContainerComponent
-
layoutChildren
protected void layoutChildren(com.render.api.gui.GuiRenderContext context) - Overrides:
layoutChildrenin classGuiComponent<ContainerComponent>
-
onModernLayoutComplete
protected void onModernLayoutComplete()Description copied from class:GuiComponentInvoked after this component's descendants have been arranged by the modern layout engine.- Overrides:
onModernLayoutCompletein classGuiComponent<ContainerComponent>
-
handlesMouseScroll
protected boolean handlesMouseScroll(float mouseX, float mouseY) - Overrides:
handlesMouseScrollin classGuiComponent<ContainerComponent>
-
onMouseScrolled
protected boolean onMouseScrolled(com.render.api.gui.GuiRenderContext context, float mouseX, float mouseY, double horizontalAmount, double verticalAmount) - Overrides:
onMouseScrolledin classGuiComponent<ContainerComponent>
-
isFocusable
protected boolean isFocusable()- Overrides:
isFocusablein classGuiComponent<ContainerComponent>
-
onKeyPressed
protected boolean onKeyPressed(com.render.api.gui.GuiRenderContext context, int keyCode, int scanCode, int modifiers) - Overrides:
onKeyPressedin classGuiComponent<ContainerComponent>
-
tick
protected void tick()- Overrides:
tickin classGuiComponent<ContainerComponent>
-
handlesMouseClick
protected boolean handlesMouseClick(float mouseX, float mouseY, int button) - Overrides:
handlesMouseClickin classGuiComponent<ContainerComponent>
-
onMouseClicked
protected boolean onMouseClicked(com.render.api.gui.GuiRenderContext context, float mouseX, float mouseY, int button) - Overrides:
onMouseClickedin classGuiComponent<ContainerComponent>
-
onMouseDragged
protected boolean onMouseDragged(com.render.api.gui.GuiRenderContext context, float mouseX, float mouseY, int button, double dragX, double dragY) - Overrides:
onMouseDraggedin classGuiComponent<ContainerComponent>
-
onMouseReleased
protected boolean onMouseReleased(com.render.api.gui.GuiRenderContext context, float mouseX, float mouseY, int button) - Overrides:
onMouseReleasedin classGuiComponent<ContainerComponent>
-
renderOverlay
protected void renderOverlay(com.render.api.gui.GuiRenderContext context) - Overrides:
renderOverlayin classGuiComponent<ContainerComponent>
-
snapToNearest
Moves enabled axes to their nearest registered snap target.- Returns:
- this component
-
backgroundColor(RenderColor).