Class Separator
Theme.outline color. A
horizontal separator stretches across the available width (with a thin height);
a vertical one stretches down the available height (thin width). Use it to
divide groups in a Column/Row or inside a ToolBar.
Size axis
Separator participates by inheritance only and exposes no size setter: what a reader perceives is a 1 pt hairline, pixel-locked at everyControlSize step. Only the
box around the line moves. A "large separator" is either the same line with more air
(the container's job) or a thicker rule, which is a different visual element.
The box is odd at every step on purpose: a 1 pt line can only sit exactly
centred inside an odd box, and the snap relies on that parity. setInset(float) is the one
dimension a caller controls.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic SeparatorA rule stretching across the available width.protected voidPublishes this rule as oneAccessible.Role.SEPARATORnode carrying exactly one orientation bit and nothing else.protected SizeonMeasure(Constraints constraints) Reports the size this widget wants withinconstraints.protected voidWidget's own background/content, in local coordinates.setInset(float margin) Trimsmarginpoints off both ends of the line.static Separatorvertical()A rule stretching down the available height.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, onAccessibilityAction, onAccessibilityChild, onAccessibilityChildAction, onAccessibilityChildIdentity, onAttached, onCanEdit, onCharTyped, onDetached, onDragExit, onDragOver, onDragStart, onDrop, onEdit, onFocusGained, onFocusLost, onHitTest, onKeyEvent, onLayout, onMouseEvent, onPaintOverlay, onPreedit, onSyntheticAction, overlayPassesPointer, paintChildren, paintOutset, 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
-
Method Details
-
horizontal
A rule stretching across the available width. -
vertical
A rule stretching down the available height. -
setInset
Trimsmarginpoints off both ends of the line. -
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. -
onPaint
Description copied from class:WidgetWidget's own background/content, in local coordinates. -
onAccessibility
Publishes this rule as oneAccessible.Role.SEPARATORnode carrying exactly one orientation bit and nothing else.The role is the whole announcement, and it is the reason the widget describes itself at all: a rule between groups of items is information a reader needs to hear, and a leaf that paints, declares nothing and is deleted by the walk is warned about once per class, in every application that draws one. No name is declared on purpose. The widget holds no string, a declared name would be spoken on top of the role, and the two ways a rule does get one stay where they belong: a tooltip through the walk's free default, or the application through
setAccessibleName. Striking a purely decorative rule out is likewise the application's call throughsetAccessibleIgnored(true), never this class's.The orientation is read from the field the factory fixed at construction and never inferred from the laid-out box.
Accessible.Statedefines the pair by the axis a node's value runs along; a separator has no value, so the bit names the axis the rule runs along, which is also the picture. The two cannot come apart here the way they do on a splitter's divider, so no inversion applies and a bridge maps the bit straight onto the platform's orientation. Inferring it from width against height would tie the fact to layout and lie whenever a parent squeezes the box: a horizontal rule handed a tight, tall constraint would announce as vertical.The published box is the widget's own,
separatorBoxthick on the cross axis, not the hairline:setInset(float)trims ink only and changes nothing a reader is told. Two primitive writes and no string, so a damaged frame that changed nothing costs no memory.- Overrides:
onAccessibilityin classWidget<Separator>- Parameters:
a- the node being described; write into it, and never keep it
-