RootLayer
is useful to lock some user controls at once. It is a pane which will be installed on
the top of the RootPane
while covering the specified owner Node
. The layer has a translucent
background color by default and can be styled either with it's CSS class .root-layer
or directly by calling
setStyle(...)
. By default clipping is enabled so child controls can not exceed the bounds of it's owner.
Child controls have to be added to the content pane. In the example below userFormPane
is the owner.
RootLayer layer = new RootLayer(userFormPane);
//layer.setStyle("-fx-background-color: #0080FF17");
ProgressIndicator indicator = new ProgressIndicator();
layer.getContent().getChildren().add(indicator);
...
The layer can be activated by calling RootLayer#install()
and removed by calling RootLayer#uninstall()
RootLayer layer = new RootLayer(userFormPane);
layer.getContent().getChildren().add(new ProgressIndicator());
layer.install();
...
In SyntheticaFX a RootLayer
is used for internal dialogs and to display decorator nodes for validation.