Class ColorMap

java.lang.Object
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 Details

    • 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:
    • 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:
    • 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:
    • 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:
    • 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:
    • 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:
    • 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:
    • 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:
    • 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:
    • 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:
    • 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:
    • 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:
    • 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:
    • 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:
    • 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:
    • 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:
  • Constructor Details

    • ColorMap

      public ColorMap(CDockable dockable)
      Creates a new map.
      Parameters:
      dockable - the owner of this map
  • Method Details

    • 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