bibliothek.gui.dock.common.intern.color
Class ColorTransmitter

java.lang.Object
  extended by bibliothek.gui.dock.common.intern.ui.UITransmitter<Color,DockColor>
      extended by bibliothek.gui.dock.common.intern.color.ColorTransmitter
All Implemented Interfaces:
ColorBridge, UIBridge<Color,DockColor>
Direct Known Subclasses:
BubbleDisplayerTransmitter, MinimizedButtonColorTransmitter, TabColorTransmitter, TitleColorTransmitter

public abstract class ColorTransmitter
extends UITransmitter<Color,DockColor>
implements ColorBridge

A ColorTransmitter observes some ColorMaps and transmits some Colors of these maps to a set of DockColors.

Author:
Benjamin Sigg

Constructor Summary
ColorTransmitter(String... keys)
          Creates a new ColorTransmitter.
 
Method Summary
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  Color getFirstNonNull(ColorMap map, String... keys)
          Gets the first non- null color of map that matches a given key.
 
Methods inherited from class bibliothek.gui.dock.common.intern.ui.UITransmitter
add, get, getDockable, remove, set, set, setControl, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface bibliothek.gui.dock.util.UIBridge
add, remove, set
 

Constructor Detail

ColorTransmitter

public ColorTransmitter(String... keys)
Creates a new ColorTransmitter.

Parameters:
keys - the keys which should be monitored by this transmitter
Method Detail

getFirstNonNull

protected Color getFirstNonNull(ColorMap map,
                                String... keys)
Gets the first non- null color of map that matches a given key.

Parameters:
map - a map of colors
keys - some keys that will be read from index 0 upward.
Returns:
the first Color that is not null or null

connect

protected void connect(CDockable dockable)
Description copied from class: UITransmitter
Adds a listener to dockable and calls UITransmitter.update(CDockable, String, Object) whenever some value needs an update.

Specified by:
connect in class UITransmitter<Color,DockColor>
Parameters:
dockable - the element to observe

disconnect

protected void disconnect(CDockable dockable)
Description copied from class: UITransmitter
Removes a listener from dockable.

Specified by:
disconnect in class UITransmitter<Color,DockColor>
Parameters:
dockable - the element from which a listener should be removed