Border

class Border(val hgap: Int = 0, val vgap: Int = 0) : PanelLayout<BorderPanelScope>

Places each child in the region that child names: the four edges and the center. An edge child keeps the thickness it prefers and spans its edge, and the center child takes whatever the edges leave.

A child names its region on its own modifier, through BorderPanelScope:

Panel(PanelLayout.Border()) {
Toolbar(modifier = SwingModifier.north())
Editor()
StatusBar(modifier = SwingModifier.south())
}

A child that names no region occupies the center, so the panel's main content is written plainly.

A region hosts one child: dropping a child (e.g. behind an if) empties the region it occupied, and an edge no child names holds nothing.

See also

Constructors

Link copied to clipboard
constructor(hgap: Int = 0, vgap: Int = 0)

Properties

Link copied to clipboard

the scope the container's content is composed in

Link copied to clipboard
val hgap: Int

the horizontal gap between regions; 0 by default, so they touch

Link copied to clipboard
val vgap: Int

the vertical gap between regions; 0 by default, so they touch

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun <C : Container> installOn(updater: SwingNodeUpdater<C>)

Lays the container out under this layout. An implementation makes one write on updater through installManager.