bibliothek.gui.dock.common.theme
Class CDockTheme<D extends DockTheme>

java.lang.Object
  extended by bibliothek.gui.dock.common.theme.CDockTheme<D>
Type Parameters:
D - the kind of theme that is wrapped by this CDockTheme
All Implemented Interfaces:
DockTheme
Direct Known Subclasses:
CBasicTheme, CBubbleTheme, CEclipseTheme, CFlatTheme, CSmoothTheme

public class CDockTheme<D extends DockTheme>
extends java.lang.Object
implements DockTheme

A DockTheme that wraps another theme and works within the special environment the common-project provides.

Author:
Benjamin Sigg

Field Summary
 
Fields inherited from interface bibliothek.gui.DockTheme
BACKGROUND_PAINT, BORDER_MODIFIER, COMBINER, DISPLAYER_FACTORY, DOCKABLE_MOVING_IMAGE_FACTORY, DOCKABLE_SELECTION, STATION_PAINT
 
Constructor Summary
CDockTheme(D delegate)
          Creates a new theme
CDockTheme(D theme, DockTheme delegate)
          Creates a new theme.
 
Method Summary
 Combiner getCombiner(DockStation station)
          Gets the Combiner for station.
 DisplayerFactory getDisplayFactory(DockStation station)
          Gets a displayer factory for station.
 DockableSelection getDockableSelection(DockController controller)
          Gets a selector for Dockables.
 DockableMovingImageFactory getMovingImageFactory(DockController controller)
          Gets a factory for images which are moved around by the user.
 StationPaint getPaint(DockStation station)
          Gets the paint which is used to draw things onto station.
 DockTitleFactory getTitleFactory(DockController controller)
          Gets the default DockTitleFactory which is used if no other factory is set.
protected  void initDefaultFontBridges(CControl control)
          Adds the default FontBridgeFactorys to this theme.
protected  void install(DockController controller)
          Installs this theme at controller.
 void install(DockController controller, DockThemeExtension[] extensions)
          Install this theme at controller.
 D intern()
          Gets the internal representation of this theme.
 void putColorBridgeFactory(Path kind, ColorBridgeFactory factory)
          Sets the ColorBridge which should be used for a certain kind of DockColors.
 void putFontBridgeFactory(Path kind, FontBridgeFactory factory)
          Sets the FontBridge which should be used for a certain kind of DockFonts.
 void uninstall(DockController controller)
          Uninstalls this theme from controller.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CDockTheme

public CDockTheme(D delegate)
Creates a new theme

Parameters:
delegate - the theme to which all work is delegated

CDockTheme

public CDockTheme(D theme,
                  DockTheme delegate)
Creates a new theme.

Parameters:
theme - the theme which is represented by this CDockTheme.
delegate - the theme to which all work is delegated
Method Detail

initDefaultFontBridges

protected void initDefaultFontBridges(CControl control)
Adds the default FontBridgeFactorys to this theme.

Parameters:
control - the owner of this theme

intern

public D intern()
Gets the internal representation of this theme.

Returns:
the internal representation

getCombiner

public Combiner getCombiner(DockStation station)
Description copied from interface: DockTheme
Gets the Combiner for station.
This method should not be used directly, instead an UIValue of type StationCombinerValue should be installed at the local ThemeManager to retrieve the value.

Specified by:
getCombiner in interface DockTheme
Parameters:
station - the station whose combiner is searched
Returns:
a combiner for station

getDisplayFactory

public DisplayerFactory getDisplayFactory(DockStation station)
Description copied from interface: DockTheme
Gets a displayer factory for station.
This method should not be used directly, instead an UIValue of type DefaultDisplayerFactoryValue should be installed at the local ThemeManager to retrieve the value.

Specified by:
getDisplayFactory in interface DockTheme
Parameters:
station - the station on which the created DockableDisplayer is shown
Returns:
the factory to create displayer

getMovingImageFactory

public DockableMovingImageFactory getMovingImageFactory(DockController controller)
Description copied from interface: DockTheme
Gets a factory for images which are moved around by the user.
This method should not be invoked directly, instead the property key DockTheme.DOCKABLE_MOVING_IMAGE_FACTORY should be used.

Specified by:
getMovingImageFactory in interface DockTheme
Parameters:
controller - the controller for which the factory is needed
Returns:
a factory

getPaint

public StationPaint getPaint(DockStation station)
Description copied from interface: DockTheme
Gets the paint which is used to draw things onto station.
This method should not be used directly, instead an UIValue of type DefaultStationPaintValue should be installed at the local ThemeManager to retrieve the value.

Specified by:
getPaint in interface DockTheme
Parameters:
station - the station to paint on
Returns:
the paint for station

getTitleFactory

public DockTitleFactory getTitleFactory(DockController controller)
Description copied from interface: DockTheme
Gets the default DockTitleFactory which is used if no other factory is set.
The result of this method is installed in the DockTitleManager using the key DockTitleManager.THEME_FACTORY_ID and priority Priority.THEME. A theme may use the manager to change the factory at any time.

Specified by:
getTitleFactory in interface DockTheme
Parameters:
controller - the controller using this theme
Returns:
the factory

getDockableSelection

public DockableSelection getDockableSelection(DockController controller)
Description copied from interface: DockTheme
Gets a selector for Dockables. This method should not be invoked directly, instead the property key DockTheme.DOCKABLE_SELECTION should be used.

Specified by:
getDockableSelection in interface DockTheme
Parameters:
controller - the controller for which the selector will be used
Returns:
the selector

putColorBridgeFactory

public void putColorBridgeFactory(Path kind,
                                  ColorBridgeFactory factory)
Sets the ColorBridge which should be used for a certain kind of DockColors. The bridges will be installed with priority Priority.DEFAULT at all ColorManagers.

Parameters:
kind - the kind of DockColor the bridges will handle
factory - the factory for new bridges, can be null

putFontBridgeFactory

public void putFontBridgeFactory(Path kind,
                                 FontBridgeFactory factory)
Sets the FontBridge which should be used for a certain kind of DockFonts. The bridges will be installed with priority Priority.DEFAULT at all FontManagers.

Parameters:
kind - the kind of DockFont the bridges will handle
factory - the factory for new bridges, can be null

install

public void install(DockController controller,
                    DockThemeExtension[] extensions)
Description copied from interface: DockTheme
Install this theme at controller. The theme may change any properties it likes.

Specified by:
install in interface DockTheme
Parameters:
controller - the controller
extensions - a set of extensions specifically for this theme

install

protected void install(DockController controller)
Installs this theme at controller.

Parameters:
controller - the new owner of this theme

uninstall

public void uninstall(DockController controller)
Description copied from interface: DockTheme
Uninstalls this theme from controller. The theme has to remove all listeners it added.

Specified by:
uninstall in interface DockTheme
Parameters:
controller - the controller