- java.lang.Object
-
- com.googlecode.lanterna.bundle.LanternaThemes
-
public class LanternaThemes extends java.lang.Object
Catalog of available themes, this class will initially contain the themes bundled with Lanterna but it is possible to add additional themes as well.
-
-
Field Summary
Fields Modifier and Type Field Description private static java.util.concurrent.ConcurrentHashMap<java.lang.String,Theme>
REGISTERED_THEMES
-
Constructor Summary
Constructors Modifier Constructor Description private
LanternaThemes()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Theme
getDefaultTheme()
Returns lanterna's default theme which is used if no other theme is selected.static Theme
getRegisteredTheme(java.lang.String name)
static java.util.Collection<java.lang.String>
getRegisteredThemes()
Returns a collection of all themes registered with this class, by their name.private static java.util.Properties
loadPropTheme(java.lang.String resourceFileName)
private static void
registerPropTheme(java.lang.String name, java.util.Properties properties)
static void
registerTheme(java.lang.String name, Theme theme)
Registers aTheme
with this class under a certain name so that callinggetRegisteredTheme(String)
on that name will return this theme and callinggetRegisteredThemes()
will return a collection including this name.
-
-
-
Field Detail
-
REGISTERED_THEMES
private static final java.util.concurrent.ConcurrentHashMap<java.lang.String,Theme> REGISTERED_THEMES
-
-
Method Detail
-
getRegisteredThemes
public static java.util.Collection<java.lang.String> getRegisteredThemes()
Returns a collection of all themes registered with this class, by their name. To get the associatedTheme
object, please usegetRegisteredTheme(String)
.- Returns:
- Collection of theme names
-
getRegisteredTheme
public static Theme getRegisteredTheme(java.lang.String name)
- Parameters:
name
- Name of the theme to retrieve- Returns:
Theme
registered with the supplied name, ornull
if none
-
registerTheme
public static void registerTheme(java.lang.String name, Theme theme)
Registers aTheme
with this class under a certain name so that callinggetRegisteredTheme(String)
on that name will return this theme and callinggetRegisteredThemes()
will return a collection including this name.- Parameters:
name
- Name to register the theme undertheme
- Theme to register with this name
-
getDefaultTheme
public static Theme getDefaultTheme()
Returns lanterna's default theme which is used if no other theme is selected.- Returns:
- Lanterna's default theme, as a
Theme
-
registerPropTheme
private static void registerPropTheme(java.lang.String name, java.util.Properties properties)
-
loadPropTheme
private static java.util.Properties loadPropTheme(java.lang.String resourceFileName)
-
-