Class ThemeProperties

java.lang.Object
atlantafx.base.theme.ThemeProperties

public final class ThemeProperties extends Object
A registry for managing properties associated with Theme classes.

This class associates a property map with each theme class. Properties are tied to the theme's Class rather than individual instances, allowing shared configuration across all instances of a specific theme implementation.

While properties can be accessed and modified directly using getPropertiesFor(Class), it is often more convenient to manage theme properties through the default methods provided by the Theme interface.

Example

Accessing properties via the Theme interface:

var theme = new PrimerLight();
theme.setProperty("accentColor", "#0066CC");

// any other instance of the same theme class shares this property
var anotherTheme = new PrimerLight();
var color = anotherTheme.getProperty("accentColor"); // returns "#0066CC"

Direct registry management via ThemeProperties:

// configure theme properties directly by class before instantiating objects
Map<String, Object> properties = ThemeProperties.getPropertiesFor(PrimerLight.class);
properties.put("fontSize", 14);
properties.put("darkMode", false);
See Also:
  • Method Details

    • getPropertiesFor

      public static Map<String,Object> getPropertiesFor(Class<? extends Theme> themeClass)
      Retrieves the mutable property map for the specified theme class.

      If no map currently exists for the given class, a new empty map is automatically instantiated and associated with the class.

      Parameters:
      themeClass - the theme class whose property map is to be retrieved
      Returns:
      the mutable map containing the properties associated with the specified theme class