- java.lang.Object
-
- com.googlecode.lanterna.graphics.AbstractTheme
-
- com.googlecode.lanterna.graphics.PropertyTheme
-
- All Implemented Interfaces:
Theme
- Direct Known Subclasses:
DefaultTheme
public class PropertyTheme extends AbstractTheme
Themeimplementation that stores the theme definition in a regular java Properties object. The format is:foreground = black background = white sgr = com.mypackage.mycomponent.MyClass.foreground = yellow com.mypackage.mycomponent.MyClass.background = white com.mypackage.mycomponent.MyClass.sgr = com.mypackage.mycomponent.MyClass.foreground[ACTIVE] = red com.mypackage.mycomponent.MyClass.background[ACTIVE] = black com.mypackage.mycomponent.MyClass.sgr[ACTIVE] = bold ...See the documentation onThemefor further information about different style categories that can be assigned. The foreground, background and sgr entries without a class specifier will be tied to the global fallback and is used if the libraries tries to apply a theme style that isn't specified in the Properties object and there is no other superclass specified either.
-
-
Constructor Summary
Constructors Constructor Description PropertyTheme(java.util.Properties properties)Creates a newPropertyThemethat is initialized by the properties passed in.PropertyTheme(java.util.Properties properties, boolean ignoreUnknownClasses)Creates a newPropertyThemethat is initialized by the properties value and optionally prevents it from throwing an exception if there are invalid definitions in the properties object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.lang.StringgetDefinition(java.lang.String propertyName)private java.lang.StringgetStyle(java.lang.String propertyName)-
Methods inherited from class com.googlecode.lanterna.graphics.AbstractTheme
addStyle, findRedundantDeclarations, getDefaultDefinition, getDefinition, getWindowDecorationRenderer, getWindowPostRenderer, instanceByClassName
-
-
-
-
Constructor Detail
-
PropertyTheme
public PropertyTheme(java.util.Properties properties)
Creates a newPropertyThemethat is initialized by the properties passed in. If the properties refer to a class that cannot be resolved, it will throwIllegalArgumentException.- Parameters:
properties- Properties to initialize this theme with
-
PropertyTheme
public PropertyTheme(java.util.Properties properties, boolean ignoreUnknownClasses)Creates a newPropertyThemethat is initialized by the properties value and optionally prevents it from throwing an exception if there are invalid definitions in the properties object.- Parameters:
properties- Properties to initialize this theme withignoreUnknownClasses- Iftrue, will not throw an exception if there is an invalid entry in the properties object
-
-