Class Padding
- Direct Known Subclasses:
BackdropPanel,TokenPadding
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.
Like every layout, it declares how far its child may paint past it; see
paintOverflow(float). By default that is the reach of the theme's focus ring less the
narrowest of the four insets, and never below zero: a ring that fits inside the insets reaches
nothing past the padding, so a padded panel declares nothing and its repaints stay inside it,
while a padding of nothing declares the whole reach, as any other wrapper does.
-
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.protected floatWhatpaintOverflow(float)declared; else nothing when a subclass clips the child, whose clip bounds it; else the reach of the focus ring in the theme in effect for this padding, less the narrowest inset, never below zero.paintOverflow(float points) Declares how far the child may paint past this padding's box, in logical points, in place of the default, which is the reach of the theme's focus ring less the narrowest inset.Goes back to declaring what is left of the theme's focus ring reach past the insets, which is the default; seepaintOverflow(float).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, accessibleLabelAccessKey, accessibleLabelTarget, accessibleLabelText, add, add, announceChange, backdropReach, baselineOffset, baselineOffsetOf, caretRect, children, clipboard, clipHeight, clipsChildren, clipWidth, clipX, clipY, controlSize, cursor, declaredControlSize, declaredLayoutDirection, declaredLocale, focusArrivedBackward, focusArrivedByTraversal, handleUserChange, height, hitTest, hitTestChild, id, imageCursor, inheritanceHost, invalidate, invalidate, invalidateAccessible, isEnabled, isFocusable, isFocused, isRightToLeft, isSelfEnabled, isShowing, isVisible, isVisibleByItsOwnFlag, layoutBox, layoutDirection, locale, localToScene, localToSceneBounds, markNeedsContainedLayout, markNeedsLayout, markNeedsLayoutInPlace, maxHeight, maxWidth, measure, minHeight, minWidth, moveChild, moveChild, moveChild, neutralBase, notifyChange, notifyTextEdit, observeChanges, onAccessibility, onAccessibilityAction, onAccessibilityChild, onAccessibilityChildAction, onAccessibilityChildIdentity, onAttached, onCanEdit, onCharTyped, onDetached, onDragExit, onDragOver, onDragStart, onDrop, onEdit, onFocusGained, onFocusLost, onHitTest, onKeyEvent, onMouseEvent, onPaint, onPaintOverlay, onPreedit, onSyntheticAction, overlayPassesPointer, paintChildren, paintsDecoration, paintsFromBackdrop, paintWidget, parent, remove, remove, requestFocus, requestFocus, revealInView, revealInView, runHandler, scene, sceneNanos, sceneToLocal, self, setAccessibleDescribedBy, setAccessibleDescription, setAccessibleDescription, setAccessibleIgnored, setAccessibleLabelledBy, setAccessibleName, setAccessibleName, setAccessibleRole, setControlSize, setCursor, setEnabled, setFocusable, setId, setImageCursor, setInheritanceHost, setLayoutDirection, setLocale, setMaxHeight, setMaxWidth, setMinHeight, setMinWidth, setPresentedElsewhere, setTooltip, setTooltip, setVisible, shapeText, textRuler, tooltip, tooltipSource, 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). -
paintOverflow
Declares how far the child may paint past this padding's box, in logical points, in place of the default, which is the reach of the theme's focus ring less the narrowest inset. It is whatContainer.paintOverflow(float)is to a container, for the one child here: the public setter ofpaintOutset(), taken as given whatever the insets are, and a new declaration repaints this padding and its band while one already in force repaints nothing. UI thread only.- Parameters:
points- how far the child may paint past each side of this box, in logical points- Returns:
- this padding
- Throws:
IllegalArgumentException- when negative,NaNor infinite
-
paintOverflowFromTheme
Goes back to declaring what is left of the theme's focus ring reach past the insets, which is the default; seepaintOverflow(float). UI thread only.- Returns:
- this padding
-
paintOutset
protected float paintOutset()WhatpaintOverflow(float)declared; else nothing when a subclass clips the child, whose clip bounds it; else the reach of the focus ring in the theme in effect for this padding, less the narrowest inset, never below zero. The child's box is this box less the insets, so that is what of the reach is left past this box on its closest side. O(1) and allocation-free.- Overrides:
paintOutsetin classWidget<Padding>
-
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).
-