Class FontTransmitter
java.lang.Object
bibliothek.gui.dock.common.intern.ui.UITransmitter<FontModifier,DockFont>
bibliothek.gui.dock.common.intern.font.FontTransmitter
- All Implemented Interfaces:
FontBridge,UIBridge<FontModifier,DockFont>
- Direct Known Subclasses:
ListFontTransmitter
public abstract class FontTransmitter
extends UITransmitter<FontModifier,DockFont>
implements FontBridge
A
FontTransmitter observes some FontMap and transmits
FontModifiers of these maps to a set of DockFonts.- Author:
- Benjamin Sigg
-
Constructor Summary
ConstructorsConstructorDescriptionFontTransmitter(FontManager manager, String... keys) Creates a newFontTransmitter. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidAdds a listener todockableand callsUITransmitter.update(CDockable, String, Object)whenever some value needs an update.protected voiddisconnect(CDockable dockable) Removes a listener fromdockable.protected abstract FontModifierget(FontModifier value, String id, CDockable dockable) Transformsvalueinto the form that should be used together withdockable.protected FontModifiergetFirstNonNull(FontMap map, String... keys) Gets the first non-nullcolor ofmapthat matches a given key.protected abstract booleanisObservedMapKey(String key) Tells whetherkeyis one of the keys observed in theFontMap.protected voidupdate(CDockable dockable, String key, FontModifier value) Called when a value in an observed map has changed.Methods inherited from class bibliothek.gui.dock.common.intern.ui.UITransmitter
add, get, getDockable, remove, set, set, setControl
-
Constructor Details
-
FontTransmitter
Creates a newFontTransmitter.- Parameters:
manager- the source of original valueskeys- the keys which should be monitored by this transmitter
-
-
Method Details
-
getFirstNonNull
Gets the first non-nullcolor ofmapthat matches a given key.- Parameters:
map- a map of colorskeys- some keys that will be read from index 0 upward.- Returns:
- the first
Colorthat is notnullornull
-
connect
Description copied from class:UITransmitterAdds a listener todockableand callsUITransmitter.update(CDockable, String, Object)whenever some value needs an update.- Specified by:
connectin classUITransmitter<FontModifier,DockFont> - Parameters:
dockable- the element to observe
-
disconnect
Description copied from class:UITransmitterRemoves a listener fromdockable.- Specified by:
disconnectin classUITransmitter<FontModifier,DockFont> - Parameters:
dockable- the element from which a listener should be removed
-
update
Description copied from class:UITransmitterCalled when a value in an observed map has changed.- Specified by:
updatein classUITransmitter<FontModifier,DockFont> - Parameters:
dockable- the owner of the mapkey- the name of the changed valuevalue- the new value in the map, can benull
-
isObservedMapKey
Tells whetherkeyis one of the keys observed in theFontMap.- Parameters:
key- the key which might be observed- Returns:
trueif a change ofkeycan result in a change of fonts
-
get
Transformsvalueinto the form that should be used together withdockable.- Parameters:
value- some default value foridid- some of the keys specified for observationdockable- the element for which the value would be used- Returns:
- either
valueor a transformed version ofvalue
-