bibliothek.gui.dock.common
Class ColorMap

java.lang.Object
  extended by bibliothek.gui.dock.common.ColorMap

public class ColorMap
extends Object

A map containing several Colors. A ColorMap is associated with exactly one CDockable. The colors in the map are used to change the standard colors that normally used for example to paint a title or to draw a tab. The entries of this map can be changed at any time. Changes of any entry in this map will be forwarded instantaneously to the element that uses the entry.

Author:
Benjamin Sigg

Field Summary
static String COLOR_KEY_MINIMIZED_BUTTON_BACKGROUND
          a key for colors that are used on the button of the minimized-area as background
static String COLOR_KEY_MINIMIZED_BUTTON_BACKGROUND_FOCUSED
          a key for colors that are used on the button of the minimized-area as background if focused
static String COLOR_KEY_MINIMIZED_BUTTON_BACKGROUND_SELECTED
          a key for colors that are used on the button of the minimized-area as background if selected
static String COLOR_KEY_MINIMIZED_BUTTON_FOREGROUND
          a key for colors that are used on the button of the minimized-area as foreground
static String COLOR_KEY_MINIMIZED_BUTTON_FOREGROUND_FOCUSED
          a key for colors that are used on the button of the minimized-area as foreground if focused
static String COLOR_KEY_MINIMIZED_BUTTON_FOREGROUND_SELECTED
          a key for colors that are used on the button of the minimized-area as foreground if selected
static String COLOR_KEY_TAB_BACKGROUND
          a key for colors that are used on unselected tabs as background
static String COLOR_KEY_TAB_BACKGROUND_FOCUSED
          a key for colors that are used on focused tabs as background
static String COLOR_KEY_TAB_BACKGROUND_SELECTED
          a key for colors that are used on selected, but not focused, tabs as background
static String COLOR_KEY_TAB_FOREGROUND
          a key for colors that are used on unselected tabs as foreground
static String COLOR_KEY_TAB_FOREGROUND_FOCUSED
          a key for colors that are used on focused tabs a foreground
static String COLOR_KEY_TAB_FOREGROUND_SELECTED
          a key for colors that are used on selected, but not focused, tabs as foreground
static String COLOR_KEY_TITLE_BACKGROUND
          a key for colors that are used on titles as background
static String COLOR_KEY_TITLE_BACKGROUND_FOCUSED
          a key for colors that are used on focused titles as background
static String COLOR_KEY_TITLE_FOREGROUND
          a key for colors that are used on titles as foreground
static String COLOR_KEY_TITLE_FOREGROUND_FOCUSED
          a key for colors that are used on focused titles as foreground
 
Constructor Summary
ColorMap(CDockable dockable)
          Creates a new map.
 
Method Summary
 void addListener(ColorMapListener listener)
          Adds a listener to this map, the listener will be informed whenever a color of this map changes.
 Color getColor(String key)
          Returns a color that was stored in this map.
 CDockable getDockable()
          Gets the owner of this map.
 void removeListener(ColorMapListener listener)
          Removes a listener from this map.
 void setColor(String key, Color color)
          Sets a color in this map.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COLOR_KEY_TAB_BACKGROUND

public static final String COLOR_KEY_TAB_BACKGROUND
a key for colors that are used on unselected tabs as background

See Also:
Constant Field Values

COLOR_KEY_TAB_FOREGROUND

public static final String COLOR_KEY_TAB_FOREGROUND
a key for colors that are used on unselected tabs as foreground

See Also:
Constant Field Values

COLOR_KEY_TAB_BACKGROUND_SELECTED

public static final String COLOR_KEY_TAB_BACKGROUND_SELECTED
a key for colors that are used on selected, but not focused, tabs as background

See Also:
Constant Field Values

COLOR_KEY_TAB_FOREGROUND_SELECTED

public static final String COLOR_KEY_TAB_FOREGROUND_SELECTED
a key for colors that are used on selected, but not focused, tabs as foreground

See Also:
Constant Field Values

COLOR_KEY_TAB_BACKGROUND_FOCUSED

public static final String COLOR_KEY_TAB_BACKGROUND_FOCUSED
a key for colors that are used on focused tabs as background

See Also:
Constant Field Values

COLOR_KEY_TAB_FOREGROUND_FOCUSED

public static final String COLOR_KEY_TAB_FOREGROUND_FOCUSED
a key for colors that are used on focused tabs a foreground

See Also:
Constant Field Values

COLOR_KEY_TITLE_BACKGROUND

public static final String COLOR_KEY_TITLE_BACKGROUND
a key for colors that are used on titles as background

See Also:
Constant Field Values

COLOR_KEY_TITLE_FOREGROUND

public static final String COLOR_KEY_TITLE_FOREGROUND
a key for colors that are used on titles as foreground

See Also:
Constant Field Values

COLOR_KEY_TITLE_BACKGROUND_FOCUSED

public static final String COLOR_KEY_TITLE_BACKGROUND_FOCUSED
a key for colors that are used on focused titles as background

See Also:
Constant Field Values

COLOR_KEY_TITLE_FOREGROUND_FOCUSED

public static final String COLOR_KEY_TITLE_FOREGROUND_FOCUSED
a key for colors that are used on focused titles as foreground

See Also:
Constant Field Values

COLOR_KEY_MINIMIZED_BUTTON_BACKGROUND

public static final String COLOR_KEY_MINIMIZED_BUTTON_BACKGROUND
a key for colors that are used on the button of the minimized-area as background

See Also:
Constant Field Values

COLOR_KEY_MINIMIZED_BUTTON_FOREGROUND

public static final String COLOR_KEY_MINIMIZED_BUTTON_FOREGROUND
a key for colors that are used on the button of the minimized-area as foreground

See Also:
Constant Field Values

COLOR_KEY_MINIMIZED_BUTTON_BACKGROUND_FOCUSED

public static final String COLOR_KEY_MINIMIZED_BUTTON_BACKGROUND_FOCUSED
a key for colors that are used on the button of the minimized-area as background if focused

See Also:
Constant Field Values

COLOR_KEY_MINIMIZED_BUTTON_FOREGROUND_FOCUSED

public static final String COLOR_KEY_MINIMIZED_BUTTON_FOREGROUND_FOCUSED
a key for colors that are used on the button of the minimized-area as foreground if focused

See Also:
Constant Field Values

COLOR_KEY_MINIMIZED_BUTTON_BACKGROUND_SELECTED

public static final String COLOR_KEY_MINIMIZED_BUTTON_BACKGROUND_SELECTED
a key for colors that are used on the button of the minimized-area as background if selected

See Also:
Constant Field Values

COLOR_KEY_MINIMIZED_BUTTON_FOREGROUND_SELECTED

public static final String COLOR_KEY_MINIMIZED_BUTTON_FOREGROUND_SELECTED
a key for colors that are used on the button of the minimized-area as foreground if selected

See Also:
Constant Field Values
Constructor Detail

ColorMap

public ColorMap(CDockable dockable)
Creates a new map.

Parameters:
dockable - the owner of this map
Method Detail

getDockable

public CDockable getDockable()
Gets the owner of this map.

Returns:
the owner

addListener

public void addListener(ColorMapListener listener)
Adds a listener to this map, the listener will be informed whenever a color of this map changes.

Parameters:
listener - the new listener

removeListener

public void removeListener(ColorMapListener listener)
Removes a listener from this map.

Parameters:
listener - the listener to remove

getColor

public Color getColor(String key)
Returns a color that was stored in this map.

Parameters:
key - the name of the color
Returns:
the color or null

setColor

public void setColor(String key,
                     Color color)
Sets a color in this map.

Parameters:
key - the name of the color
color - the new color, can be null to return to the default color