Package-level declarations
Types
The scope of a style for any component; every component's own style scope extends it. A style runs when the component is applied, never in composition. A snapshot state it reads runs it again when that state changes.
What a style can do on a container: set Component and JComponent properties and provide nested styles to the components below it. SwingModifier.styleable { ... } without a SwingStyleKind gives this scope, so it is the way to style a composable that does not take a style parameter.
Identifies the styles an ancestor provides for descendants of one kind. Identity is the instance.
The scope of a component that holds children, which may provide a nested style that a styleable descendant component reads and applies.
The properties of a JComponent. A third-party JComponent builds its own scope on this one, or on a narrower one, so every setter declared here works in its style too.
How a component kind is styled: how its scope is built and what its default style does. Declare one per component kind, as a top-level val. A style of this kind runs against the scope S, which the kind builds over the state T the component feeds it, Unit for a kind without state.
A DslMarker used to ensure that a member of an outer style scope does not resolve inside a nested block. Applied to every style scope.
Defines a style property whose value can be provided within a style scope. Its type names only the value; the component it applies to is checked when the style is applied.
The base interface for all style scopes, and the receiver of every style.
Properties
Functions
Sets the component's accessible description - a longer localized explanation assistive technologies can read after the name. null clears any description this style set.
Sets the component's accessible name - the short localized string assistive technologies announce for it. null clears any name this style set. Mirrors AndroidX's semantics { contentDescription = ... }.
Sets the horizontal alignment along the x axis, where 0.0 aligns to the left, 0.5 centers, and 1.0 aligns to the right. A parent that honors alignment - a vertical BoxLayout - lines its children up by this value, so siblings given the same alignment stay in one column.
Sets the vertical alignment along the y axis, where 0.0 aligns to the top, 0.5 centers, and 1.0 aligns to the bottom. A parent that honors alignment - a horizontal BoxLayout - lines its children up by this value, so siblings given the same alignment stay on one row.
Sets background; on a non-opaque component also set opaque to true for it to paint.
Sets the component's border. null removes it.
Sets componentOrientation - the component's left-to-right / right-to-left orientation.
Sets cursor; null restores the inherited cursor.
Sets an invisible border occupying insets. See emptyBorder (the four-side form).
Sets an invisible border of all on every side. See emptyBorder (the four-side form).
Sets an invisible border with the specified space on each side. margin is the space a button or text component keeps inside its border. See border for precedence and restoration.
Sets isEnabled on this component only, controlling whether it responds to user input and paints in its enabled state. To disable descendants, use provideNestedStyle(AllComponents) { enabled(false) } on a container. The provided style does not disable the container itself, and a descendant's own enabled(true) overrides it.
Sets isFocusable, declaring whether this component can receive keyboard focus.
Sets font; null takes the font from the parent container.
Sets foreground; null takes the color from the parent container.
Sets maximumSize and relays out; null restores the layout-computed maximum size.
Sets maximumSize to Dimension(width, height) and relays out.
Sets minimumSize and relays out; null restores the layout-computed minimum size.
Sets minimumSize to Dimension(width, height) and relays out.
A kind whose default only applies nested styles, such as applyNestedStyle(key). With no style of its own and no publishing ancestor, a component of this kind runs no default and holds no style resolution.
Sets isOpaque - required for background to actually paint.
Sets preferredSize and relays out; null restores the layout-computed preferred size.
Sets preferredSize to Dimension(width, height) and relays out.
Sets the component's actual size to size, like setSize. See size (the Int overload) for when this takes effect and how size/width/height compose.
Sets the component's actual size to width by height, like setSize. A layout manager overrides this on its next layout pass, so it takes effect for components positioned by themselves - those in a null layout or a JLayeredPane. To influence a managed layout, use preferredSize, minimumSize, or maximumSize instead.
Declares style as the component's style. The style can set every java.awt.Component and JComponent property and provide nested styles to the components below. Put it last in the modifier.
Local style properties inherit their values down the component hierarchy. As stylePropertyOf, for a property a descendant inherits: a styled descendant that sets no value takes the value of the nearest styled ancestor that set one, where descriptor handles the descendant's class. An ancestor that sets null stops the inheritance; its descendants keep their own value. This holds for a nullable style local, since a non-null one such as componentOrientation cannot be set to null. Locals with the same descriptor name share one property; the last declaration wins for the component and its descendants.
Creates a style property whose value is applied by a custom element. A declaration replaces an earlier one with the same key. The element's equality, target constraints and restoration behavior apply as in a modifier. A style writes its descriptor-backed properties before its custom elements. Each group follows declaration order.
Creates a style property with the restore and rewrite options of SwingModifier.property. A style property and a modifier property with the same descriptor name share the original value to restore.
Sets the tooltip for the pointer's location. text returns null where no tooltip is available.
Sets the tooltip for the whole component. null clears it.
Whether the inputVerifier of the component that currently holds the keyboard is consulted before focus moves to this component. Swing's own value is true; set false on a control that must act regardless of what the focused field holds, such as a Cancel button or a scrollbar.
Sets isVisible - whether the component is shown in its parent's layout.