public abstract class FontTransmitter extends UITransmitter<FontModifier,DockFont> implements FontBridge
FontTransmitter
observes some FontMap
and transmits
FontModifier
s of these maps to a set of DockFont
s.Constructor and Description |
---|
FontTransmitter(FontManager manager,
java.lang.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,
java.lang.String id,
CDockable dockable)
Transforms
value into the form that should be used together
with dockable . |
protected FontModifier |
getFirstNonNull(FontMap map,
java.lang.String... keys)
Gets the first non-
null color of map that
matches a given key. |
protected abstract boolean |
isObservedMapKey(java.lang.String key)
Tells whether
key is one of the keys observed in
the FontMap . |
protected void |
update(CDockable dockable,
java.lang.String key,
FontModifier value)
Called when a value in an observed map has changed.
|
add, get, getDockable, remove, set, set, setControl
public FontTransmitter(FontManager manager, java.lang.String... keys)
FontTransmitter
.manager
- the source of original valueskeys
- the keys which should be monitored by this transmitterprotected FontModifier getFirstNonNull(FontMap map, java.lang.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 null
protected void connect(CDockable dockable)
UITransmitter
dockable
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)
UITransmitter
dockable
.disconnect
in class UITransmitter<FontModifier,DockFont>
dockable
- the element from which a listener should be removedprotected void update(CDockable dockable, java.lang.String key, FontModifier value)
UITransmitter
update
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 null
protected abstract boolean isObservedMapKey(java.lang.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, java.lang.String id, CDockable dockable)
value
into the form that should be used together
with dockable
.value
- some default value for id
id
- some of the keys specified for observationdockable
- the element for which the value would be usedvalue
or a transformed version of value