- java.lang.Object
-
- com.googlecode.lanterna.graphics.DelegatingTheme
-
- All Implemented Interfaces:
Theme
public class DelegatingTheme extends java.lang.Object implements Theme
Allows you to more easily wrap an existing theme and alter the behaviour in some special cases. You normally create a new class that extends from this and override some of the methods to divert the call depending on what you are trying to do. For an example, please see Issue409 in the test code.- See Also:
DelegatingThemeDefinition
,DefaultMutableThemeStyle
,Theme
-
-
Constructor Summary
Constructors Constructor Description DelegatingTheme(Theme theme)
Creates a newDelegatingTheme
with a default implementation that will forward all calls to theTheme
that is passed in.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ThemeDefinition
getDefaultDefinition()
Returns what this theme considers to be the default definitionThemeDefinition
getDefinition(java.lang.Class<?> clazz)
Returns the theme definition associated with this class.WindowDecorationRenderer
getWindowDecorationRenderer()
Returns theWindowDecorationRenderer
to use for windows drawn in this theme.WindowPostRenderer
getWindowPostRenderer()
Returns a post-renderer to invoke after drawing each window, unless the GUI system or individual windows has their own renderers set.
-
-
-
Field Detail
-
theme
private final Theme theme
-
-
Constructor Detail
-
DelegatingTheme
public DelegatingTheme(Theme theme)
Creates a newDelegatingTheme
with a default implementation that will forward all calls to theTheme
that is passed in.- Parameters:
theme
- Other theme to delegate all calls to
-
-
Method Detail
-
getDefaultDefinition
public ThemeDefinition getDefaultDefinition()
Description copied from interface:Theme
Returns what this theme considers to be the default definition- Specified by:
getDefaultDefinition
in interfaceTheme
- Returns:
- The default theme definition
-
getDefinition
public ThemeDefinition getDefinition(java.lang.Class<?> clazz)
Description copied from interface:Theme
Returns the theme definition associated with this class. The implementation of Theme should ensure that this call never returnsnull
, it should always give back a valid value (falling back to the default is nothing else can be used).- Specified by:
getDefinition
in interfaceTheme
- Parameters:
clazz
- Class to get the theme definition for- Returns:
- The ThemeDefinition for the class passed in
-
getWindowPostRenderer
public WindowPostRenderer getWindowPostRenderer()
Description copied from interface:Theme
Returns a post-renderer to invoke after drawing each window, unless the GUI system or individual windows has their own renderers set. Ifnull
, no post-renderer will be done (unless the GUI system or the windows has a post-renderer).- Specified by:
getWindowPostRenderer
in interfaceTheme
- Returns:
- A
WindowPostRenderer
to invoke after drawing each window unless overridden, ornull
if none
-
getWindowDecorationRenderer
public WindowDecorationRenderer getWindowDecorationRenderer()
Description copied from interface:Theme
Returns theWindowDecorationRenderer
to use for windows drawn in this theme. Ifnull
then lanterna will fall back to useDefaultWindowDecorationRenderer
.- Specified by:
getWindowDecorationRenderer
in interfaceTheme
- Returns:
- The decoration renderer to use for this theme, or
null
to use system default
-
-