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

java.lang.Object
  extended by bibliothek.gui.dock.common.intern.color.ColorTransmitter<TitleColor>
      extended by bibliothek.gui.dock.common.intern.color.TitleColorTransmitter
All Implemented Interfaces:
UIBridge<Color,TitleColor>
Direct Known Subclasses:
BasicTitleTransmitter, BubbleTitleTransmitter, FlatTitleTransmitter

public abstract class TitleColorTransmitter
extends ColorTransmitter<TitleColor>

A color transmitter that connects TitleColors with the common-project and the ColorMap of the CDockables.

Author:
Benjamin Sigg

Constructor Summary
TitleColorTransmitter(ColorManager manager, String... keys)
          Creates a new transmitter.
 
Method Summary
protected abstract  Color convert(Color source, String key)
          Changes a background color such that it can be used on a BubbleStackDockComponent
protected abstract  Color convertFocused(Color source, String key)
          Changes a background color such that it can be used on a BubbleStackDockComponent
protected  Color get(Color color, String id, CDockable dockable)
          Searches the color id for dockable.
protected  Color get(Color color, String id, TitleColor observer)
          Called when a color needs to be set whose key has been registered at this ColorTransmitter.
protected  CDockable getDockable(TitleColor observer)
          Gets the CDockable which is associated with observer.
protected abstract  boolean isFocused(String id)
          Tells whether id represents a color that is used on focused tabs.
protected abstract  boolean isForeground(String id)
          Tells whether id represents a color that is used for the foreground.
protected  void update(CDockable dockable, String key, Color color)
          Called when a color in a ColorMap has changed.
 
Methods inherited from class bibliothek.gui.dock.common.intern.color.ColorTransmitter
add, getFirstNonNull, remove, set, set, setControl
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TitleColorTransmitter

public TitleColorTransmitter(ColorManager manager,
                             String... keys)
Creates a new transmitter.

Parameters:
keys - the keys of the colors that are handled by this transmitter
manager - the source of all colors
Method Detail

convert

protected abstract Color convert(Color source,
                                 String key)
Changes a background color such that it can be used on a BubbleStackDockComponent

Parameters:
source - the original color
key - the key for which the color is needed
Returns:
the new color

convertFocused

protected abstract Color convertFocused(Color source,
                                        String key)
Changes a background color such that it can be used on a BubbleStackDockComponent

Parameters:
source - the original color
key - the key for which the color is needed, can only be one of the focused kind
Returns:
the new color

isForeground

protected abstract boolean isForeground(String id)
Tells whether id represents a color that is used for the foreground.

Parameters:
id - some id
Returns:
true if the color is used in the foreground

isFocused

protected abstract boolean isFocused(String id)
Tells whether id represents a color that is used on focused tabs.

Parameters:
id - some id
Returns:
true if the color is used on focused tabs

get

protected Color get(Color color,
                    String id,
                    TitleColor observer)
Description copied from class: ColorTransmitter
Called when a color needs to be set whose key has been registered at this ColorTransmitter.

Specified by:
get in class ColorTransmitter<TitleColor>
Parameters:
color - the original color
id - the key of the color
observer - the destination for the color
Returns:
the color that should be set to observer

getDockable

protected CDockable getDockable(TitleColor observer)
Description copied from class: ColorTransmitter
Gets the CDockable which is associated with observer.

Specified by:
getDockable in class ColorTransmitter<TitleColor>
Parameters:
observer - some observer
Returns:
the associated dockable or null

get

protected Color get(Color color,
                    String id,
                    CDockable dockable)
Searches the color id for dockable.

Parameters:
color - the color to be returned if the search for id fails.
id - the identifier of the color to search
dockable - the element for which the color will be used
Returns:
some color

update

protected void update(CDockable dockable,
                      String key,
                      Color color)
Description copied from class: ColorTransmitter
Called when a color in a ColorMap has changed.

Specified by:
update in class ColorTransmitter<TitleColor>
Parameters:
dockable - the owner of the map
key - the name of the changed color
color - the new value of the color in the map, can be null