Class Locator

java.lang.Object
com.j3d.ui.theme.updator.Locator

public final class Locator extends Object
A utility class that acts as a locator for a specific theme property and its corresponding setter function. This class is typically used in UI theme management systems to associate a theme property (e.g., a color defined in J3DTheme) with a method that can apply that colour to a UI component.

It provides methods to access and modify the associated theme property and its setter.

Author:
Lehlogonolo Poole
See Also:
  • Field Details

    • themeProperty

      private J3DTheme themeProperty
      The J3DTheme enum value representing the specific theme property this locator is associated with.
    • propertySetter

      private Consumer<Color> propertySetter
      A Consumer that accepts a Color object and applies it to the UI component or property this locator manages.
  • Constructor Details

    • Locator

      public Locator(J3DTheme themeProperty, Consumer<Color> propertySetter)
      Constructs a new Locator with the specified theme property and setter.
      Parameters:
      themeProperty - The J3DTheme enum value representing the theme property.
      propertySetter - A Consumer that will be used to set the color associated with the themeProperty.
  • Method Details

    • themeProperty

      public J3DTheme themeProperty()
      Returns the J3DTheme enum value associated with this locator.
      Returns:
      The theme property.
    • propertySetter

      public Consumer<Color> propertySetter()
      Returns the Consumer responsible for setting the color property. This consumer takes a Color object as input.
      Returns:
      The consumer function for setting the color property.
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Returns a hash code value for the object. This method is supported for the benefit of hash tables.
      Overrides:
      hashCode in class Object
      Returns:
      A hash code value for this object.
    • toString

      public String toString()
      Returns a string representation of this Locator. The string representation includes the theme property and the property setter.
      Overrides:
      toString in class Object
      Returns:
      A string representation of this object.
    • setPropertySetter

      public void setPropertySetter(Consumer<Color> propertySetter)
      Sets the Consumer responsible for setting the color property.
      Parameters:
      propertySetter - The new consumer function for setting the color property.
    • setThemeProperty

      public void setThemeProperty(J3DTheme themeProperty)
      Sets the J3DTheme enum value associated with this locator.
      Parameters:
      themeProperty - The new theme property.