bibliothek.gui.dock.common.intern.font
Class ListFontTransmitter

java.lang.Object
  extended by bibliothek.gui.dock.common.intern.ui.UITransmitter<FontModifier,DockFont>
      extended by bibliothek.gui.dock.common.intern.font.FontTransmitter
          extended by bibliothek.gui.dock.common.intern.font.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 Summary
ListFontTransmitter(FontManager manager, java.lang.String[] sourceKeys, java.lang.String[] destinationKeys)
          Creates a new transmitter.
 
Method Summary
protected  FontModifier get(FontModifier value, java.lang.String id, CDockable dockable)
          Transforms value into the form that should be used together with dockable.
protected  FontModifier get(FontModifier value, java.lang.String id, DockFont observer)
          Called when a value needs to be set whose key has been registered at this UITransmitter.
protected  boolean isObservedMapKey(java.lang.String key)
          Tells whether key is one of the keys observed in the FontMap.
 
Methods inherited from class bibliothek.gui.dock.common.intern.font.FontTransmitter
connect, disconnect, getFirstNonNull, update
 
Methods inherited from class bibliothek.gui.dock.common.intern.ui.UITransmitter
add, getDockable, remove, set, set, setControl
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface bibliothek.gui.dock.util.UIBridge
add, remove, set
 

Constructor Detail

ListFontTransmitter

public ListFontTransmitter(FontManager manager,
                           java.lang.String[] sourceKeys,
                           java.lang.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 Detail

get

protected FontModifier get(FontModifier value,
                           java.lang.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(java.lang.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,
                           java.lang.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