|
||||||||||
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 listener for some type of color to this provider. |
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 listener for some type of color from this provider. |
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 a ColorManager when one color 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)
ColorProvider
add
in interface ColorProvider<D extends DockColor>
id
- the id of the color the observer needscolor
- the new listenerpublic void remove(String id, D color)
ColorProvider
remove
in interface ColorProvider<D extends DockColor>
id
- the id of the color which the observer was observingcolor
- the listener to removepublic 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)
ColorProvider
ColorManager
when one color has been exchanged.
Normally a provider would call DockColor.set(Color)
on
observer
with color
as argument.
set
in interface ColorProvider<D extends DockColor>
id
- the identifier of the colorcolor
- the new color, can be null
observer
- the observer which is affectedprotected 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 |