ColumnScope
The receiver of a Column's content, through which a child declares its own placement in that column.
Children are written plainly; what a child declares here rides along on its modifier:
Column {
Label(text = "Title")
Panel(PanelLayout.Flow(), modifier = SwingModifier.weight(1f)) { Body() }
Button(text = "Close", onClick = ::close, modifier = SwingModifier.align(Alignment.End))
}Functions
Places the child at alignment across the column's width, in place of the column's own horizontalAlignment.
As alignBy(alignmentLine), with the line alignmentLineBlock works out from the measured child.
Places the child across the column's width so that its alignmentLine falls on the line it shares with every sibling also declaring alignBy. This is a form of align and stands in the same place on the modifier chain, so of the two the last one declared places the child. Within a Column, every child declaring alignBy aligns horizontally using the VerticalAlignmentLines it names or the values the other alignBy overload works out, forming a sibling group. At least one child of the group is placed as it would be with Alignment.Start, and the others are placed so that their alignment lines coincide with its line. A child declaring alignBy alone in its Column is placed as it would be with Alignment.Start; a child that provides no such line sits at the column's left edge.
Declares element on the child: the LayoutModifierNode it creates measures the child between the constraints this scope's container offers and the child's own measurement, and places it in the extent it reports.
Claims weight shares of the height the column has left over once every child that claims none has taken the height it prefers. Two children weighted 1f and 2f take a third and two thirds of it. A child with an explicit maximumSize takes no more than that maximum allows; what it leaves stays empty. With fill the child occupies all the height it is granted; otherwise it occupies as much of that height as it prefers and the column's arrangement places the rest.