bibliothek.gui.dock.themes
Class ThemeManager

java.lang.Object
  extended by bibliothek.gui.dock.util.TypedUIProperties
      extended by bibliothek.gui.dock.themes.ThemeManager

public class ThemeManager
extends TypedUIProperties

The ThemeManager is responsible for collecting properties of the current DockTheme and redistribute them. The ThemeManager provides facilities for clients to modify and override properties of a theme without the need to access or change the DockTheme itself.

Author:
Benjamin Sigg

Nested Class Summary
 
Nested classes/interfaces inherited from class bibliothek.gui.dock.util.TypedUIProperties
TypedUIProperties.Type<T>
 
Field Summary
static String BACKGROUND_PAINT
          unique identifier for the basic BackgroundPaint
static TypedUIProperties.Type<BackgroundPaint> BACKGROUND_PAINT_TYPE
          Identifier for the type BackgroundPaint
static String BORDER_MODIFIER
          unique identifier for the basic BorderModifier
static TypedUIProperties.Type<BorderModifier> BORDER_MODIFIER_TYPE
          Identifier for the type BorderModifier
static String COMBINER
          unique identifier for the basic Combiner
static TypedUIProperties.Type<Combiner> COMBINER_TYPE
          Identifier for the type Combiner
static String DISPLAYER_FACTORY
          unique identifier for the basic DisplayerFactory
static TypedUIProperties.Type<DisplayerFactory> DISPLAYER_FACTORY_TYPE
          Identifier for the type DisplayerFactory
static String SPAN_FACTORY
          unique identifier for the basic SpanFactory
static TypedUIProperties.Type<SpanFactory> SPAN_FACTORY_TYPE
          Identifier for the type SpanFactory
static String STATION_PAINT
          unique identifier for the basic StationPaint
static TypedUIProperties.Type<StationPaint> STATION_PAINT_TYPE
          Identifier for a factory that creates StationPaints.
 
Constructor Summary
ThemeManager(DockController controller)
          Creates a new object
 
Method Summary
 void addUIListener(UIListener listener)
          Adds an UIListener to this manager, the listener gets notified when the graphical user interface needs an update because the LookAndFeel changed.
 DockTheme getTheme()
          Gets the current theme
 void init()
          Initializes this managere, must be called exactly once.
 void kill()
          Destroys this manager and releases resources.
<V,A extends V>
void
link(PropertyKey<A> source, TypedUIProperties.Type<V> type, String id)
          Creates a link between the property source and the entry id on the level Priority.THEME.
 void removeUIListener(UIListener listener)
          Removes a listener from this manager.
 void setBackgroundPaint(String id, BackgroundPaint value)
          Sets an algorithm that is used to paint the background of items which register an UIValue with an identifier of id.
 void setBackgroundPaintBridge(Path kind, UIBridge<BackgroundPaint,UIValue<BackgroundPaint>> bridge)
          Sets the UIBridge that will transfer properties to those UIValues whose kind is either kind or a child of kind.
 void setBorderModifier(String id, BorderModifier modifier)
          Sets a strategy that is used to modify the border of various components.
Valid identifiers can be, but are not restricted to: MiniButton.BORDER_KEY_NORMAL MiniButton.BORDER_KEY_NORMAL_SELECTED MiniButton.BORDER_KEY_MOUSE_OVER MiniButton.BORDER_KEY_MOUSE_OVER_SELECTED MiniButton.BORDER_KEY_MOUSE_PRESSED MiniButton.BORDER_KEY_MOUSE_PRESSED_SELECTED "dock.border".displayer.basic.base "dock.border".displayer.basic.content "dock.border".displayer.bubble "dock.border".displayer.eclipse.no_title.out "dock.border".displayer.eclipse.no_title.in "dock.border".displayer.eclipse "dock.border".displayer.eclipse.content "dock.border".screen.window "dock.border".stack.eclipse "dock.border".stack.eclipse.content "dock.border".title.button "dock.border".title.button.flat "dock.border".title.button.flat.hover "dock.border".title.button.flat.pressed "dock.border".title.button.flat.selected "dock.border".title.button.flat.selected.hover "dock.border".title.button.flat.selected.pressed "dock.border".title.button.selected "dock.border".title.button.pressed "dock.border".title.button.selected.pressed "dock.border".title.eclipse.button.flat "dock.border".title.flat "dock.border".title.station.basic "dock.border".title.tab
 void setBorderModifierBridge(Path kind, UIBridge<BorderModifier,UIValue<BorderModifier>> bridge)
          Sets the UIBridge that will transfer properties to those UIValues whose kind is either kind or a child of kind.
 void setCombiner(String id, Combiner value)
          Sets a strategy how two Dockables can be merged into a new Dockable.
 void setCombinerBridge(Path kind, UIBridge<Combiner,UIValue<Combiner>> bridge)
          Sets the UIBridge that will transfer properties to those UIValues whose kind is either kind or a child of kind.
 void setDisplayerFactory(String id, DisplayerFactory value)
          Sets a strategy how to display Dockables on a DockStation.
 void setDisplayerFactoryBridge(Path kind, UIBridge<DisplayerFactory,UIValue<DisplayerFactory>> bridge)
          Sets the UIBridge that will transfer properties to those UIValues whose kind is either kind or a child of kind.
 void setSpanFactory(String id, SpanFactory value)
          Sets a strategy to tell how to animate empty spaces when drag and dropping a Dockable.
 void setSpanFactoryBridge(Path kind, UIBridge<SpanFactory,UIValue<SpanFactory>> bridge)
          Sets the UIBridge that will transfer properties to those UIValues whose kind is either kind or a child of kind.
 void setStationPaint(String id, StationPaint value)
          Sets an algorithm to paint in the overlay panel of DockStations.
 void setStationPaintBridge(Path kind, UIBridge<StationPaint,UIValue<StationPaint>> bridge)
          Sets the UIBridge that will transfer properties to those UIValues whose kind is either kind or a child of kind.
 void setTheme(DockTheme theme)
          Sets the theme of this manager.
protected  UIListener[] uiListeners()
          Gets all the available UIListeners.
<V> void
unlink(TypedUIProperties.Type<V> type, String id)
          Disables a link between a property and the entry id.
 void updateUI()
          Informs all registered UIListeners that the user interface needs an update because the LookAndFeel changed.
 
Methods inherited from class bibliothek.gui.dock.util.TypedUIProperties
add, clear, get, getScheme, publish, put, registerType, remove, setScheme, unpublish, unpublish
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STATION_PAINT_TYPE

public static final TypedUIProperties.Type<StationPaint> STATION_PAINT_TYPE
Identifier for a factory that creates StationPaints.


STATION_PAINT

public static final String STATION_PAINT
unique identifier for the basic StationPaint

See Also:
Constant Field Values

COMBINER_TYPE

public static final TypedUIProperties.Type<Combiner> COMBINER_TYPE
Identifier for the type Combiner


COMBINER

public static final String COMBINER
unique identifier for the basic Combiner

See Also:
Constant Field Values

DISPLAYER_FACTORY_TYPE

public static final TypedUIProperties.Type<DisplayerFactory> DISPLAYER_FACTORY_TYPE
Identifier for the type DisplayerFactory


DISPLAYER_FACTORY

public static final String DISPLAYER_FACTORY
unique identifier for the basic DisplayerFactory

See Also:
Constant Field Values

BACKGROUND_PAINT_TYPE

public static final TypedUIProperties.Type<BackgroundPaint> BACKGROUND_PAINT_TYPE
Identifier for the type BackgroundPaint


BACKGROUND_PAINT

public static final String BACKGROUND_PAINT
unique identifier for the basic BackgroundPaint

See Also:
Constant Field Values

BORDER_MODIFIER_TYPE

public static final TypedUIProperties.Type<BorderModifier> BORDER_MODIFIER_TYPE
Identifier for the type BorderModifier


BORDER_MODIFIER

public static final String BORDER_MODIFIER
unique identifier for the basic BorderModifier

See Also:
Constant Field Values

SPAN_FACTORY_TYPE

public static final TypedUIProperties.Type<SpanFactory> SPAN_FACTORY_TYPE
Identifier for the type SpanFactory


SPAN_FACTORY

public static final String SPAN_FACTORY
unique identifier for the basic SpanFactory

See Also:
Constant Field Values
Constructor Detail

ThemeManager

public ThemeManager(DockController controller)
Creates a new object

Parameters:
controller - the owner of this manager, not null
Method Detail

init

public void init()
Initializes this managere, must be called exactly once.


kill

@FrameworkOnly
public void kill()
Destroys this manager and releases resources.


link

public <V,A extends V> void link(PropertyKey<A> source,
                                 TypedUIProperties.Type<V> type,
                                 String id)
Creates a link between the property source and the entry id on the level Priority.THEME.

Type Parameters:
V - the kind of property to read
A - the kind of entry to write
Parameters:
source - the key of the property to read
type - the type of the entry to write
id - the identifier of the entry to write

unlink

public <V> void unlink(TypedUIProperties.Type<V> type,
                       String id)
Disables a link between a property and the entry id.

Type Parameters:
V - the type
Parameters:
type - the type of the entry
id - the identifier of the entry to unlink
See Also:
link(PropertyKey, TypedUIProperties.Type, String)

addUIListener

public void addUIListener(UIListener listener)
Adds an UIListener to this manager, the listener gets notified when the graphical user interface needs an update because the LookAndFeel changed.

Parameters:
listener - the new listener

removeUIListener

public void removeUIListener(UIListener listener)
Removes a listener from this manager.

Parameters:
listener - the listener to remove

uiListeners

protected UIListener[] uiListeners()
Gets all the available UIListeners.

Returns:
the list of listeners

updateUI

public void updateUI()
Informs all registered UIListeners that the user interface needs an update because the LookAndFeel changed.

See Also:
addUIListener(UIListener), removeUIListener(UIListener)

getTheme

public DockTheme getTheme()
Gets the current theme

Returns:
the theme

setTheme

public void setTheme(DockTheme theme)
Sets the theme of this manager. This method fires events on registered UIListeners and ensures that all DockStations receive the update

Parameters:
theme - the new theme

setStationPaint

public void setStationPaint(String id,
                            StationPaint value)
Sets an algorithm to paint in the overlay panel of DockStations. Possible identifiers can be, but are not restricted to:

Parameters:
id - the identifier of the stations that should use vallue
value - the new algorithm or null

setStationPaintBridge

public void setStationPaintBridge(Path kind,
                                  UIBridge<StationPaint,UIValue<StationPaint>> bridge)
Sets the UIBridge that will transfer properties to those UIValues whose kind is either kind or a child of kind.

Parameters:
kind - the kind of UIValue bridge will handle
bridge - the new bridge or null

setCombiner

public void setCombiner(String id,
                        Combiner value)
Sets a strategy how two Dockables can be merged into a new Dockable. Valid identifiers may be, but are not restricted to:

Parameters:
id - the identifier of the item that uses value
value - the new strategy, can be null

setCombinerBridge

public void setCombinerBridge(Path kind,
                              UIBridge<Combiner,UIValue<Combiner>> bridge)
Sets the UIBridge that will transfer properties to those UIValues whose kind is either kind or a child of kind.

Parameters:
kind - the kind of UIValue bridge will handle
bridge - the new bridge or null

setDisplayerFactory

public void setDisplayerFactory(String id,
                                DisplayerFactory value)
Sets a strategy how to display Dockables on a DockStation. Valid identifiers can be, but are not restricted to:

Parameters:
id - the identifier of the item that uses value
value - the new strategy, can be null

setDisplayerFactoryBridge

public void setDisplayerFactoryBridge(Path kind,
                                      UIBridge<DisplayerFactory,UIValue<DisplayerFactory>> bridge)
Sets the UIBridge that will transfer properties to those UIValues whose kind is either kind or a child of kind.

Parameters:
kind - the kind of UIValue bridge will handle
bridge - the new bridge or null

setSpanFactory

public void setSpanFactory(String id,
                           SpanFactory value)
Sets a strategy to tell how to animate empty spaces when drag and dropping a Dockable. Valid identifiers can be, but are not restricted to:

Parameters:
id - the identifier of the item that uses value
value - the new strategy, can be null

setSpanFactoryBridge

public void setSpanFactoryBridge(Path kind,
                                 UIBridge<SpanFactory,UIValue<SpanFactory>> bridge)
Sets the UIBridge that will transfer properties to those UIValues whose kind is either kind or a child of kind.

Parameters:
kind - the kind of UIValue bridge will handle
bridge - the new bridge or null

setBackgroundPaint

@ClientOnly
public void setBackgroundPaint(String id,
                                          BackgroundPaint value)
Sets an algorithm that is used to paint the background of items which register an UIValue with an identifier of id. Valid identifier can be, but are not restricted to:

Parameters:
id - the identifier of the items that should use value
value - the new background algorithm, can be null

setBackgroundPaintBridge

public void setBackgroundPaintBridge(Path kind,
                                     UIBridge<BackgroundPaint,UIValue<BackgroundPaint>> bridge)
Sets the UIBridge that will transfer properties to those UIValues whose kind is either kind or a child of kind.

Parameters:
kind - the kind of UIValue bridge will handle
bridge - the new bridge or null

setBorderModifier

public void setBorderModifier(String id,
                              BorderModifier modifier)
Sets a strategy that is used to modify the border of various components.
Valid identifiers can be, but are not restricted to:

Parameters:
id - the identifier of the items that should use modifier
modifier - the new strategy, can be null

setBorderModifierBridge

public void setBorderModifierBridge(Path kind,
                                    UIBridge<BorderModifier,UIValue<BorderModifier>> bridge)
Sets the UIBridge that will transfer properties to those UIValues whose kind is either kind or a child of kind.

Parameters:
kind - the kind of UIValue bridge will handle
bridge - the new bridge or null