bibliothek.gui.dock.themes.color
Class DefaultColorScheme

java.lang.Object
  extended by bibliothek.gui.dock.themes.color.DefaultColorScheme
All Implemented Interfaces:
ColorScheme
Direct Known Subclasses:
BasicColorScheme, BubbleColorScheme, EclipseColorScheme, FlatColorScheme, SimpleBubbleColorScheme

public class DefaultColorScheme
extends Object
implements ColorScheme

An implementation of ColorScheme that can guess colors for ids that are not known. This scheme returns the one color whose keys matches a given id best.

Author:
Benjamin Sigg

Constructor Summary
DefaultColorScheme()
           
 
Method Summary
 Color getColor(String id)
          Searches for a color that can be used for the identifier id.
<D extends DockColor>
ColorProviderFactory<D,? extends ColorProvider<D>>
getProvider(Class<D> kind)
          Searches for a factory for a provider that can be used for a specific kind of DockColor.
 void setColor(String id, Color color)
          Sets the value of some color.
<D extends DockColor>
void
setProvider(Class<? super D> kind, ColorProviderFactory<D,ColorProvider<D>> provider)
          Sets the value of some provider.
 void transmitAll(Priority priority, ColorManager manager)
          Transmits all values in this scheme to manager.
 boolean updateUI()
          Called when the LookAndFeel changed and this scheme perhaps needs to update its colors.
 
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

updateUI

public boolean updateUI()
Description copied from interface: ColorScheme
Called when the LookAndFeel changed and this scheme perhaps needs to update its colors.

Specified by:
updateUI in interface ColorScheme
Returns:
true if anything changed, false if this scheme was not changed.

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

setProvider

public <D extends DockColor> void setProvider(Class<? super D> kind,
                                              ColorProviderFactory<D,ColorProvider<D>> provider)
Sets the value of some provider.

Parameters:
kind - the kind of DockColors the provider works with
provider - the provider or null

getColor

public Color getColor(String id)
Description copied from interface: ColorScheme
Searches for a color that can be used for the identifier id.

Specified by:
getColor in interface ColorScheme
Parameters:
id - an identifier of some color
Returns:
some color or null

getProvider

public <D extends DockColor> ColorProviderFactory<D,? extends ColorProvider<D>> getProvider(Class<D> kind)
Description copied from interface: ColorScheme
Searches for a factory for a provider that can be used for a specific kind of DockColor.

Specified by:
getProvider in interface ColorScheme
Parameters:
kind - the kind of color the provider should support
Returns:
some a factory for a provider or null

transmitAll

public void transmitAll(Priority priority,
                        ColorManager manager)
Description copied from interface: ColorScheme
Transmits all values in this scheme to manager.

Specified by:
transmitAll in interface ColorScheme
Parameters:
priority - the priority to use when registering colors and providers.
manager - the manager to fill