Package generic.theme.laf

# Class ComponentFontRegistry

java.lang.Object
generic.theme.laf.ComponentFontRegistry

public class ComponentFontRegistry extends Object
Maintains a weak set of components associated with a given font id. Whenever the font changes for the font id, this class will update the component's font to the new value.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ComponentFontRegistry(String fontId)`
  Constructs a registry for components bound to the given font id

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addComponent(Component component)`
  Adds a `Component` to the weak set of components whose font should be updated when the underlying font changes for this registry's font id.
  `void`
  `addComponent(Component component, int fontStyle)`
  Allows clients to update the default font being used for a component to use the given style.
  `void`
  `removeComponent(Component component)`
  Removes the given component from this registry.
  `void`
  `updateComponentFonts()`
  Updates the font for all components bound to this registry's font id.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### ComponentFontRegistry

    public ComponentFontRegistry(String fontId)
    Constructs a registry for components bound to the given font id
    Parameters:
      `fontId` - the id of the font to update the containing components

- ## Method Details

  - ### addComponent

    public void addComponent(Component component)
    Adds a `Component` to the weak set of components whose font should be updated when the underlying font changes for this registry's font id.
    Parameters:
      `component` - the component to add

  - ### addComponent

    public void addComponent(Component component, int fontStyle)
    Allows clients to update the default font being used for a component to use the given style.
    Parameters:
      `component` - the component
      `fontStyle` - the font style (e.g., `Font.BOLD`)

  - ### removeComponent

    public void removeComponent(Component component)
    Removes the given component from this registry.
    Parameters:
      `component` - the component

  - ### updateComponentFonts

    public void updateComponentFonts()
    Updates the font for all components bound to this registry's font id.