Class ThemeDelegate

java.lang.Object
com.github.weisj.darklaf.theme.Theme
com.github.weisj.darklaf.theme.ThemeDelegate
All Implemented Interfaces:
Serializable, Comparable<Theme>, Comparator<Theme>
Direct Known Subclasses:
RenamedTheme

public class ThemeDelegate extends Theme
See Also:
Serialized Form
  • Constructor Details

  • Method Details

    • getDelegate

      public Theme getDelegate()
    • getThemeClass

      public Class<? extends Theme> getThemeClass()
      Overrides:
      getThemeClass in class Theme
    • appearsEqualTo

      public boolean appearsEqualTo(Theme theme)
      Description copied from class: Theme
      Returns whether the appearance of the given theme is equal to the appearance if [this].
      Overrides:
      appearsEqualTo in class Theme
      Parameters:
      theme - the other theme.
      Returns:
      true if they appear equal.
    • derive

      public Theme derive(FontSizeRule fontSizeRule, AccentColorRule accentColorRule)
      Description copied from class: Theme
      Create a derived theme with the given FontSizeRule and AccentColorRule.
      Overrides:
      derive in class Theme
      Parameters:
      fontSizeRule - the font size rule.
      accentColorRule - the accent color rule.
      Returns:
      the derived theme.
    • copy

      public Theme copy()
      Description copied from class: Theme
      Creates a copy of this theme. This is not equivalent to Object.clone() in the sense that clone().getClass() == this.getClass() and copy().getClass() != this.getClass(). Nonetheless the copy theme behaves exactly the same as the original.
      Overrides:
      copy in class Theme
      Returns:
      a copy of the theme.
    • getFontSizeRule

      public FontSizeRule getFontSizeRule()
      Description copied from class: Theme
      Get the font size rule for this theme.
      Overrides:
      getFontSizeRule in class Theme
      Returns:
      the font size rule.
    • getAccentColorRule

      public AccentColorRule getAccentColorRule()
      Description copied from class: Theme
      Get the accent color rule.
      Overrides:
      getAccentColorRule in class Theme
      Returns:
      the accent color rule.
    • getColorToneRule

      public ColorToneRule getColorToneRule()
      Description copied from class: Theme
      Returns the style rule for this theme.
      Specified by:
      getColorToneRule in class Theme
      Returns:
      the style rule.
    • getContrastRule

      public ContrastRule getContrastRule()
      Description copied from class: Theme
      Returns contrast rule for the theme.
      Overrides:
      getContrastRule in class Theme
      Returns:
      the contrast rule.
    • getPresetIconRule

      protected PresetIconRule getPresetIconRule()
      Description copied from class: Theme
      The preset icon theme.
      Specified by:
      getPresetIconRule in class Theme
      Returns:
      the icon theme.
    • loadDefaults

      public void loadDefaults(Properties properties, UIDefaults currentDefaults)
      Description copied from class: Theme
      Load the theme defaults.

      Note: When overwriting a theme you also have overwrite Theme.getLoaderClass() to return the class of the theme you are overwriting. In this case you should use Theme.loadWithClass(String, Class) instead of Theme.load(String).

      Overrides:
      loadDefaults in class Theme
      Parameters:
      properties - the properties to load the values into.
      currentDefaults - the current ui defaults.
    • customizeGlobals

      public void customizeGlobals(Properties properties, UIDefaults currentDefaults)
      Description copied from class: Theme
      Customize the global values.

      Note: When overwriting a theme you also have overwrite Theme.getLoaderClass() to return the class of the theme you are overwriting. In this case you should use Theme.loadWithClass(String, Class) instead of Theme.load(String).

      Overrides:
      customizeGlobals in class Theme
      Parameters:
      properties - the properties to load the values into.
      currentDefaults - the current ui defaults.
    • customizeIconTheme

      public void customizeIconTheme(Properties properties, UIDefaults currentDefaults)
      Description copied from class: Theme
      Customize the icon defaults.

      Note: When overwriting a theme you also have overwrite Theme.getLoaderClass() to return the class of the theme you are overwriting. In this case you should use Theme.loadWithClass(String, Class) instead of Theme.load(String).

      Overrides:
      customizeIconTheme in class Theme
      Parameters:
      properties - the properties to load the value into.
      currentDefaults - the current ui defaults.
    • loadIconTheme

      public void loadIconTheme(Properties properties, UIDefaults currentDefaults)
      Description copied from class: Theme
      Load the general properties file for the icon themes.

      Note: When overwriting a theme you also have overwrite Theme.getLoaderClass() to return the class of the theme you are overwriting. In this case you should use Theme.loadWithClass(String, Class) instead of Theme.load(String).

      Overrides:
      loadIconTheme in class Theme
      Parameters:
      properties - the properties to load the value into.
      currentDefaults - the current ui defaults.
    • customizePlatformProperties

      public void customizePlatformProperties(Properties properties, UIDefaults currentDefaults)
      Description copied from class: Theme
      Customize the platform defaults.

      Note: When overwriting a theme you should use Theme.loadWithClass(String, Class) instead of Theme.load(String).

      Overrides:
      customizePlatformProperties in class Theme
      Parameters:
      properties - the properties to load the values into.
      currentDefaults - the current ui defaults.
    • customizeUIProperties

      public void customizeUIProperties(Properties properties, UIDefaults currentDefaults)
      Description copied from class: Theme
      Customize the ui defaults.

      Note: When overwriting a theme you should use Theme.loadWithClass(String, Class) instead of Theme.load(String).

      Overrides:
      customizeUIProperties in class Theme
      Parameters:
      properties - the properties to load the values into.
      currentDefaults - the current ui defaults.
    • getResourcePath

      protected String getResourcePath()
      Description copied from class: Theme
      The path to the resource location relative to the classpath of Theme.getLoaderClass().
      Overrides:
      getResourcePath in class Theme
      Returns:
      the relative resource path
    • getPrefix

      public String getPrefix()
      Description copied from class: Theme
      Get the prefix for resource loading.
      Specified by:
      getPrefix in class Theme
      Returns:
      the prefix for loading resources.
    • getName

      public String getName()
      Description copied from class: Theme
      Get the name of this theme.
      Specified by:
      getName in class Theme
      Returns:
      the name of the theme.
    • getDisplayName

      public String getDisplayName()
      Description copied from class: Theme
      Get the display name of this theme.
      Overrides:
      getDisplayName in class Theme
      Returns:
      the display name of the theme.
    • getLoaderClass

      protected Class<? extends Theme> getLoaderClass()
      Description copied from class: Theme
      The class used to determine the runtime location of resources. It is advised to explicitly return the class instead of using Object.getClass() to protect against extending the theme.
      Specified by:
      getLoaderClass in class Theme
      Returns:
      the loader class.
    • getPropertyFilePath

      protected String getPropertyFilePath(String name)
      Description copied from class: Theme
      Get the path for the file [prefix]_[name].properties in the themes resource location.
      Overrides:
      getPropertyFilePath in class Theme
      Parameters:
      name - the of the file.
      Returns:
      the path relative to the location of Theme.getLoaderClass().
    • useCustomDecorations

      public boolean useCustomDecorations()
      Description copied from class: Theme
      Returns whether this theme should use custom decorations if available.
      Overrides:
      useCustomDecorations in class Theme
      Returns:
      true if decoration should be used.
    • supportsCustomSelectionColor

      public boolean supportsCustomSelectionColor()
      Description copied from class: Theme
      Returns whether this theme supports custom selection colors.
      Overrides:
      supportsCustomSelectionColor in class Theme
      Returns:
      true if supported.
    • supportsCustomAccentColor

      public boolean supportsCustomAccentColor()
      Description copied from class: Theme
      Returns whether this theme supports custom accent colors.
      Overrides:
      supportsCustomAccentColor in class Theme
      Returns:
      true if supported.