Package limn.scene.layout
Class Padding
java.lang.Object
limn.scene.Widget
limn.scene.layout.Padding
- Direct Known Subclasses:
BackdropPanel,TokenPadding
Wraps one child with edge insets.
Not final: a container that derives its insets from resolved
ControlSize tokens subclasses this and pushes them from its own measure
path. Without that, a size step would compact the controls and leave the page padding
around them at whatever literal the app typed, and the spacing ramp is the widest of the
three.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic PaddingThe same inset on all four sides.final Insetsinsets()The current insets.protected voidonLayout()Containers position children here (measure +Widget.layoutBox(float, float, float, float)per child).protected SizeonMeasure(Constraints constraints) Reports the size this widget wants withinconstraints.final voidReplaces the insets, with an equality guard.protected final voidsetInsetsSilently(Insets newInsets) Assigns the insets without requesting a layout pass: the measure-path form, for a subclass that derives them from resolved size tokens inside its ownonMeasure.Methods inherited from class limn.scene.Widget
acceptsTextInput, add, baselineOffset, baselineOffsetOf, caretRect, children, clipboard, clipsChildren, controlSize, cursor, declaredControlSize, declaredLayoutDirection, declaredLocale, focusArrivedByTraversal, height, hitTest, imageCursor, invalidate, invalidate, isEnabled, isFocusable, isFocused, isShowing, isVisible, layoutBox, layoutDirection, locale, localToSceneX, localToSceneY, markNeedsContainedLayout, markNeedsLayout, measure, moveChild, neutralBase, onAttached, onCharTyped, onDetached, onFileDrop, onFocusGained, onFocusLost, onKeyEvent, onMouseEvent, onPaint, onPaintOverlay, onPreedit, overlayPassesPointer, paintChildren, paintOutset, paintWidget, parent, remove, requestFocus, revealInView, scene, sceneToLocalX, sceneToLocalY, setControlSize, setCursor, setEnabled, setFocusable, setImageCursor, setInheritanceHost, setLayoutDirection, setLocale, setTooltip, setTooltip, setVisible, shapeText, textRuler, tooltip, width, x, y
-
Constructor Details
-
Padding
Insetschildon each side; the padding is inside this widget's own box.
-
-
Method Details
-
all
The same inset on all four sides. -
insets
The current insets. -
setInsets
Replaces the insets, with an equality guard. Without the guard, a token-driven subclass that re-applies its insets on every measure pass callsWidget.markNeedsLayout()from insideonMeasure, which dirties the path to the root and schedules another pass: a layout loop that never settles. -
setInsetsSilently
Assigns the insets without requesting a layout pass: the measure-path form, for a subclass that derives them from resolved size tokens inside its ownonMeasure. Safe there and only there: the caller is already inside the pass that will consume the new value, so requesting another one is at best wasteful and at worst non-terminating. Everything else usessetInsets(limn.scene.Insets). -
onMeasure
Description copied from class:WidgetReports the size this widget wants withinconstraints. Called once per layout pass, and the result is cached against the constraints and the resolved axes (size step, layout direction, locale), so it must be a pure function of them and of this widget's own state.Resolve the
ControlSizeand theLayoutDirectiononce each here and thread them down; never read either in a constructor. The locale needs no threading: it is in scope, andI18n.locale()answers it wherever text is resolved. -
onLayout
protected void onLayout()Description copied from class:WidgetContainers position children here (measure +Widget.layoutBox(float, float, float, float)per child).
-