Class AbstractTheme
java.lang.Object
com.googlecode.lanterna.graphics.AbstractTheme
- All Implemented Interfaces:
Theme
- Direct Known Subclasses:
PropertyTheme
Abstract
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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate classprivate classprivate static class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final AbstractTheme.ThemeTreeNodeprivate static final Stringprivate static final Patternprivate static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate final WindowDecorationRendererprivate final WindowPostRenderer -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractTheme(WindowPostRenderer postRenderer, WindowDecorationRenderer decorationRenderer) -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanprivate voidReturns a list of redundant theme entries in this theme.private voidfindRedundantDeclarations(List<String> result, AbstractTheme.ThemeTreeNode node) Returns what this theme considers to be the default definitiongetDefinition(Class<?> clazz) Returns the theme definition associated with this class.private AbstractTheme.ThemeTreeNodeprivate AbstractTheme.ThemeTreeNodeReturns theWindowDecorationRendererto use for windows drawn in this theme.Returns a post-renderer to invoke after drawing each window, unless the GUI system or individual windows has their own renderers set.protected static ObjectinstanceByClassName(String className)
-
Field Details
-
STYLE_NORMAL
- See Also:
-
STYLE_PRELIGHT
- See Also:
-
STYLE_SELECTED
- See Also:
-
STYLE_ACTIVE
- See Also:
-
STYLE_INSENSITIVE
- See Also:
-
STYLE_FORMAT
-
rootNode
-
windowPostRenderer
-
windowDecorationRenderer
-
-
Constructor Details
-
AbstractTheme
protected AbstractTheme(WindowPostRenderer postRenderer, WindowDecorationRenderer decorationRenderer)
-
-
Method Details
-
classloadStandardRenderersForGraal
private void classloadStandardRenderersForGraal() -
addStyle
-
getNode
-
getNode
-
getDefaultDefinition
Description copied from interface:ThemeReturns what this theme considers to be the default definition- Specified by:
getDefaultDefinitionin interfaceTheme- Returns:
- The default theme definition
-
getDefinition
Description copied from interface:ThemeReturns 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:
getDefinitionin interfaceTheme- Parameters:
clazz- Class to get the theme definition for- Returns:
- The ThemeDefinition for the class passed in
-
getWindowPostRenderer
Description copied from interface:ThemeReturns 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:
getWindowPostRendererin interfaceTheme- Returns:
- A
WindowPostRendererto invoke after drawing each window unless overridden, ornullif none
-
getWindowDecorationRenderer
Description copied from interface:ThemeReturns theWindowDecorationRendererto use for windows drawn in this theme. Ifnullthen lanterna will fall back to useDefaultWindowDecorationRenderer.- Specified by:
getWindowDecorationRendererin interfaceTheme- Returns:
- The decoration renderer to use for this theme, or
nullto use system default
-
instanceByClassName
-
findRedundantDeclarations
Returns a list of redundant theme entries in this theme. A redundant entry means that it doesn't need to be specified because there is a parent node in the hierarchy which has the same property so if the redundant entry wasn't there, the parent node would be picked up and the end result would be the same.- Returns:
- List of redundant theme entries
-
findRedundantDeclarations
-