Class 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)
      Returns the Theme registered with this class under name, or null if there is no such registration.
      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 a Theme with this class under a certain name so that calling getRegisteredTheme(String) on that name will return this theme and calling getRegisteredThemes() will return a collection including this name.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • REGISTERED_THEMES

        private static final java.util.concurrent.ConcurrentHashMap<java.lang.String,​Theme> REGISTERED_THEMES
    • Constructor Detail

      • LanternaThemes

        private LanternaThemes()
    • 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 associated Theme object, please use getRegisteredTheme(String).
        Returns:
        Collection of theme names
      • getRegisteredTheme

        public static Theme getRegisteredTheme​(java.lang.String name)
        Returns the Theme registered with this class under name, or null if there is no such registration.
        Parameters:
        name - Name of the theme to retrieve
        Returns:
        Theme registered with the supplied name, or null if none
      • registerTheme

        public static void registerTheme​(java.lang.String name,
                                         Theme theme)
        Registers a Theme with this class under a certain name so that calling getRegisteredTheme(String) on that name will return this theme and calling getRegisteredThemes() will return a collection including this name.
        Parameters:
        name - Name to register the theme under
        theme - 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)