bibliothek.gui.dock.themes.color
Class DefaultColorScheme

java.lang.Object
  extended by bibliothek.gui.dock.themes.color.AbstractColorScheme
      extended by bibliothek.gui.dock.themes.color.DefaultColorScheme
All Implemented Interfaces:
ColorScheme, UIScheme<Color,DockColor,ColorBridge>
Direct Known Subclasses:
BasicColorScheme, BubbleColorScheme, FlatColorScheme, SimpleBubbleColorScheme

public class DefaultColorScheme
extends AbstractColorScheme

The default implementation of ColorScheme just uses some maps to store its colors. Warning: this class will be replaced in version 1.1.0

Author:
Benjamin Sigg

Field Summary
 
Fields inherited from interface bibliothek.gui.dock.themes.ColorScheme
COLOR_SCHEME_PARAMETER, EXTENSION_NAME
 
Constructor Summary
DefaultColorScheme()
           
 
Method Summary
 ColorBridge getBridge(Path name, UIProperties<Color,DockColor,ColorBridge> properties)
          Creates the UIBridge that handles resources of type name.
 ColorBridgeFactory getBridgeFactory(Path kind)
          Gets the factory that creates bridges for kind.
 Color getColor(String id)
          Gets the color that best matches the identifier id.
 Color getResource(String name, UIProperties<Color,DockColor,ColorBridge> properties)
          Creates the resource with name name.
 void setBridgeFactory(Path kind, ColorBridgeFactory bridge)
          Sets how to modify some kind of DockColors.
 void setColor(String id, Color color)
          Sets the value of some color.
 void setNullColor(String id)
          Sets the value of some color explicitely to null, this is not the same as calling setColor(String, Color): setColor removes the entry, this method keeps the entry but sets it to null.
protected  void updateUI()
          Called when the look and feel changed.
 
Methods inherited from class bibliothek.gui.dock.themes.color.AbstractColorScheme
addListener, fire, hasListeners, install, listeners, managers, removeListener, uninstall
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultColorScheme

public DefaultColorScheme()
Method Detail

getBridge

public ColorBridge getBridge(Path name,
                             UIProperties<Color,DockColor,ColorBridge> properties)
Description copied from interface: UIScheme
Creates the UIBridge that handles resources of type name.

Parameters:
name - the name of the bridge
properties - the map that will use the resource
Returns:
the new bridge or null if this scheme does not know name

updateUI

protected void updateUI()
Description copied from class: AbstractColorScheme
Called when the look and feel changed. Subclasses may override this method and update colors if necessary.

Specified by:
updateUI in class AbstractColorScheme

setBridgeFactory

public void setBridgeFactory(Path kind,
                             ColorBridgeFactory bridge)
Sets how to modify some kind of DockColors.

Parameters:
kind - the kind of DockColors the bridge works with
bridge - the factory for modifications or null

setColor

public void setColor(String id,
                     Color color)
Sets the value of some color.

Parameters:
id - the identifier of the color
color - the color or null
See Also:
setNullColor(String)

setNullColor

public void setNullColor(String id)
Sets the value of some color explicitely to null, this is not the same as calling setColor(String, Color): setColor removes the entry, this method keeps the entry but sets it to null.

Parameters:
id - the identifier of the color to set explicitely to null

getResource

public Color getResource(String name,
                         UIProperties<Color,DockColor,ColorBridge> properties)
Description copied from interface: UIScheme
Creates the resource with name name. This method may be called often and should complete quickly.

Parameters:
name - the name of some resource
properties - the map that will use the resource
Returns:
the resource or null if this scheme does not know name

getColor

public Color getColor(String id)
Gets the color that best matches the identifier id.

Parameters:
id - some identifier
Returns:
a color that matches id or null, the color may not be stored with the exact identifier id

getBridgeFactory

public ColorBridgeFactory getBridgeFactory(Path kind)
Gets the factory that creates bridges for kind.

Parameters:
kind - some identifier for a type
Returns:
the factory whose kind best matches kind or null