Class GuiComponent<T extends GuiComponent<T>>
- Type Parameters:
T- concrete component type for fluent builder methods
- Direct Known Subclasses:
AssetComponent, CircleComponent, ContainerComponent, EntityModelComponent, ImageComponent, ItemModelComponent, MenuSeparatorComponent, MultilineTextInputComponent, PlayerFaceComponent, RectangleComponent, ShapeComponent, SliderComponent, SvgComponent, TextComponent, TextInputComponent, VirtualListComponent
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanacceptsPointerButton(int button) Selects buttons this custom control accepts.protected booleanSelects whether this custom control participates in wheel routing within its bounds.protected final com.render.api.gui.GuiStateStyleadd(GuiComponent<?> child) alignContent(GuiAlignment alignment) alignItems(GuiAlignment alignment) alignSelf(GuiAlignment alignment) anchorName(String name) anchorPlacement(GuiAnchorPlacement placement) animatedBorder(GuiAnimatedBorder animatedBorder) Sets the animated border decoration.animation(String name, GuiKeyframes keyframes) applyStyle(GuiStylePreset preset) Applies a reusable sparse style preset.aspectRatio(GuiAspectRatio aspectRatio) autoSize()backdropFilters(GuiFilterChain filters) Sets filters applied to the game and retained GUI content already painted behind this component.backfaceVisibility(GuiBackfaceVisibility visibility) Selects whether a transformed back face remains visible.backgroundColor(RenderColor color) backgroundLayers(GuiBackgroundLayer... layers) backgroundLayers(List<GuiBackgroundLayer> layers) Replaces the ordered modern background-image layer list.Sets the typed per-side border.borderCollapse(GuiBorderCollapse collapse) borderColor(RenderColor color) borderSpacing(float spacing) borderWidth(float borderWidth) boxDecorationBreak(GuiBoxDecorationBreak behavior) Sets the glow painted around this component's box.Sets the drop shadow painted behind this component's box.boxShadows(GuiBoxShadow... shadows) boxShadows(List<GuiBoxShadow> shadows) boxSizing(GuiBoxSizing boxSizing) breakAfter(GuiBreakValue value) breakBefore(GuiBreakValue value) breakInside(GuiBreakValue value) Cancels a named animation and schedules reevaluation of its underlying geometry and paint on the next frame.captionSide(GuiCaptionSide side) caretStyle(GuiCaretStyle caretStyle) Sets the editable-text caret appearance inherited by theCARETpseudo-element.centered()protected floatchildGap()protected ContainerLayoutprotected com.render.api.gui.GuiBoxReturns the box used to arrange descendants.protected floatprotected floatList<GuiComponent<?>> children()clipChildren(boolean clipChildren) Sets whether child content is clipped to this component's content bounds.clipPath(GuiClipPath path) Sets the component clip path, ornullto remove it.protected booleancolor(RenderColor color) columnCount(int count) columnFill(GuiColumnFill fill) columnRule(GuiBorderSide rule) columnSpan(GuiColumnSpan span) columnWidth(GuiLength width) final Optional<GuiComputedStyle> Returns the latest computed modern style.protected booleancontainsChildClipPoint(float mouseX, float mouseY) contextMenu(ContextMenuComponent contextMenu) cornerRadius(float cornerRadius) protected final voiddefaultDisplay(GuiDisplay display) Defines the formatting role supplied by a component type before authored styles and fluent inline declarations are applied.protected voiddefineModernDefaults(GuiStyleBuilder defaults) Adds stylesheet-overridable defaults for this component type.final Set<GuiDirtyCategory> Returns current modern invalidation categories.display(GuiDisplay display) emptyCells(GuiEmptyCells value) booleanenabled()enabled(boolean enabled) filters(GuiFilterChain filters) Sets the ordered foreground filter chain.final Optional<GuiComponent<?>> Finds the uniquely identified component in this retained subtree.final <C extends GuiComponent<?>>
Optional<C> Finds and type-checks a uniquely identified component in this retained subtree.flexDirection(GuiFlexDirection direction) flexGrow(float grow) flexShrink(float shrink) flexWrap(GuiFlexWrap wrap) booleanfocused()Returns whether this component currently owns keyboard focus.final GuiFragmentTreeReturns the latest page/column fragment projection rooted at this component.protected booleangradient(GuiGradient gradient) gridAutoFlow(GuiGridAutoFlow flow) gridPlacement(GuiGridPlacement placement) gridTemplate(GuiGridTemplate template) protected booleanhandlesMouseClick(float mouseX, float mouseY, int button) protected booleanhandlesMouseScroll(float mouseX, float mouseY) floatheight()height(float height) Sets a typed modern height.id()Returns this component's optional stable identifier.Assigns this component's optional stable identifier.final booleanindeterminate(boolean indeterminate) Sets the mixed/indeterminate state used by tri-state controls.inlineStyle(Consumer<GuiStyleBuilder> declarations) Adds typed high-priority inline declarations for modern mode.final GuiIntrinsicSizeReturns intrinsic contributions from the latest modern measure pass.protected final voidInvalidates intrinsic measurement, arrangement and paint after custom content changes size.protected final voidInvalidates cached declarations after state used bydefineModernDefaults(GuiStyleBuilder)changes.protected final voidinvalidateModernLayout(String reason) protected final voidInvalidates custom paint and compositing after leaf state changes without changing its intrinsic size.booleanReturns whether child content is clipped to this component's content bounds.protected booleanjustifyContent(GuiAlignment alignment) justifyItems(GuiAlignment alignment) justifySelf(GuiAlignment alignment) final StringReturns the latest invalidation reason for devtools.protected voidlayoutChildren(com.render.api.gui.GuiRenderContext context) final List<GuiLayoutFragment> Returns final modern layout fragments.listStyleImage(GuiListMarkerImage image) Replaces the automatic text marker with an explicitly sized image.listStylePosition(GuiListStylePosition position) Places the automatic marker inside the first line or in an outside marker column.listStyleType(GuiCounterStyle style) Selects the list counter style used by an automatic::marker.margin(float all) margin(float vertical, float horizontal) margin(float top, float right, float bottom, float left) marginBreak(GuiMarginBreak value) markerGap(float gap) Sets the space between an outside marker and the principal box.markerSide(GuiMarkerSide side) Selects which writing direction determines the outside marker side.maskLayers(GuiMaskLayer... layers) Replaces the ordered mask-layer list.maskLayers(List<GuiMaskLayer> layers) Replaces the ordered mask-layer list.final booleanmatchesStyleState(GuiStyleState state) Tests a standard or custom modern selector state.protected floatmeasureBaseline(GuiMeasureContext context) Returns the first baseline from the padding-box top; NaN requests content-bottom synthesis.protected floatmeasureHeightForWidth(GuiMeasureContext context, float resolvedWidth) Returns border-box height at the resolved border-box width.protected floatmeasureLastBaseline(GuiMeasureContext context) Returns the last baseline from the padding-box top.protected floatmeasureMinContentWidth(GuiMeasureContext context) Returns the minimum unbreakable border-box width.protected floatmeasurePreferredHeight(GuiMeasureContext context) Returns the preferred border-box height, including padding, before a width constraint is supplied.protected floatmeasurePreferredWidth(GuiMeasureContext context) Returns the preferred border-box width for an externally implemented leaf, including its padding.motionPath(GuiMotionPath path) Sets the post-layout path followed by this component.protected booleanonCharTyped(GuiInputContext context, int codePoint, int modifiers) Handles one Unicode code point while this control owns keyboard focus.protected booleanonCharTyped(com.render.api.gui.GuiRenderContext context, int codePoint, int modifiers) protected voidonChildDetached(GuiComponent<?> child) Releases parent-owned references when a source child is detached.protected voidonFocusChanged(boolean focused) Observes committed keyboard focus changes.protected booleanonKeyPressed(GuiInputContext context, int keyCode, int scanCode, int modifiers) Handles GLFW key/scan/modifier values while this focusable control owns keyboard focus.protected 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(GuiInputContext context, float mouseX, float mouseY, int button) Handles an accepted press at inverse-transformed design coordinates; return true to own the gesture.protected booleanonMouseClicked(com.render.api.gui.GuiRenderContext context, float mouseX, float mouseY, int button) protected booleanonMouseDragged(GuiInputContext context, float mouseX, float mouseY, int button, double dragX, double dragY) Handles captured drag coordinates and deltas after inverse ancestor transforms.protected booleanonMouseDragged(com.render.api.gui.GuiRenderContext context, float mouseX, float mouseY, int button, double dragX, double dragY) protected booleanonMouseReleased(GuiInputContext context, float mouseX, float mouseY, int button) Handles the captured pointer's normal release, including a release outside this component's bounds.protected booleanonMouseReleased(com.render.api.gui.GuiRenderContext context, float mouseX, float mouseY, int button) protected booleanonMouseScrolled(GuiInputContext context, float mouseX, float mouseY, double horizontalAmount, double verticalAmount) Handles horizontal/vertical wheel amounts selected by the topmost eligible pointer target.protected booleanonMouseScrolled(com.render.api.gui.GuiRenderContext context, float mouseX, float mouseY, double horizontalAmount, double verticalAmount) protected voidonParentChanged(GuiComponent<?> previousParent, GuiComponent<?> newParent) Observes a committed direct-parent attachment change.protected voidClears custom gesture state when the host closes or capture becomes detached, disabled or modal-excluded.opacity(float opacity) order(int order) orphans(int lines) outline(GuiOutline outline) padding(float all) padding(float vertical, float horizontal) padding(float top, float right, float bottom, float left) protected voidpaint(GuiPaintContext context) Paints custom leaf content after RenderLib's built-in component rendering and before child rendering.Returns this component's immutable declared worklet inputs.paintInputs(GuiPaintInputs inputs) Supplies immutable named inputs and optional selector queries to this component's visual and mask worklets.GuiComponent<?> parent()Freezes the last displayed sample of a named animation.final GuiPointerEventsReturns the pointer participation policy.pointerEvents(GuiPointerEvents events) Selects pointer participation for this component and its descendants.position(float x, float y) position(GuiPositionType positionType) protected floatpreferredBaseline(com.render.api.gui.GuiRenderContext context) Returns the first baseline measured from the padding-box top.protected floatpreferredHeight(com.render.api.gui.GuiRenderContext context) protected floatpreferredHeightForWidth(com.render.api.gui.GuiRenderContext context, float resolvedWidth) protected floatpreferredLastBaseline(com.render.api.gui.GuiRenderContext context) Returns the last baseline measured from the padding-box top.protected floatpreferredMinContentWidth(com.render.api.gui.GuiRenderContext context) Returns the minimum unbreakable border-box width, including padding.protected floatpreferredWidth(com.render.api.gui.GuiRenderContext context) pseudoElementBox(GuiPseudoElement pseudoElement) Returns a stable generated pseudo-element box forBEFORE,AFTER, orMARKERafter a matching modern rule has resolved.final Optional<GuiComputedStyle> pseudoElementStyle(GuiPseudoElement pseudoElement) Returns a paint-only or generated pseudo-element's computed style.quotes(GuiQuotePairs quotes) Selects generated open/close quote pairs.final GuiRangeStaterangeState(GuiRangeState rangeState) Sets the optional range pseudo-state for numeric and custom controls.final booleanreadOnly()readOnly(boolean readOnly) Makes this control read-only for selector and interaction semantics.remove(GuiComponent<?> child) removeInlineStyle(GuiStyleProperty<?> property) Removes an authored modern inline override so stylesheets and component defaults can supply this property again.removeStyleClass(String styleClass) Removes a selector-visible style class.protected final voidrenderChildren(com.render.api.gui.GuiRenderContext context) 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 voidrenderSelf(com.render.api.gui.GuiRenderContext context) replaceChildren(GuiComponent<?>... replacements) Varargs form ofreplaceChildren(List).replaceChildren(List<? extends GuiComponent<?>> replacements) Replaces source children while treating an identical retained identity/order sequence as a no-op.final booleanrequired()required(boolean required) Sets whether this component participates in required/optional form styling.protected voidresolveBaseProperties(com.render.api.gui.GuiPropertyValues properties) Resumes a paused animation, excluding the complete pause interval even when frames reused the held sample.scrollMargin(float all) Sets a uniform snap-area expansion.scrollMargin(GuiScrollInsets margin) Sets the target's snap-area expansion.Selects whether a snap operation may pass this target.protected final Tself()protected booleanshouldRouteToChildren(float mouseX, float mouseY) size(float width, float height) startingStyle(Consumer<GuiStyleBuilder> declarations) Defines typed values used when this component first enters the styled tree.stateProvider(GuiStateProvider provider) Adds a dynamic state provider.<V> Optional<V> styleAttribute(GuiStyleAttribute<V> attribute) Reads a typed style attribute.<V> TstyleAttribute(GuiStyleAttribute<V> attribute, V value) Sets a typed selector-visible component attribute.styleClass(String... classes) Adds one or more selector-visible style classes.Returns immutable selector-visible style classes.final Set<GuiPseudoElement> Returns pseudo-elements with a currently matched modern rule.protected booleanAllows controls with retained popup/expansion state to implement:open.styleState(GuiPseudoClass pseudoClass, boolean active) Sets an explicit standard pseudo-class value.styleState(String state, boolean active) Sets a component-defined selector state.inttabIndex()Returns this component's sequential focus index.tabIndex(int tabIndex) Sets this component's sequential keyboard-focus order.tableLayout(GuiTableLayout layout) protected voidtick()tooltip(TooltipComponent tooltip) transform(GuiTransform transform) Sets the immutable post-layout transform list for this component subtree.Selects the component box used to resolve transforms.transformOrigin(GuiTransformOrigin origin) Sets the normalized origin around which transforms are applied.transformStyle(GuiTransformStyle transformStyle) Selects flat or preserve-3D descendant transform behavior.transition(double durationSeconds, double delaySeconds, GuiEasing easing, GuiProperty<?>... properties) transition(double durationSeconds, double delaySeconds, GuiEasing easing, GuiPropertyGroup... groups) transition(double durationSeconds, double delaySeconds, GuiEasing easing, GuiTransitionBehavior behavior, GuiStyleProperty<?>... properties) Transitions selected typed modern properties.transition(double durationSeconds, GuiEasing easing, GuiProperty<?>... properties) transition(double durationSeconds, GuiEasing easing, GuiPropertyGroup... groups) transition(double durationSeconds, GuiEasing easing, GuiTransitionBehavior behavior, GuiStyleProperty<?>... properties) transitionAll(double durationSeconds, double delaySeconds, GuiEasing easing) transitionAll(double durationSeconds, double delaySeconds, GuiEasing easing, GuiTransitionBehavior behavior) Transitions every modern property, optionally including discrete values.transitionAll(double durationSeconds, GuiEasing easing) translate(float translateX, float translateY) translateX(float translateX) translateY(float translateY) updateWhenChanged(String channel, long revision, Consumer<T> updater) Allocation-free steady-state revision overload ofupdateWhenChanged(String, Object, Consumer).updateWhenChanged(String channel, Object snapshot, Consumer<T> updater) Runs a retained update only when its immutable equality snapshot changes.final GuiValidityvalidity()validity(GuiValidity validity) Sets semantic validity independently of edit-time input filtering.verticalAlign(GuiVerticalAlign verticalAlign) final StringReturns this component's explicit view-transition name.viewTransitionName(String name) Assigns the stable name used to pair this component's old and new view-transition snapshots.booleanvisible()visible(boolean visible) widows(int lines) floatwidth()width(float width) Sets a typed modern width.protected final <V> voidwriteModernInline(GuiStyleProperty<V> property, V value) protected final voidwriteTextShadow(boolean shadow) protected final booleanfloatx()x(float x) floaty()y(float y) zIndex(int zIndex)
-
Constructor Details
-
GuiComponent
protected GuiComponent()
-
-
Method Details
-
framePreparationRequired
protected boolean framePreparationRequired() -
clipsChildren
protected boolean clipsChildren() -
renderClippedChildren
protected void renderClippedChildren(com.render.api.gui.GuiRenderContext context) Paints descendants through this component's overflow clip. -
layoutChildren
protected void layoutChildren(com.render.api.gui.GuiRenderContext context) -
onModernLayoutComplete
protected void onModernLayoutComplete()Invoked after this component's descendants have been arranged by the modern layout engine. -
childLayout
-
childGap
protected float childGap() -
childOffsetX
protected float childOffsetX() -
childOffsetY
protected float childOffsetY() -
childLayoutViewport
protected com.render.api.gui.GuiBox childLayoutViewport()Returns the box used to arrange descendants. Scroll containers override this to reserve persistent scrollbar gutters. -
preferredWidth
protected float preferredWidth(com.render.api.gui.GuiRenderContext context) -
preferredHeight
protected float preferredHeight(com.render.api.gui.GuiRenderContext context) -
preferredMinContentWidth
protected float preferredMinContentWidth(com.render.api.gui.GuiRenderContext context) Returns the minimum unbreakable border-box width, including padding. Modern intrinsic layout calls this hook; the default usespreferredWidth(GuiRenderContext)for replaced/custom components.- Parameters:
context- rendering and measurement context- Returns:
- minimum intrinsic width in design pixels
-
preferredBaseline
protected float preferredBaseline(com.render.api.gui.GuiRenderContext context) Returns the first baseline measured from the padding-box top. The default baseline is the bottom content edge. Text and custom typographic components can supply their actual baseline for inline, flex and table alignment.- Parameters:
context- rendering and measurement context- Returns:
- baseline offset including top padding, excluding the border;
NaNrequests content-bottom synthesis
-
preferredLastBaseline
protected float preferredLastBaseline(com.render.api.gui.GuiRenderContext context) Returns the last baseline measured from the padding-box top. The default shares the first baseline, as a replaced element has one alignment edge.- Parameters:
context- rendering and measurement context- Returns:
- last baseline offset including top padding, excluding the border
-
preferredHeightForWidth
protected float preferredHeightForWidth(com.render.api.gui.GuiRenderContext context, float resolvedWidth) -
measurePreferredWidth
Returns the preferred border-box width for an externally implemented leaf, including its padding.- Parameters:
context- callback-scoped public measurement surface- Returns:
- finite, nonnegative design-pixel width
-
measurePreferredHeight
Returns the preferred border-box height, including padding, before a width constraint is supplied. -
measureMinContentWidth
Returns the minimum unbreakable border-box width. The default shares the preferred width. -
measureHeightForWidth
Returns border-box height at the resolved border-box width. Use this for wrapping or aspect-ratio content.- Parameters:
context- callback-scoped public measurement surfaceresolvedWidth- resolved border-box width in design pixels- Returns:
- finite, nonnegative design-pixel height
-
measureBaseline
Returns the first baseline from the padding-box top; NaN requests content-bottom synthesis. -
measureLastBaseline
Returns the last baseline from the padding-box top. The default shares the first baseline. -
invalidateMeasurement
protected final void invalidateMeasurement()Invalidates intrinsic measurement, arrangement and paint after custom content changes size. -
invalidatePaint
protected final void invalidatePaint()Invalidates custom paint and compositing after leaf state changes without changing its intrinsic size. -
shouldRouteToChildren
protected boolean shouldRouteToChildren(float mouseX, float mouseY) -
containsChildClipPoint
protected boolean containsChildClipPoint(float mouseX, float mouseY) -
handlesMouseClick
protected boolean handlesMouseClick(float mouseX, float mouseY, int button) -
handlesMouseScroll
protected boolean handlesMouseScroll(float mouseX, float mouseY) -
acceptsPointerButton
protected boolean acceptsPointerButton(int button) Selects buttons this custom control accepts. Accepted presses capture drag/release outside its bounds. -
acceptsScroll
protected boolean acceptsScroll()Selects whether this custom control participates in wheel routing within its bounds. -
isFocusable
protected boolean isFocusable() -
renderSelf
protected void renderSelf(com.render.api.gui.GuiRenderContext context) -
paint
Paints custom leaf content after RenderLib's built-in component rendering and before child rendering.This is the supported rendering hook for components implemented outside
com.render.api.gui. The supplied context exposes only public, stable types and is valid only until this method returns.- Parameters:
context- public custom-paint surface for the current frame
-
renderOverlay
protected void renderOverlay(com.render.api.gui.GuiRenderContext context) -
onMouseClicked
protected boolean onMouseClicked(com.render.api.gui.GuiRenderContext context, float mouseX, float mouseY, int button) -
onMouseReleased
protected boolean onMouseReleased(com.render.api.gui.GuiRenderContext context, float mouseX, float mouseY, int button) -
onMouseDragged
protected boolean onMouseDragged(com.render.api.gui.GuiRenderContext context, float mouseX, float mouseY, int button, double dragX, double dragY) -
onMouseScrolled
protected boolean onMouseScrolled(com.render.api.gui.GuiRenderContext context, float mouseX, float mouseY, double horizontalAmount, double verticalAmount) -
onKeyPressed
protected boolean onKeyPressed(com.render.api.gui.GuiRenderContext context, int keyCode, int scanCode, int modifiers) -
onCharTyped
protected boolean onCharTyped(com.render.api.gui.GuiRenderContext context, int codePoint, int modifiers) -
onMouseClicked
Handles an accepted press at inverse-transformed design coordinates; return true to own the gesture. -
onMouseReleased
Handles the captured pointer's normal release, including a release outside this component's bounds. -
onMouseDragged
protected boolean onMouseDragged(GuiInputContext context, float mouseX, float mouseY, int button, double dragX, double dragY) Handles captured drag coordinates and deltas after inverse ancestor transforms. -
onMouseScrolled
protected boolean onMouseScrolled(GuiInputContext context, float mouseX, float mouseY, double horizontalAmount, double verticalAmount) Handles horizontal/vertical wheel amounts selected by the topmost eligible pointer target. -
onKeyPressed
Handles GLFW key/scan/modifier values while this focusable control owns keyboard focus. -
onCharTyped
Handles one Unicode code point while this control owns keyboard focus. -
onPointerCancelled
protected void onPointerCancelled()Clears custom gesture state when the host closes or capture becomes detached, disabled or modal-excluded. -
onParentChanged
Observes a committed direct-parent attachment change. Reordering under the same parent is a no-op.- Parameters:
previousParent- former parent, or null when previously detachednewParent- current parent, or null when now detached
-
onFocusChanged
protected void onFocusChanged(boolean focused) Observes committed keyboard focus changes. -
tick
protected void tick() -
resolveBaseProperties
protected void resolveBaseProperties(com.render.api.gui.GuiPropertyValues properties) -
writingState
protected final boolean writingState() -
activeStateStyle
protected final com.render.api.gui.GuiStateStyle activeStateStyle() -
writeTextShadow
protected final void writeTextShadow(boolean shadow) -
pointerEvents
Selects pointer participation for this component and its descendants. Use CHILDREN_ONLY for structural overlay containers and NONE for decorative drag ghosts or tooltips.- Parameters:
events- pointer participation policy- Returns:
- this component
-
pointerEvents
Returns the pointer participation policy.- Returns:
- pointer participation policy
-
add
-
remove
-
clearChildren
-
onChildDetached
Releases parent-owned references when a source child is detached.- Parameters:
child- the detached source child
-
replaceChildren
Replaces source children while treating an identical retained identity/order sequence as a no-op.Reuse component instances. Newly allocated look-alikes are intentionally considered different because callbacks, focus, animation, and resource ownership cannot be compared safely. Invalid ownership or duplicate identities are rejected before either tree is mutated.
- Parameters:
replacements- desired source children in paint order- Returns:
- this component
-
replaceChildren
Varargs form ofreplaceChildren(List).- Parameters:
replacements- desired source children in paint order- Returns:
- this component
-
updateWhenChanged
Runs a retained update only when its immutable equality snapshot changes.Use this around coarse synchronization code that would otherwise clear/rebuild a subtree every tick. Prefer direct setters for individual values. Channels are component-local and limited to 32 retained snapshots; the oldest is discarded when the limit is exceeded. Snapshots should be immutable scalars, strings, records, or immutable lists.
- Parameters:
channel- stable name for this update sourcesnapshot- immutable equality value representing the input stateupdater- update executed only after a changed snapshot- Returns:
- this component
-
updateWhenChanged
Allocation-free steady-state revision overload ofupdateWhenChanged(String, Object, Consumer).- Parameters:
channel- stable name for this update sourcerevision- monotonically changing model or content revisionupdater- update executed only after a changed revision- Returns:
- this component
-
children
-
parent
-
x
public float x() -
y
public float y() -
width
public float width() -
height
public float height() -
visible
public boolean visible() -
enabled
public boolean enabled() -
focused
public boolean focused()Returns whether this component currently owns keyboard focus.- Returns:
truewhen focused
-
readOnly
Makes this control read-only for selector and interaction semantics. Text fields keep selection, navigation, copy and programmatic value updates; user edits are consumed without changing their value. Other controls may define their own read-only behavior.- Parameters:
readOnly- read-only state- Returns:
- this component
-
readOnly
public final boolean readOnly() -
required
Sets whether this component participates in required/optional form styling.- Parameters:
required- required state- Returns:
- this component
-
required
public final boolean required() -
validity
Sets semantic validity independently of edit-time input filtering.- Parameters:
validity- validation state- Returns:
- this component
-
validity
-
rangeState
Sets the optional range pseudo-state for numeric and custom controls.- Parameters:
rangeState- range state- Returns:
- this component
-
rangeState
-
indeterminate
Sets the mixed/indeterminate state used by tri-state controls.- Parameters:
indeterminate- mixed state- Returns:
- this component
-
indeterminate
public final boolean indeterminate() -
matchesStyleState
Tests a standard or custom modern selector state.- Parameters:
state- state query- Returns:
- active flag
-
computedStyle
Returns the latest computed modern style.- Returns:
- computed style when this component has been resolved by a modern host
-
intrinsicSize
Returns intrinsic contributions from the latest modern measure pass.- Returns:
- immutable intrinsic metrics
-
layoutFragments
Returns final modern layout fragments. Modern layout normally produces one fragment per box;display:contentsanddisplay:noneproduce none.- Returns:
- immutable fragment list
-
fragmentTree
Returns the latest page/column fragment projection rooted at this component.- Returns:
- immutable fragment tree, or an empty tree outside fragmentation
-
pseudoElementStyle
Returns a paint-only or generated pseudo-element's computed style.- Parameters:
pseudoElement- pseudo-element- Returns:
- computed style when a matching rule exists
-
styledPseudoElements
Returns pseudo-elements with a currently matched modern rule.- Returns:
- immutable pseudo-element set
-
pseudoElementBox
Returns a stable generated pseudo-element box forBEFORE,AFTER, orMARKERafter a matching modern rule has resolved.- Parameters:
pseudoElement- tree-abiding pseudo-element- Returns:
- generated box when present
-
dirtyCategories
Returns current modern invalidation categories.- Returns:
- immutable dirty-category set
-
lastInvalidationReason
Returns the latest invalidation reason for devtools.- Returns:
- reason
-
paintInputs
Supplies immutable named inputs and optional selector queries to this component's visual and mask worklets. -
paintInputs
Returns this component's immutable declared worklet inputs. -
margin
-
margin
-
margin
-
padding
-
padding
-
padding
-
color
-
backgroundColor
-
borderColor
-
borderWidth
-
cornerRadius
-
opacity
-
shadow
-
boxShadow
-
glow
-
boxGlow
-
gradient
-
animatedBorder
Sets the animated border decoration.The moving ring follows the border edge and its glow may extend outside this component's own clip path. Ancestor clips still constrain the decoration.
- Parameters:
animatedBorder- animated border, ornull- Returns:
- this component
-
visible
-
caretStyle
Sets the editable-text caret appearance inherited by theCARETpseudo-element.- Parameters:
caretStyle- caret appearance- Returns:
- this component
-
backgroundLayers
Replaces the ordered modern background-image layer list. The background color is painted below every layer.- Parameters:
layers- ordered bottom-to-top layers- Returns:
- this component
-
backgroundLayers
-
backgroundLayer
-
border
-
outline
-
boxDecorationBreak
-
boxShadows
-
boxShadows
-
transform
Sets the immutable post-layout transform list for this component subtree.- Parameters:
transform- ordered transform list- Returns:
- this component
-
transformOrigin
Sets the normalized origin around which transforms are applied.- Parameters:
origin- transform origin- Returns:
- this component
-
transformBox
Selects the component box used to resolve transforms.- Parameters:
box- transform reference box- Returns:
- this component
-
transformStyle
Selects flat or preserve-3D descendant transform behavior.- Parameters:
transformStyle- descendant transform behavior- Returns:
- this component
-
backfaceVisibility
Selects whether a transformed back face remains visible.- Parameters:
visibility- back-face behavior- Returns:
- this component
-
motionPath
Sets the post-layout path followed by this component.- Parameters:
path- motion-path declaration- Returns:
- this component
-
clipPath
Sets the component clip path, ornullto remove it.- Parameters:
path- clip path- Returns:
- this component
-
maskLayers
Replaces the ordered mask-layer list.- Parameters:
layers- mask layers in paint order- Returns:
- this component
-
maskLayers
Replaces the ordered mask-layer list.- Parameters:
layers- mask layers in paint order- Returns:
- this component
-
filters
Sets the ordered foreground filter chain.- Parameters:
filters- foreground filters- Returns:
- this component
-
backdropFilters
Sets filters applied to the game and retained GUI content already painted behind this component. The component's own fill, border, and descendants are painted sharply after the clipped backdrop pass.- Parameters:
filters- backdrop filters- Returns:
- this component
-
enabled
-
clipChildren
Sets whether child content is clipped to this component's content bounds.- Parameters:
clipChildren- whether to clip child content- Returns:
- this component
-
isClippingChildren
public boolean isClippingChildren()Returns whether child content is clipped to this component's content bounds.- Returns:
- whether child content is clipped
-
requestFocus
-
tooltip
-
contextMenu
-
applyStyle
Applies a reusable sparse style preset.- Parameters:
preset- preset to apply- Returns:
- this component
-
inlineStyle
Adds typed high-priority inline declarations for modern mode.Existing fluent setters write to the same precedence level. Cascade-wide
INITIAL,INHERIT, andUNSETvalues are available throughGuiStyleBuilder.set(GuiStyleProperty, T).- Parameters:
declarations- declaration callback- Returns:
- this component
-
removeInlineStyle
Removes an authored modern inline override so stylesheets and component defaults can supply this property again. The legacy fluent value remains the component default; token subscriptions owned by the override are released. Removing an absent override is an inexpensive no-op.- Parameters:
property- property whose inline declaration should be removed- Returns:
- this component
-
transitionAll
-
transitionAll
-
transitionAll
public T transitionAll(double durationSeconds, double delaySeconds, GuiEasing easing, GuiTransitionBehavior behavior) Transitions every modern property, optionally including discrete values.- Parameters:
durationSeconds- duration in secondsdelaySeconds- non-negative delayeasing- timing functionbehavior- discrete transition policy- Returns:
- this component
-
transition
public T transition(double durationSeconds, double delaySeconds, GuiEasing easing, GuiTransitionBehavior behavior, GuiStyleProperty<?>... properties) Transitions selected typed modern properties.- Parameters:
durationSeconds- duration in secondsdelaySeconds- non-negative delayeasing- timing functionbehavior- discrete transition policyproperties- modern properties- Returns:
- this component
-
transition
public T transition(double durationSeconds, GuiEasing easing, GuiTransitionBehavior behavior, GuiStyleProperty<?>... properties) -
startingStyle
Defines typed values used when this component first enters the styled tree.- Parameters:
declarations- starting declaration callback- Returns:
- this component
-
transition
-
transition
public T transition(double durationSeconds, double delaySeconds, GuiEasing easing, GuiProperty<?>... properties) -
transition
-
transition
public T transition(double durationSeconds, double delaySeconds, GuiEasing easing, GuiPropertyGroup... groups) -
hovered
-
pressed
-
focused
-
disabled
-
animation
-
play
-
pause
-
resume
Resumes a paused animation, excluding the complete pause interval even when frames reused the held sample. Completed finite animations retain their fill; useplay(String)to restart them.- Parameters:
name- animation name- Returns:
- this component
-
cancel
Cancels a named animation and schedules reevaluation of its underlying geometry and paint on the next frame. Configured property transitions keep their normal timing when keyframes release ownership, so restoration need not snap immediately. Unknown or already inactive names do not invalidate a prepared component.- Parameters:
name- animation name- Returns:
- this component
-
id
Assigns this component's optional stable identifier.The identifier is visible to typed ID selectors, retained-tree lookup, devtools, and view-transition pairing. Recreating a component with the same ID morphs it from the old bounds to the new bounds. A
nullor blank value removes the identifier.- Parameters:
id- stable identifier, ornull- Returns:
- this component
-
id
Returns this component's optional stable identifier.- Returns:
- identifier, or
null
-
findById
Finds the uniquely identified component in this retained subtree.The search includes this component. Duplicate IDs are rejected because lookup and morph-transition ownership would otherwise be ambiguous.
- Parameters:
id- identifier to find- Returns:
- matching component, when present
- Throws:
IllegalStateException- when the subtree contains the ID more than once
-
findById
Finds and type-checks a uniquely identified component in this retained subtree.- Type Parameters:
C- component type- Parameters:
id- identifier to findcomponentType- required component type- Returns:
- matching typed component, when present
- Throws:
IllegalStateException- when the ID is duplicatedClassCastException- when the matching component has another type
-
viewTransitionName
Assigns the stable name used to pair this component's old and new view-transition snapshots. This overrides the componentIDfor transition pairing. Anullor blank name returns pairing to retained identity or ID.- Parameters:
name- transition name- Returns:
- this component
-
viewTransitionName
Returns this component's explicit view-transition name.- Returns:
- transition name, or
null
-
styleClass
-
removeStyleClass
-
styleClasses
-
styleAttribute
Sets a typed selector-visible component attribute.- Type Parameters:
V- value type- Parameters:
attribute- attribute keyvalue- value, ornullto remove- Returns:
- this component
-
styleAttribute
Reads a typed style attribute.- Type Parameters:
V- value type- Parameters:
attribute- attribute key- Returns:
- value when present
-
styleState
Sets an explicit standard pseudo-class value.Use this for semantic states such as checked, required, valid, or open. Pointer, focus, enabled, root, empty, and structural states are maintained by the runtime.
- Parameters:
pseudoClass- pseudo-classactive- active flag- Returns:
- this component
-
styleState
-
stateProvider
Adds a dynamic state provider.- Parameters:
provider- provider- Returns:
- this component
-
x
-
y
-
position
-
translateX
-
translateY
-
translate
-
width
-
height
-
size
-
autoWidth
-
autoHeight
-
autoSize
-
width
-
height
-
size
-
minWidth
-
maxWidth
-
minHeight
-
maxHeight
-
boxSizing
-
aspectRatio
-
display
-
defaultDisplay
Defines the formatting role supplied by a component type before authored styles and fluent inline declarations are applied.This is intended for component constructors. Calling
display(GuiDisplay)after construction still creates the higher-priority inline declaration.- Parameters:
display- default formatting role
-
defineModernDefaults
Adds stylesheet-overridable defaults for this component type.Fluent setters, including calls made by constructors, are inline declarations. Subclasses should override this hook when a value is a component default rather than an authored inline value.
- Parameters:
defaults- builder receiving component defaults
-
invalidateModernDefaults
protected final void invalidateModernDefaults()Invalidates cached declarations after state used bydefineModernDefaults(GuiStyleBuilder)changes. -
listStyleType
Selects the list counter style used by an automatic::marker.- Parameters:
style- counter style- Returns:
- this component
-
listStylePosition
Places the automatic marker inside the first line or in an outside marker column.- Parameters:
position- marker position- Returns:
- this component
-
listStyleImage
Replaces the automatic text marker with an explicitly sized image.- Parameters:
image- marker image, ornullfor generated counter text- Returns:
- this component
-
markerSide
Selects which writing direction determines the outside marker side.- Parameters:
side- marker-side policy- Returns:
- this component
-
markerGap
Sets the space between an outside marker and the principal box.- Parameters:
gap- non-negative design-space gap- Returns:
- this component
-
quotes
Selects generated open/close quote pairs.- Parameters:
quotes- quote pairs- Returns:
- this component
-
scrollMargin
Sets the target's snap-area expansion.- Parameters:
margin- scroll margin- Returns:
- this component
-
scrollMargin
Sets a uniform snap-area expansion.- Parameters:
all- margin on every side- Returns:
- this component
-
scrollSnapStop
Selects whether a snap operation may pass this target.- Parameters:
stop- stop policy- Returns:
- this component
-
position
-
inset
-
inset
-
verticalAlign
-
flexDirection
-
flexWrap
-
flexGrow
-
flexShrink
-
flexBasis
-
order
-
justifyContent
-
alignItems
-
alignSelf
-
alignContent
-
rowGap
-
columnGap
-
gridTemplate
-
gridPlacement
-
gridAutoFlow
-
justifyItems
-
justifySelf
-
tableLayout
-
borderCollapse
-
borderSpacing
-
captionSide
-
emptyCells
-
columnCount
-
columnWidth
-
columnFill
-
columnRule
-
columnSpan
-
breakBefore
-
breakAfter
-
breakInside
-
widows
-
orphans
-
marginBreak
-
pageName
-
anchorName
-
anchorPlacement
-
anchor
-
centered
-
zIndex
-
tabIndex
Sets this component's sequential keyboard-focus order.Positive values are visited first in ascending order, zero follows retained-tree order, and negative values opt out of Tab traversal while preserving mouse and programmatic focus.
- Parameters:
tabIndex- sequential focus index- Returns:
- this component
-
tabIndex
public int tabIndex()Returns this component's sequential focus index.- Returns:
- focus index
-
writeModernInline
-
invalidateModernLayout
-
styleOpen
protected boolean styleOpen()Allows controls with retained popup/expansion state to implement:open. -
self
-
renderChildren
protected final void renderChildren(com.render.api.gui.GuiRenderContext context)
-