V
- the kind of value that is described by the UIValue
U
- the kind of UIValue
used in this transmitterpublic abstract class UITransmitter<V,U extends UIValue<V>> extends java.lang.Object implements UIBridge<V,U>
UITransmitter
listens to some kind of map
and updates some UIValue
s when the contents of that map change.Constructor and Description |
---|
UITransmitter(java.lang.String... keys)
Creates a new
ColorTransmitter . |
Modifier and Type | Method and Description |
---|---|
void |
add(java.lang.String id,
U value)
Adds a new
UIValue that gets its resource from this bridge. |
protected abstract void |
connect(CDockable dockable)
Adds a listener to
dockable and calls
update(CDockable, String, Object) whenever some value
needs an update. |
protected abstract void |
disconnect(CDockable dockable)
Removes a listener from
dockable . |
protected abstract V |
get(V value,
java.lang.String id,
U observer)
Called when a value needs to be set whose key has been registered at
this
UITransmitter . |
protected abstract CDockable |
getDockable(U observer)
Gets the
CDockable which is associated with observer . |
void |
remove(java.lang.String id,
U value)
Removes a value from this bridge.
|
protected void |
set(java.lang.String id,
V value,
CDockable dockable)
Transmits
value to all UIValue s which
listen to the given id and which are associated with dockable . |
void |
set(java.lang.String id,
V value,
U observer)
Called by the
UIProperties when one resource or UIValue
has been exchanged. |
void |
setControl(CControl control)
|
protected abstract void |
update(CDockable dockable,
java.lang.String key,
V value)
Called when a value in an observed map has changed.
|
public UITransmitter(java.lang.String... keys)
ColorTransmitter
.keys
- the keys which should be monitored by this transmitterpublic void add(java.lang.String id, U value)
UIBridge
UIValue
that gets its resource from this bridge.public void remove(java.lang.String id, U value)
UIBridge
public void setControl(CControl control)
control
- the observed control, can be null
public void set(java.lang.String id, V value, U observer)
UIBridge
UIProperties
when one resource or UIValue
has been exchanged. Normally an UIBridge
can just
call UIValue.set(Object)
with the argument value
.UIValue
that was not added
to this UIBridge
.protected abstract V get(V value, java.lang.String id, U observer)
UITransmitter
.value
- the original valueid
- the key of the valueobserver
- the destination for the valueobserver
protected abstract void update(CDockable dockable, java.lang.String key, V value)
dockable
- the owner of the mapkey
- the name of the changed valuevalue
- the new value in the map, can be null
protected abstract CDockable getDockable(U observer)
CDockable
which is associated with observer
.observer
- some observernull
protected void set(java.lang.String id, V value, CDockable dockable)
value
to all UIValue
s which
listen to the given id and which are associated with dockable
.id
- the id of the changed valuevalue
- the new value, might be null
dockable
- the associated dockable, might be null
protected abstract void connect(CDockable dockable)
dockable
and calls
update(CDockable, String, Object)
whenever some value
needs an update.dockable
- the element to observeprotected abstract void disconnect(CDockable dockable)
dockable
.dockable
- the element from which a listener should be removed