bibliothek.gui.dock.util
Class MultiUIBridge<V,U extends UIValue<V>>

java.lang.Object
  extended by bibliothek.gui.dock.util.MultiUIBridge<V,U>
Type Parameters:
V - the kind of resources that get handled by this bridge
U - the kind of values that get the resources of kind V
All Implemented Interfaces:
UIBridge<V,U>
Direct Known Subclasses:
MultiColorBridge, MultiFontBridge

public class MultiUIBridge<V,U extends UIValue<V>>
extends Object
implements UIBridge<V,U>

A MultiUIBridge is a collection of UIBridges. Each bridge in the collection is responsible to handle only one resource.

Author:
Benjamin Sigg

Constructor Summary
MultiUIBridge(UIProperties<V,U,?> manager)
          Creates a new MultiUIBridge.
 
Method Summary
 void add(String id, U uiValue)
          Adds a new UIValue that gets its resource from this bridge.
 UIBridge<V,U> getBridge(String id)
          Searches the bridge that handles resources with the key id.
 void put(String id, UIBridge<V,U> bridge)
          Specifies a bridge that handles all calls regarding id.
 void remove(String id, U uiValue)
          Removes a value from this bridge.
 void set(String id, V value, U uiValue)
          Called by the UIProperties when one resource or UIValue has been exchanged.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultiUIBridge

public MultiUIBridge(UIProperties<V,U,?> manager)
Creates a new MultiUIBridge.

Parameters:
manager - the manager from whom this provider will get default colors when necessary
Method Detail

put

public void put(String id,
                UIBridge<V,U> bridge)
Specifies a bridge that handles all calls regarding id.

Parameters:
id - the key of the resource bridge should handle
bridge - the new bridge or null

getBridge

public UIBridge<V,U> getBridge(String id)
Searches the bridge that handles resources with the key id.

Parameters:
id - the key of the resources
Returns:
the responsible bridge or null

add

public void add(String id,
                U uiValue)
Description copied from interface: UIBridge
Adds a new UIValue that gets its resource from this bridge.

Specified by:
add in interface UIBridge<V,U extends UIValue<V>>
Parameters:
id - the id of the resource the new value needs
uiValue - a value that can be modified by this bride

remove

public void remove(String id,
                   U uiValue)
Description copied from interface: UIBridge
Removes a value from this bridge.

Specified by:
remove in interface UIBridge<V,U extends UIValue<V>>
Parameters:
id - the id of the resource the value needed
uiValue - the value that is no longer in use

set

public void set(String id,
                V value,
                U uiValue)
Description copied from interface: UIBridge
Called by the UIProperties when one resource or UIValue has been exchanged. Normally an UIBridge can just call UIValue.set(Object) with the argument value.
This method may also be called with an UIValue that was not added to this UIBridge.

Specified by:
set in interface UIBridge<V,U extends UIValue<V>>
Parameters:
id - the identifier of the resource
value - the new resource, can be null
uiValue - the value that is affected by the change