bibliothek.extension.gui.dock.theme
Class IdentifiedColorScheme

java.lang.Object
  extended by bibliothek.gui.dock.themes.color.AbstractColorScheme
      extended by bibliothek.extension.gui.dock.theme.IdentifiedColorScheme
All Implemented Interfaces:
ColorScheme, UIScheme<Color,DockColor,ColorBridge>

public class IdentifiedColorScheme
extends AbstractColorScheme

A ColorScheme that is wrapped around another scheme. This scheme contains a unmodifiable String which is used for equals(Object) and for hashCode().

Author:
Benjamin Sigg

Field Summary
 
Fields inherited from interface bibliothek.gui.dock.themes.ColorScheme
COLOR_SCHEME_PARAMETER, EXTENSION_NAME
 
Constructor Summary
IdentifiedColorScheme(String id, ColorScheme delegate)
          Creates a new scheme.
 
Method Summary
 void addListener(UISchemeListener<Color,DockColor,ColorBridge> listener)
          Adds a listener to this scheme.
 boolean equals(Object obj)
           
 ColorBridge getBridge(Path name, UIProperties<Color,DockColor,ColorBridge> properties)
          Creates the UIBridge that handles resources of type name.
 Color getResource(String name, UIProperties<Color,DockColor,ColorBridge> properties)
          Creates the resource with name name.
 int hashCode()
           
 void install(UIProperties<Color,DockColor,ColorBridge> properties)
          Informs this scheme that it is now used by properties.
 void removeListener(UISchemeListener<Color,DockColor,ColorBridge> listener)
          Removes a listener from this scheme.
 void uninstall(UIProperties<Color,DockColor,ColorBridge> properties)
          Informs this scheme that it is no longer used by properties.
protected  void updateUI()
          Called when the look and feel changed.
 
Methods inherited from class bibliothek.gui.dock.themes.color.AbstractColorScheme
fire, hasListeners, listeners, managers
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IdentifiedColorScheme

public IdentifiedColorScheme(String id,
                             ColorScheme delegate)
Creates a new scheme.

Parameters:
id - the unique identifier of this scheme
delegate - the source for any value of this scheme
Throws:
IllegalArgumentException - if either id or delegate is null
Method Detail

addListener

public void addListener(UISchemeListener<Color,DockColor,ColorBridge> listener)
Description copied from interface: UIScheme
Adds a listener to this scheme.

Specified by:
addListener in interface UIScheme<Color,DockColor,ColorBridge>
Overrides:
addListener in class AbstractColorScheme
Parameters:
listener - the new listener, not null

removeListener

public void removeListener(UISchemeListener<Color,DockColor,ColorBridge> listener)
Description copied from interface: UIScheme
Removes a listener from this scheme.

Specified by:
removeListener in interface UIScheme<Color,DockColor,ColorBridge>
Overrides:
removeListener in class AbstractColorScheme
Parameters:
listener - the listener to remove

install

public void install(UIProperties<Color,DockColor,ColorBridge> properties)
Description copied from interface: UIScheme
Informs this scheme that it is now used by properties.

Specified by:
install in interface UIScheme<Color,DockColor,ColorBridge>
Overrides:
install in class AbstractColorScheme
Parameters:
properties - the owner of this scheme

uninstall

public void uninstall(UIProperties<Color,DockColor,ColorBridge> properties)
Description copied from interface: UIScheme
Informs this scheme that it is no longer used by properties.

Specified by:
uninstall in interface UIScheme<Color,DockColor,ColorBridge>
Overrides:
uninstall in class AbstractColorScheme
Parameters:
properties - an old client of this scheme

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

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

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

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