|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbibliothek.gui.dock.common.intern.color.ColorTransmitter<D>
D
- the kind of DockColor
used in this transmitterpublic abstract class ColorTransmitter<D extends DockColor>
A ColorTransmitter
observes some ColorMap
s
and transmits some Color
s of these maps to a set of DockColor
s.
Constructor Summary | |
---|---|
ColorTransmitter(String... keys)
Creates a new ColorTransmitter . |
Method Summary | |
---|---|
void |
add(String id,
D color)
Adds a new UIValue that gets its resource from this bridge. |
protected abstract Color |
get(Color color,
String id,
D observer)
Called when a color needs to be set whose key has been registered at this ColorTransmitter . |
protected abstract CDockable |
getDockable(D observer)
Gets the CDockable which is associated with observer . |
protected Color |
getFirstNonNull(ColorMap map,
String... keys)
Gets the first non- null color of map that
matches a given key. |
void |
remove(String id,
D color)
Removes a value from this bridge. |
protected void |
set(String id,
Color color,
CDockable dockable)
Transmits color to all DockColor s which
listen to the given id and which are associated with dockable . |
void |
set(String id,
Color color,
D observer)
Called by the UIProperties when one resource or UIValue
has been exchanged. |
void |
setControl(CControl control)
Sets the CControl which should be observed for new CDockable s
by this transmitter. |
protected abstract void |
update(CDockable dockable,
String key,
Color color)
Called when a color in a ColorMap has changed. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ColorTransmitter(String... keys)
ColorTransmitter
.
keys
- the keys which should be monitored by this transmitterMethod Detail |
---|
public void add(String id, D color)
UIBridge
UIValue
that gets its resource from this bridge.
add
in interface UIBridge<Color,D extends DockColor>
id
- the id of the resource the new value needscolor
- a value that can be modified by this bridepublic void remove(String id, D color)
UIBridge
remove
in interface UIBridge<Color,D extends DockColor>
id
- the id of the resource the value neededcolor
- the value that is no longer in usepublic void setControl(CControl control)
CControl
which should be observed for new CDockable
s
by this transmitter.
control
- the observed control, can be null
public void set(String id, Color color, D observer)
UIBridge
UIProperties
when one resource or UIValue
has been exchanged. Normally an UIBridge
can just
call UIValue.set(Object)
with the argument value
.
set
in interface UIBridge<Color,D extends DockColor>
id
- the identifier of the resourcecolor
- the new resource, can be null
observer
- the value that is affected by the changeprotected abstract Color get(Color color, String id, D observer)
ColorTransmitter
.
color
- the original colorid
- the key of the colorobserver
- the destination for the color
observer
protected abstract void update(CDockable dockable, String key, Color color)
ColorMap
has changed.
dockable
- the owner of the mapkey
- the name of the changed colorcolor
- the new value of the color in the map, can be null
protected abstract CDockable getDockable(D observer)
CDockable
which is associated with observer
.
observer
- some observer
null
protected Color getFirstNonNull(ColorMap 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 null
protected void set(String id, Color color, CDockable dockable)
color
to all DockColor
s which
listen to the given id and which are associated with dockable
.
id
- the id of the changed colorcolor
- the new color, might be null
dockable
- the associated dockable, might be null
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |