bibliothek.gui.dock.themes
Class BasicTheme

java.lang.Object
  extended by bibliothek.gui.dock.themes.BasicTheme
All Implemented Interfaces:
DockTheme
Direct Known Subclasses:
BubbleTheme, EclipseTheme, FlatTheme, SmoothTheme

public class BasicTheme
extends Object
implements DockTheme

A theme that does not install anything and uses the default-implementations off all factories. It is possible to replace any of the factories.

Author:
Benjamin Sigg

Field Summary
static PropertyKey<ColorScheme> BASIC_COLOR_SCHEME
          the key to set the ColorScheme of this theme
 
Fields inherited from interface bibliothek.gui.DockTheme
BACKGROUND_PAINT, BORDER_MODIFIER, COMBINER, DISPLAYER_FACTORY, DOCKABLE_MOVING_IMAGE_FACTORY, DOCKABLE_SELECTION, SPAN_FACTORY, STATION_PAINT
 
Constructor Summary
BasicTheme()
          Creates a new BasicTheme.
 
Method Summary
 ColorScheme getColorScheme()
          Gets the currently used color scheme
 Combiner getCombiner(DockStation station)
          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.
 DockController getController()
          Gets the currently installed controller
 DisplayerFactory getDisplayFactory(DockStation station)
          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.
 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.
This method should not be invoked directly, instead the property key DockTheme.DOCKABLE_MOVING_IMAGE_FACTORY should be used.
 StationPaint getPaint(DockStation station)
          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.
 TabPlacement getTabPlacement()
          Gets the side at which tabs are displayed.
 DockTitleFactory getTitleFactory(DockController controller)
          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.
protected  void install(DockController controller)
          Installs the basic items of this theme, ignoring any DockThemeExtension.
 void install(DockController controller, DockThemeExtension[] extensions)
          Install this theme at controller.
 void setColorScheme(ColorScheme colorScheme)
          Sets the currently used set of colors.
protected  void setColorSchemeKey(PropertyKey<ColorScheme> key)
          Sets the key that will be used to read the ColorScheme of this theme from the DockProperties.
 void setCombiner(Combiner combiner)
          Sets the Combiner of this theme.
 void setCombiner(Combiner combiner, Priority priority)
          Sets the Combiner of this theme.
 void setDisplayerFactory(DisplayerFactory factory)
          Sets the DisplayerFactory of this theme.
 void setDisplayerFactory(DisplayerFactory factory, Priority priority)
          Sets the DisplayerFactory of this theme.
 void setDockableSelection(DockableSelection selection)
          Sets how the user can select the focused Dockable.
 void setDockableSelection(DockableSelection selection, Priority priority)
          Sets how the user can select the focused Dockable.
 void setMovingImageFactory(DockableMovingImageFactory movingImage)
          Sets the movingImage-property.
 void setMovingImageFactory(DockableMovingImageFactory movingImage, Priority priority)
          Sets the movingImage-property.
 void setPaint(StationPaint paint)
          Sets the StationPaint of this theme.
 void setPaint(StationPaint paint, Priority priority)
          Sets the StationPaint of this theme.
 void setSpanFactory(SpanFactory factory)
          Sets the factory which will be used to create new Spans.
 void setSpanFactory(SpanFactory factory, Priority priority)
          Sets the factory which will be used to create new Spans.
 void setStackDockComponentFactory(StackDockComponentFactory stackDockComponentFactory)
          Sets the factory which will be used to create components for StackDockStation.
 void setStackDockComponentFactory(StackDockComponentFactory stackDockComponentFactory, Priority priority)
          Sets the factory which will be used to create components for StackDockStation.
 void setTabPlacement(TabPlacement tabPlacement)
          Sets the side at which tabs are to be displayed.
 void setTabPlacement(TabPlacement tabPlacement, Priority priority)
          Sets the side at which tabs are to be displayed.
 void setTitleFactory(DockTitleFactory titleFactory)
          Sets the DockTitleFactory of this station.
 void setTitleFactory(DockTitleFactory titleFactory, Priority priority)
          Sets the DockTitleFactory of this station.
 void uninstall(DockController controller)
          Uninstalls this theme from controller.
protected  void updateColors()
          Called when the the colors of the ColorManager have to be updated.
 void updateUI()
          Called when the LookAndFeel changed, should update colors, fonts, ...
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BASIC_COLOR_SCHEME

public static final PropertyKey<ColorScheme> BASIC_COLOR_SCHEME
the key to set the ColorScheme of this theme

Constructor Detail

BasicTheme

public BasicTheme()
Creates a new BasicTheme.

Method Detail

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 the basic items of this theme, ignoring any DockThemeExtension.

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

updateUI

public void updateUI()
Called when the LookAndFeel changed, should update colors, fonts, ...


updateColors

protected void updateColors()
Called when the the colors of the ColorManager have to be updated. This method reads the current ColorScheme and installs it using UIProperties.setScheme(Priority, bibliothek.gui.dock.util.UIScheme) with a priority of Priority.CLIENT.
This method changed its behavior in version 1.1.0p3, subclasses no longer need to override it. All colors can now be created lazily and automatically in exactly the moment when they are needed.


getController

public DockController getController()
Gets the currently installed controller

Returns:
the controller

setColorSchemeKey

protected void setColorSchemeKey(PropertyKey<ColorScheme> key)
Sets the key that will be used to read the ColorScheme of this theme from the DockProperties.

Parameters:
key - the new key, not null
See Also:
setColorScheme(ColorScheme)

setColorScheme

public void setColorScheme(ColorScheme colorScheme)
Sets the currently used set of colors. The colors of all DockControllers will change immediately.

Parameters:
colorScheme - the new scheme, null will activate the default color scheme.

getColorScheme

public ColorScheme getColorScheme()
Gets the currently used color scheme

Returns:
the scheme

setStackDockComponentFactory

public void setStackDockComponentFactory(StackDockComponentFactory stackDockComponentFactory)
Sets the factory which will be used to create components for StackDockStation. Note that this property has to be set before the theme is installed. Otherwise it will take no effect.

Parameters:
stackDockComponentFactory - the factory or null

setStackDockComponentFactory

public void setStackDockComponentFactory(StackDockComponentFactory stackDockComponentFactory,
                                         Priority priority)
Sets the factory which will be used to create components for StackDockStation. Note that this property has to be set before the theme is installed. Otherwise it will take no effect.

Parameters:
stackDockComponentFactory - the factory or null
priority - the importance of the new setting (whether it should override existing settings or not).

setSpanFactory

public void setSpanFactory(SpanFactory factory)
Sets the factory which will be used to create new Spans. Note that this property has to be set before the theme is installed, otherwise it will take not effect.

Parameters:
factory - the new factory, can be null

setSpanFactory

public void setSpanFactory(SpanFactory factory,
                           Priority priority)
Sets the factory which will be used to create new Spans. Note that this property has to be set before the theme is installed. Otherwise it will take no effect.

Parameters:
factory - the factory or null
priority - the imprtance of the new setting (whether it should override existing settings or not).

setMovingImageFactory

public void setMovingImageFactory(DockableMovingImageFactory movingImage)
Sets the movingImage-property. The movignImage is needed to show an image when the user grabs a Dockable

Parameters:
movingImage - the new factory

setMovingImageFactory

public void setMovingImageFactory(DockableMovingImageFactory movingImage,
                                  Priority priority)
Sets the movingImage-property. The movignImage is needed to show an image when the user grabs a Dockable

Parameters:
movingImage - the new factory
priority - the importance of the new setting (whether it should override existing settings or not).

setCombiner

public void setCombiner(Combiner combiner)
Sets the Combiner of this theme. The combiner is used to merge two Dockables.

Parameters:
combiner - the combiner

setCombiner

public void setCombiner(Combiner combiner,
                        Priority priority)
Sets the Combiner of this theme. The combiner is used to merge two Dockables.

Parameters:
combiner - the combiner
priority - the importance of the new setting (whether it should override existing settings or not).

setPaint

public void setPaint(StationPaint paint)
Sets the StationPaint of this theme. The paint is used to draw markings on stations.

Parameters:
paint - the paint

setPaint

public void setPaint(StationPaint paint,
                     Priority priority)
Sets the StationPaint of this theme. The paint is used to draw markings on stations.

Parameters:
paint - the paint
priority - the importance of the new setting (whether it should override existing settings or not).

setDisplayerFactory

public void setDisplayerFactory(DisplayerFactory factory)
Sets the DisplayerFactory of this theme. The factory is needed to create DockableDisplayer.

Parameters:
factory - the factory

setDisplayerFactory

public void setDisplayerFactory(DisplayerFactory factory,
                                Priority priority)
Sets the DisplayerFactory of this theme. The factory is needed to create DockableDisplayer.

Parameters:
factory - the factory
priority - the importance of the new setting (whether it should override existing settings or not).

setTitleFactory

public void setTitleFactory(DockTitleFactory titleFactory)
Sets the DockTitleFactory of this station. The factory is used to create DockTitles for some Dockables.

Parameters:
titleFactory - the factory

setTitleFactory

public void setTitleFactory(DockTitleFactory titleFactory,
                            Priority priority)
Sets the DockTitleFactory of this station. The factory is used to create DockTitles for some Dockables.

Parameters:
titleFactory - the factory
priority - the importance of the new setting (whether it should override existing settings or not).

setDockableSelection

public void setDockableSelection(DockableSelection selection)
Sets how the user can select the focused Dockable.

Parameters:
selection - the new selector

setDockableSelection

public void setDockableSelection(DockableSelection selection,
                                 Priority priority)
Sets how the user can select the focused Dockable.

Parameters:
selection - the new selector
priority - the importance of the new setting (whether it should override existing settings or not).

setTabPlacement

public void setTabPlacement(TabPlacement tabPlacement)
Sets the side at which tabs are to be displayed. This method has to be called before a DockController is installed, otherwise the settings has no effect.

Parameters:
tabPlacement - the side at which to show tabs, may be null to use the default value

setTabPlacement

public void setTabPlacement(TabPlacement tabPlacement,
                            Priority priority)
Sets the side at which tabs are to be displayed. This method has to be called before a DockController is installed, otherwise the settings has no effect.

Parameters:
tabPlacement - the side at which to show tabs, may be null to use the default value
priority - the importance of the new setting (whether it should override existing settings or not).

getTabPlacement

public TabPlacement getTabPlacement()
Gets the side at which tabs are displayed.

Returns:
the side with the tabs, may be null

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

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

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

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

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