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

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

public abstract class MinimizedButtonColorTransmitter
extends ColorTransmitter

A color transmitter for the button-title used on minimized areas.

Author:
Benjamin Sigg

Constructor Summary
MinimizedButtonColorTransmitter(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 for key.
protected abstract  Color convertFocused(Color source, String key)
          Changes a background color such that it can be used for key.
protected abstract  Color convertSelected(Color source, String key)
          Changes a background color such that is can be used for key.
protected  Color get(Color color, String id, CDockable dockable)
          Searches the color id for dockable.
protected  Color get(Color color, String id, DockColor observer)
          Called when a value needs to be set whose key has been registered at this UITransmitter.
protected  CDockable getDockable(DockColor observer)
          Gets the CDockable which is associated with observer.
 String[] getKeys()
          Gets the list of keys for which this transmitter works.
protected abstract  boolean isFocused(String id)
          Tells whether id represents a color that is used on focused titles.
protected abstract  boolean isForeground(String id)
          Tells whether id represents a color that is used for the foreground.
protected abstract  boolean isSelected(String id)
          Tells whether id represents a color that is used on a selected title.
protected  void update(CDockable dockable, String key, Color color)
          Called when a value in an observed map has changed.
 
Methods inherited from class bibliothek.gui.dock.common.intern.color.ColorTransmitter
connect, disconnect, getFirstNonNull
 
Methods inherited from class bibliothek.gui.dock.common.intern.ui.UITransmitter
add, remove, set, set, setControl
 
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

MinimizedButtonColorTransmitter

public MinimizedButtonColorTransmitter(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 for key.

Parameters:
source - the original color
key - the key for which the color is needed
Returns:
the new color, can be null

convertFocused

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

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, can be null

convertSelected

protected abstract Color convertSelected(Color source,
                                         String key)
Changes a background color such that is can be used for key.

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

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 titles.

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

isSelected

protected abstract boolean isSelected(String id)
Tells whether id represents a color that is used on a selected title.

Parameters:
id - some id
Returns:
true if the color is used on a selected button

getKeys

public String[] getKeys()
Gets the list of keys for which this transmitter works.

Returns:
the list of keys

get

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

Specified by:
get in class UITransmitter<Color,DockColor>
Parameters:
color - the original value
id - the key of the value
observer - the destination for the value
Returns:
the value that should be set to observer

getDockable

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

Specified by:
getDockable in class UITransmitter<Color,DockColor>
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: UITransmitter
Called when a value in an observed map has changed.

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