Class ControlsFXAtlantaFX
ControlsFX controls define their own user-agent stylesheets that use Modena-derived CSS variables. When an application switches to an AtlantaFX theme those controls keep their Modena look. This utility loads a companion stylesheet that overrides the ControlsFX control rules with AtlantaFX CSS custom properties, so every control blends in with the active AtlantaFX theme.
Typical usage:
// 1. Apply the AtlantaFX theme globally (before showing the stage)
Application.setUserAgentStylesheet(new PrimerLight().getUserAgentStylesheet());
// 2. Apply the ControlsFX companion stylesheet to the scene
ControlsFXAtlantaFX.applyTo(scene);
The companion stylesheet references AtlantaFX CSS looked-up color
variables (e.g. -color-fg-default, -color-bg-subtle,
-color-accent-emphasis) which must be present on the .root
node. If no AtlantaFX theme is active those variables are undefined and the
controls will fall back to the JavaFX default behavior.
This module has no compile or runtime dependency on the AtlantaFX library itself; it only ships CSS that consumes AtlantaFX variables.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic voidapplyTo(javafx.scene.Parent parent) Adds the ControlsFX AtlantaFX companion stylesheet to the given parent node's stylesheet list.static voidapplyTo(javafx.scene.Scene scene) Adds the ControlsFX AtlantaFX companion stylesheet to the given scene's stylesheet list.
-
Field Details
-
STYLESHEET
-
-
Method Details
-
applyTo
public static void applyTo(javafx.scene.Scene scene) Adds the ControlsFX AtlantaFX companion stylesheet to the given scene's stylesheet list.- Parameters:
scene- the scene to apply the companion stylesheet to
-
applyTo
public static void applyTo(javafx.scene.Parent parent) Adds the ControlsFX AtlantaFX companion stylesheet to the given parent node's stylesheet list. Use this overload when the scene is not yet available or when the styles should be scoped to a sub-tree.- Parameters:
parent- the parent node to apply the companion stylesheet to
-