LayerScope

sealed interface LayerScope

The receiver of a Layer's content, through which GlassPane declares the layer's glass pane.

A layer holds its view, the child that names no region, as new JLayer(view) holds it, and the glass pane painted over that view, which is a composable of this scope because the pane is the layer's own: the declaration configures it and fills it with content.

Layer(
onPaint = { g, width, height, paintView ->
paintView()
g.paint = veil
g.fillRect(0, 0, width, height)
},
) {
Table(model = rows)
if (busy) {
GlassPane(PanelLayout.Border()) { ProgressBar(value = 0, indeterminate = true) }
}
}

A layer holds nothing besides the view and the glass pane, and each shows one component, so two children that name no region, or two glass pane declarations, are refused. A view that goes away clears the view, and a glass pane declaration that goes away hides the layer's pane again.

See also

Functions

Link copied to clipboard
@Composable
abstract fun GlassPane(modifier: SwingModifier = SwingModifier, content: @Composable PanelScope.() -> Unit)

Shows the layer's own glass pane over the view, holding content under the pane's own FlowLayout: a PanelLayout.Flow with its defaults.

@Composable
abstract fun <S : PanelScope> GlassPane(layout: PanelLayout<S>, modifier: SwingModifier = SwingModifier, content: @Composable S.() -> Unit)

Shows the layer's own glass pane over the view, holding content under layout.