Theme
PropertyTheme
public abstract class AbstractTheme extends Object implements Theme
Theme
implementation that manages a hierarchical tree of theme nodes ties to Class objects.
Sub-classes will inherit their theme properties from super-class definitions, the java.lang.Object class is
considered the root of the tree and as such is the fallback for all other classes.
You normally use this class through PropertyTheme
, which is the default implementation bundled with Lanterna.
Modifier | Constructor | Description |
---|---|---|
protected |
AbstractTheme(WindowPostRenderer postRenderer,
WindowDecorationRenderer decorationRenderer) |
Modifier and Type | Method | Description |
---|---|---|
protected boolean |
addStyle(String definition,
String style,
String value) |
|
List<String> |
findRedundantDeclarations() |
Returns a list of redundant theme entries in this theme.
|
ThemeDefinition |
getDefaultDefinition() |
Returns what this theme considers to be the default definition
|
ThemeDefinition |
getDefinition(Class<?> clazz) |
Returns the theme definition associated with this class.
|
WindowDecorationRenderer |
getWindowDecorationRenderer() |
Returns the
WindowDecorationRenderer 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.
|
protected static Object |
instanceByClassName(String className) |
protected AbstractTheme(WindowPostRenderer postRenderer, WindowDecorationRenderer decorationRenderer)
public ThemeDefinition getDefaultDefinition()
Theme
getDefaultDefinition
in interface Theme
public ThemeDefinition getDefinition(Class<?> clazz)
Theme
null
, it should always give back a valid value (falling back to the default is nothing
else can be used).getDefinition
in interface Theme
clazz
- Class to get the theme definition forpublic WindowPostRenderer getWindowPostRenderer()
Theme
null
, no post-renderer will be done (unless the GUI system or the windows
has a post-renderer).getWindowPostRenderer
in interface Theme
WindowPostRenderer
to invoke after drawing each window unless
overridden, or null
if nonepublic WindowDecorationRenderer getWindowDecorationRenderer()
Theme
WindowDecorationRenderer
to use for windows drawn in this theme. If null
then
lanterna will fall back to use DefaultWindowDecorationRenderer
.getWindowDecorationRenderer
in interface Theme
null
to use system defaultpublic List<String> findRedundantDeclarations()
Copyright © 2020. All rights reserved.