public abstract class FontTransmitter extends UITransmitter<FontModifier,DockFont> implements FontBridge
FontTransmitter observes some FontMap and transmits
FontModifiers of these maps to a set of DockFonts.| Constructor and Description |
|---|
FontTransmitter(FontManager manager,
String... keys)
Creates a new
FontTransmitter. |
| Modifier and Type | Method and Description |
|---|---|
protected void |
connect(CDockable dockable)
Adds a listener to
dockable and calls
UITransmitter.update(CDockable, String, Object) whenever some value
needs an update. |
protected void |
disconnect(CDockable dockable)
Removes a listener from
dockable. |
protected abstract FontModifier |
get(FontModifier value,
String id,
CDockable dockable)
Transforms
value into the form that should be used together
with dockable. |
protected FontModifier |
getFirstNonNull(FontMap map,
String... keys)
Gets the first non-
null color of map that
matches a given key. |
protected abstract boolean |
isObservedMapKey(String key)
Tells whether
key is one of the keys observed in
the FontMap. |
protected void |
update(CDockable dockable,
String key,
FontModifier value)
Called when a value in an observed map has changed.
|
add, get, getDockable, remove, set, set, setControlpublic FontTransmitter(FontManager manager, String... keys)
FontTransmitter.manager - the source of original valueskeys - the keys which should be monitored by this transmitterprotected FontModifier getFirstNonNull(FontMap map, String... keys)
null color of map that
matches a given key.map - a map of colorskeys - some keys that will be read from index 0 upward.Color that is not null or nullprotected void connect(CDockable dockable)
UITransmitterdockable and calls
UITransmitter.update(CDockable, String, Object) whenever some value
needs an update.connect in class UITransmitter<FontModifier,DockFont>dockable - the element to observeprotected void disconnect(CDockable dockable)
UITransmitterdockable.disconnect in class UITransmitter<FontModifier,DockFont>dockable - the element from which a listener should be removedprotected void update(CDockable dockable, String key, FontModifier value)
UITransmitterupdate in class UITransmitter<FontModifier,DockFont>dockable - the owner of the mapkey - the name of the changed valuevalue - the new value in the map, can be nullprotected abstract boolean isObservedMapKey(String key)
key is one of the keys observed in
the FontMap.key - the key which might be observedtrue if a change of key can
result in a change of fontsprotected abstract FontModifier get(FontModifier value, String id, CDockable dockable)
value into the form that should be used together
with dockable.value - some default value for idid - some of the keys specified for observationdockable - the element for which the value would be usedvalue or a transformed version of valueCopyright © 2018. All rights reserved.