Class ListFontTransmitter

All Implemented Interfaces:
FontBridge, UIBridge<FontModifier,DockFont>
Direct Known Subclasses:
ButtonFontTransmitter, TabFontTransmitter, TabTitleFontTransmitter, TitleFontTransmitter

public abstract class ListFontTransmitter extends FontTransmitter
A FontTransmitter that has a simple 1 to 1 relationship between keys.
Author:
Benjamin Sigg
  • Constructor Details

    • ListFontTransmitter

      public ListFontTransmitter(FontManager manager, String[] sourceKeys, String[] destinationKeys)
      Creates a new transmitter. The arrays sourceKeys and destinationKeys must have the same length.
      Parameters:
      manager - the list of default values
      sourceKeys - keys used to read from a FontMap
      destinationKeys - keys used to write into a DockFont
  • Method Details

    • get

      protected FontModifier get(FontModifier value, String id, DockFont observer)
      Description copied from class: UITransmitter
      Called when a value needs to be set whose key has been registered at this UITransmitter.
      Specified by:
      get in class UITransmitter<FontModifier,DockFont>
      Parameters:
      value - the original value
      id - the key of the value
      observer - the destination for the value
      Returns:
      the value that should be set to observer
    • isObservedMapKey

      protected boolean isObservedMapKey(String key)
      Description copied from class: FontTransmitter
      Tells whether key is one of the keys observed in the FontMap.
      Specified by:
      isObservedMapKey in class FontTransmitter
      Parameters:
      key - the key which might be observed
      Returns:
      true if a change of key can result in a change of fonts
    • get

      protected FontModifier get(FontModifier value, String id, CDockable dockable)
      Description copied from class: FontTransmitter
      Transforms value into the form that should be used together with dockable.
      Specified by:
      get in class FontTransmitter
      Parameters:
      value - some default value for id
      id - some of the keys specified for observation
      dockable - the element for which the value would be used
      Returns:
      either value or a transformed version of value