Class AbstractTheme

java.lang.Object
com.googlecode.lanterna.graphics.AbstractTheme
All Implemented Interfaces:
Theme
Direct Known Subclasses:
PropertyTheme

public abstract class AbstractTheme extends Object implements Theme
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.

  • Field Details

  • Constructor Details

  • Method Details

    • classloadStandardRenderersForGraal

      private void classloadStandardRenderersForGraal()
    • addStyle

      protected boolean addStyle(String definition, String style, String value)
    • getNode

      private AbstractTheme.ThemeTreeNode getNode(String definition)
    • getNode

      private AbstractTheme.ThemeTreeNode getNode(Class<?> definition)
    • getDefaultDefinition

      public ThemeDefinition getDefaultDefinition()
      Description copied from interface: Theme
      Returns what this theme considers to be the default definition
      Specified by:
      getDefaultDefinition in interface Theme
      Returns:
      The default theme definition
    • getDefinition

      public ThemeDefinition getDefinition(Class<?> clazz)
      Description copied from interface: Theme
      Returns the theme definition associated with this class. The implementation of Theme should ensure that this call never returns null, it should always give back a valid value (falling back to the default is nothing else can be used).
      Specified by:
      getDefinition in interface Theme
      Parameters:
      clazz - Class to get the theme definition for
      Returns:
      The ThemeDefinition for the class passed in
    • getWindowPostRenderer

      public WindowPostRenderer getWindowPostRenderer()
      Description copied from interface: Theme
      Returns a post-renderer to invoke after drawing each window, unless the GUI system or individual windows has their own renderers set. If null, no post-renderer will be done (unless the GUI system or the windows has a post-renderer).
      Specified by:
      getWindowPostRenderer in interface Theme
      Returns:
      A WindowPostRenderer to invoke after drawing each window unless overridden, or null if none
    • getWindowDecorationRenderer

      public WindowDecorationRenderer getWindowDecorationRenderer()
      Description copied from interface: Theme
      Returns the WindowDecorationRenderer to use for windows drawn in this theme. If null then lanterna will fall back to use DefaultWindowDecorationRenderer.
      Specified by:
      getWindowDecorationRenderer in interface Theme
      Returns:
      The decoration renderer to use for this theme, or null to use system default
    • instanceByClassName

      protected static Object instanceByClassName(String className)
    • findRedundantDeclarations

      public List<String> 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

      private void findRedundantDeclarations(List<String> result, AbstractTheme.ThemeTreeNode node)