Package-level declarations
Types
The standard alignments unaware of ComponentOrientation: a horizontal bias of -1 always resolves to the left and 1 to the right, neither mirrored under a right-to-left orientation the way Alignment's own constants are.
Where a child sits within the extent its container offers it: an Alignment places a child across both axes of a Box, an Alignment.Horizontal across a Column, an Alignment.Vertical across a Row.
An offset line a measured layout exposes to its parent for alignment.
Places a child according to horizontal and vertical biases without mirroring under a right-to-left component orientation.
Places a child at a bias through the space it leaves free: -1 at the leading edge, 0 centered, 1 at the trailing edge, and any other value proportionally, which puts a bias outside -1..1 partly or wholly outside that space. A right-to-left orientation mirrors the horizontal bias.
The receiver of a Box's content, through which a child declares its own placement in that box.
The receiver of a Column's content, through which a child declares its own placement in that column.
A component that reports what extent it takes under given constraints, and its intrinsic sizes at a given extent.
The scope of a container whose child stands between the constraints that container offers it and its own measurement: a fill, a padding, an offset, an aspect ratio or a default minimum size each narrows what reaches the child, states what the child plus its own space occupies, and places the child inside that.
The extents a parent offers a child: the least it must occupy along each axis and the most it may.
A line whose position is measured from the top or bottom edge, such as a text baseline.
A child as a MeasurePolicy asks about its unconstrained, axis-specific dimensions.
The receiver of a MeasurePolicy's four intrinsic measurement functions.
Which of a child's two intrinsic answers an intrinsic size modifier uses.
The node a LayoutModifierNodeElement creates once per slot and keeps for as long as an element of that type fills it.
A layout modifier: declares a LayoutModifierNode that measures one child between the constraints its parent offers and the result it reports back, and keeps its state across passes, such as an animation mid-flight. A child declares one through ConstrainedScope.layout.
A stable token for parent data a Layout policy reads through Measurable.parentData.
One child of a container that can answer both intrinsic and constrained measurement questions.
How a container measures and places its children.
What a MeasurePolicy settled on: the raw extent the container measured itself to, and where its children go in it.
The receiver a MeasurePolicy or a LayoutModifierNode measures in, and the one way it answers.
Which part of a component's getInsets() is paint outsets: space it paints past its layout box, such as a focus ring or a shadow. A Foundation parent leaves them out of the layout box; a Swing parent clips the part that is the component's decoration. A component that is not a JComponent is never asked about, and keeps its layout box under every value. Declare it as a top-level object or a class with equals: a value that is unequal on each recomposition measures the whole subtree again every pass.
The properties of the layer PlacementScope.placeWithLayer places a child with, which its layerBlock sets, as androidx's GraphicsLayerScope does for a graphics layer.
The receiver a MeasureResult places its children in, from a MeasurePolicy or a LayoutModifierNode.
The receiver of a Row's content, through which a child declares its own placement in that row.
A line whose position is measured from the left or right edge.
Properties
Key for the default PaintOutsets value applied to descendants via paintOutsets.
The baseline of a child's first line of text: where java.awt.Component.getBaseline puts it, or where a MeasurePolicy or a LayoutModifierNode names it in MeasureResult.alignmentLines.
The capability every Foundation LayoutModifierNodeElement uses.
Functions
fun SwingModifier.absoluteOffset(x: Int = 0, y: Int = 0): SwingModifier
fun SwingModifier.absolutePadding(left: Int = 0, top: Int = 0, right: Int = 0, bottom: Int = 0): SwingModifier
fun SwingModifier.aspectRatio(@FloatRange(from = 0.0,
Sizes the child to ratio width per unit height, taking the size from the greatest width its incoming constraints allow, then the greatest height, then the least width and the least height, and stopping at the first of those that satisfies both the constraints and the ratio. Where none of them does, the constraints are not respected: the child takes the size the first of those extents that names a size at all implies at the ratio, and only where none of them names one is the child measured under the incoming constraints unchanged.
A box with no content that can participate in layout, drawing, and input through its modifier.
A composable that stacks its content in one place, one child over another.
Clips the child's paint, and its descendants', to the box the modifiers after this one report for it, even where a modifier further along places something larger, such as a size transition mid-flight. A decoration declared before it is not clipped, and one declared after it is.
A composable that arranges its content vertically, top to bottom.
Takes a size and returns the closest size to it that satisfies the constraints.
Takes otherConstraints and returns the result of coercing them in the current constraints. Note this means that any size satisfying the resulting constraints will satisfy the current constraints, but they might not satisfy the otherConstraints when the two set of constraints are disjoint. Examples (showing only width, height works the same): (minWidth=2, maxWidth=10).constrain(minWidth=7, maxWidth=12) -> (minWidth = 7, maxWidth = 10) (minWidth=2, maxWidth=10).constrain(minWidth=11, maxWidth=12) -> (minWidth=10, maxWidth=10) (minWidth=2, maxWidth=10).constrain(minWidth=5, maxWidth=7) -> (minWidth=5, maxWidth=7)
Takes a height and returns the closest size to it that satisfies the constraints.
Takes a width and returns the closest size to it that satisfies the constraints.
fun SwingModifier.defaultMinSize(minWidth: Int? = null, minHeight: Int? = null): SwingModifier
Raises the child's minimum size to minWidth by minHeight along whichever axis its incoming constraints leave a minimum of zero on. An axis already claiming a minimum is left as it is, and the minimum raised to is held between nothing and the space the child was offered, so a child in a container smaller than the minimum takes the container.
fun SwingModifier.fillMaxHeight(@FloatRange(from = 0.0,
Makes the child occupy fraction of the greatest bounded height its parent offers it. The result is held between the offered minimum and maximum height. An unbounded height is left unchanged.
fun SwingModifier.fillMaxSize(@FloatRange(from = 0.0,
Makes the child occupy fraction of the greatest bounded width and height its parent offers it. Each result is held between the offered minimum and maximum. Either unbounded axis is left unchanged.
fun SwingModifier.fillMaxWidth(@FloatRange(from = 0.0,
Makes the child occupy fraction of the greatest bounded width its parent offers it. The result is held between the offered minimum and maximum width. An unbounded width is left unchanged.
Prefers an exact height, while still allowing the constraints the parent offers to override it.
fun SwingModifier.height(intrinsicSize: IntrinsicSize): SwingModifier
Prefers the child's intrinsicSize height, while still allowing the constraints the parent offers to override it.
fun SwingModifier.heightIn(min: Int? = null, max: Int? = null): SwingModifier
Takes a size and returns whether it satisfies the current constraints.
A composable that measures and places its content by a MeasurePolicy of your own: a container whose placement rules you write, with no LayoutManager to go with them.
fun SwingModifier.layout(measure: MeasureScope.(measurable: Measurable, constraints: Constraints) -> MeasureResult): SwingModifier
Measures and places the child with measure, a layout modifier written as a lambda: measure measures the child's measurable under the constraints it is handed, and answers with MeasureScope.layout.
Creates a stable token for parent data a Layout policy reads through Measurable.parentData.
Moves the child by (x, y) from where it would otherwise sit, neither axis moved by default, without changing the space it measures into. A positive x moves the child toward the trailing edge: right under a left-to-right reading order and left under a right-to-left one. See absoluteOffset for an offset that always moves it toward the right.
Returns the Constraints obtained by offsetting the current instance with the given values.
Runs onPlaced with the bounds the component occupies in its parent whenever those bounds change.
Runs onSizeChanged with the extent the component occupies whenever its size changes.
Reserves all along every edge of the child. A decoration declared before a padding paints over the space it reserves as well, as paint outsets: background(brush).padding(8) fills the child and the space around it.
fun SwingModifier.padding(horizontal: Int = 0, vertical: Int = 0): SwingModifier
Reserves horizontal before and after the child along the reading order, and vertical above and below it, either pair left unreserved by default.
fun SwingModifier.padding(start: Int = 0, top: Int = 0, end: Int = 0, bottom: Int = 0): SwingModifier
The same amount on every side, clamped to the insets; as emptyBorder(all).
A fixed amount, clamped per side to the insets; the order of emptyBorder(top, left, bottom, right).
Declares which part of this component's insets is paint outsets; see PaintOutsets. Under a Swing parent it changes only what a Decoratable reports and clips.
Requires an exact height, even where it is outside the constraints the parent offers.
fun SwingModifier.requiredHeight(intrinsicSize: IntrinsicSize): SwingModifier
Requires the child's intrinsicSize height, even where it is outside the constraints the parent offers.
fun SwingModifier.requiredHeightIn(min: Int? = null, max: Int? = null): SwingModifier
Requires a height inside the bounds named here, with either bound absent when it is null.
Requires an exact square size, even where it is outside the constraints the parent offers.
fun SwingModifier.requiredSize(width: Int, height: Int): SwingModifier
fun SwingModifier.requiredSizeIn(minWidth: Int? = null, minHeight: Int? = null, maxWidth: Int? = null, maxHeight: Int? = null): SwingModifier
Requires a size inside the bounds named here, with any null bound absent.
Requires an exact width, even where it is outside the constraints the parent offers.
fun SwingModifier.requiredWidth(intrinsicSize: IntrinsicSize): SwingModifier
Requires the child's intrinsicSize width, even where it is outside the constraints the parent offers.
fun SwingModifier.requiredWidthIn(min: Int? = null, max: Int? = null): SwingModifier
Requires a width inside the bounds named here, with either bound absent when it is null.
A composable that arranges its content horizontally, along the panel's reading order.
Prefers an exact square size, while still allowing the constraints the parent offers to override it.
fun SwingModifier.sizeIn(minWidth: Int? = null, minHeight: Int? = null, maxWidth: Int? = null, maxHeight: Int? = null): SwingModifier
Prefers a size inside the bounds named here, with any null bound absent. The constraints the parent offers still take precedence.
Prefers an exact width, while still allowing the constraints the parent offers to override it.
fun SwingModifier.width(intrinsicSize: IntrinsicSize): SwingModifier
Prefers the child's intrinsicSize width, while still allowing the constraints the parent offers to override it.
fun SwingModifier.widthIn(min: Int? = null, max: Int? = null): SwingModifier
fun SwingModifier.wrapContentHeight(align: Alignment.Vertical = Alignment.CenterVertically, unbounded: Boolean = false): SwingModifier
fun SwingModifier.wrapContentSize(align: Alignment = Alignment.Center, unbounded: Boolean = false): SwingModifier
fun SwingModifier.wrapContentWidth(align: Alignment.Horizontal = Alignment.CenterHorizontally, unbounded: Boolean = false): SwingModifier
Places the child at zIndex in its container's paint and hit-testing order: a child with a larger value paints over, and receives a mouse event before, every sibling with a smaller one. Siblings with the same value keep the order they are declared in, the last on top, whatever order their container places them in. A child declaring none is at 0f.