Class ThemeDelegate
- All Implemented Interfaces:
Serializable,Comparable<Theme>
- Direct Known Subclasses:
RenamedTheme
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionThemeDelegate(Theme delegate) ThemeDelegate(Theme delegate, com.github.weisj.darklaf.theme.spec.FontSizeRule fontSizeRule, com.github.weisj.darklaf.theme.spec.FontPrototype fontPrototype, com.github.weisj.darklaf.theme.spec.AccentColorRule accentColorRule) -
Method Summary
Modifier and TypeMethodDescriptionbooleanappearsEqualTo(Theme theme) Returns whether the appearance of the given theme is equal to the appearance if [this].copy()Creates a copy of this theme.voidcustomizeGlobals(Properties properties, UIDefaults currentDefaults, com.github.weisj.darklaf.properties.icons.IconResolver iconResolver) Customize the global values.voidcustomizeIconTheme(Properties properties, UIDefaults currentDefaults, com.github.weisj.darklaf.properties.icons.IconResolver iconResolver) Customize the icon defaults.voidcustomizePlatformProperties(Properties properties, UIDefaults currentDefaults, com.github.weisj.darklaf.properties.icons.IconResolver iconResolver) Customize the platform defaults.voidcustomizeUIProperties(Properties properties, UIDefaults currentDefaults, com.github.weisj.darklaf.properties.icons.IconResolver iconResolver) Customize the ui defaults.derive(com.github.weisj.darklaf.theme.spec.FontSizeRule fontSizeRule, com.github.weisj.darklaf.theme.spec.FontPrototype fontPrototype, com.github.weisj.darklaf.theme.spec.AccentColorRule accentColorRule) Create a derived theme with the givenFontSizeRuleandAccentColorRule.com.github.weisj.darklaf.theme.spec.AccentColorRuleGet the accent color rule.com.github.weisj.darklaf.theme.spec.ColorToneRuleReturns the style rule for this theme.com.github.weisj.darklaf.theme.spec.ContrastRuleReturns contrast rule for the theme.Get the display name of this theme.com.github.weisj.darklaf.theme.spec.FontPrototypeGet the font prototype.com.github.weisj.darklaf.theme.spec.FontSizeRuleGet the font size rule for this theme.The class used to determine the runtime location of resources.getName()Get the name of this theme.Get the prefix for resource loading.protected PresetIconRuleThe preset icon theme.protected StringgetPropertyFilePath(String name) Get the path for the file [prefix]_[name].properties in the themes resource location.protected StringThe path to the resource location relative to the classpath ofTheme.getLoaderClass().voidloadDefaults(Properties properties, UIDefaults currentDefaults, com.github.weisj.darklaf.properties.icons.IconResolver iconResolver) Load the theme defaults.voidloadIconTheme(Properties properties, UIDefaults currentDefaults, com.github.weisj.darklaf.properties.icons.IconResolver iconResolver) Load the general properties file for the icon themes.booleanReturns whether this theme supports custom accent colors.booleanReturns whether this theme supports custom selection colors.booleanReturns whether this theme should use custom decorations if available.Methods inherited from class com.github.weisj.darklaf.theme.Theme
baseThemeOf, compareTo, equals, hashCode, isDark, isHighContrast, load, loadAccentProperties, loadCustomProperties, loadPropertyFile, loadPropertyFile, loadStyleSheet, loadWithClass, toString, withDisplayName
-
Constructor Details
-
ThemeDelegate
-
ThemeDelegate
public ThemeDelegate(Theme delegate, com.github.weisj.darklaf.theme.spec.FontSizeRule fontSizeRule, com.github.weisj.darklaf.theme.spec.FontPrototype fontPrototype, com.github.weisj.darklaf.theme.spec.AccentColorRule accentColorRule)
-
-
Method Details
-
getDelegate
-
getThemeClass
- Overrides:
getThemeClassin classTheme
-
appearsEqualTo
Description copied from class:ThemeReturns whether the appearance of the given theme is equal to the appearance if [this].- Overrides:
appearsEqualToin classTheme- Parameters:
theme- the other theme.- Returns:
- true if they appear equal.
-
derive
public Theme derive(com.github.weisj.darklaf.theme.spec.FontSizeRule fontSizeRule, com.github.weisj.darklaf.theme.spec.FontPrototype fontPrototype, com.github.weisj.darklaf.theme.spec.AccentColorRule accentColorRule) Description copied from class:ThemeCreate a derived theme with the givenFontSizeRuleandAccentColorRule. -
copy
Description copied from class:ThemeCreates a copy of this theme. This is not equivalent toObject.clone()in the sense thatclone().getClass() == this.getClass()andcopy().getClass() != this.getClass(). Nonetheless the copy theme behaves exactly the same as the original. -
getFontSizeRule
public com.github.weisj.darklaf.theme.spec.FontSizeRule getFontSizeRule()Description copied from class:ThemeGet the font size rule for this theme.- Overrides:
getFontSizeRulein classTheme- Returns:
- the font size rule.
-
getAccentColorRule
public com.github.weisj.darklaf.theme.spec.AccentColorRule getAccentColorRule()Description copied from class:ThemeGet the accent color rule.- Overrides:
getAccentColorRulein classTheme- Returns:
- the accent color rule.
-
getFontPrototype
public com.github.weisj.darklaf.theme.spec.FontPrototype getFontPrototype()Description copied from class:ThemeGet the font prototype.- Overrides:
getFontPrototypein classTheme- Returns:
- the font prototype
-
getColorToneRule
public com.github.weisj.darklaf.theme.spec.ColorToneRule getColorToneRule()Description copied from class:ThemeReturns the style rule for this theme.- Specified by:
getColorToneRulein classTheme- Returns:
- the style rule.
-
getContrastRule
public com.github.weisj.darklaf.theme.spec.ContrastRule getContrastRule()Description copied from class:ThemeReturns contrast rule for the theme.- Overrides:
getContrastRulein classTheme- Returns:
- the contrast rule.
-
getPresetIconRule
Description copied from class:ThemeThe preset icon theme.- Specified by:
getPresetIconRulein classTheme- Returns:
- the icon theme.
-
loadDefaults
public void loadDefaults(Properties properties, UIDefaults currentDefaults, com.github.weisj.darklaf.properties.icons.IconResolver iconResolver) Description copied from class:ThemeLoad 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 useTheme.loadWithClass(String, Class)instead ofTheme.load(String).- Overrides:
loadDefaultsin classTheme- Parameters:
properties- the properties to load the values into.currentDefaults- the current ui defaults.iconResolver- the icon resolver.
-
customizeGlobals
public void customizeGlobals(Properties properties, UIDefaults currentDefaults, com.github.weisj.darklaf.properties.icons.IconResolver iconResolver) Description copied from class:ThemeCustomize 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 useTheme.loadWithClass(String, Class)instead ofTheme.load(String).- Overrides:
customizeGlobalsin classTheme- Parameters:
properties- the properties to load the values into.currentDefaults- the current ui defaults.
-
customizeIconTheme
public void customizeIconTheme(Properties properties, UIDefaults currentDefaults, com.github.weisj.darklaf.properties.icons.IconResolver iconResolver) Description copied from class:ThemeCustomize 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 useTheme.loadWithClass(String, Class)instead ofTheme.load(String).- Overrides:
customizeIconThemein classTheme- Parameters:
properties- the properties to load the value into.currentDefaults- the current ui defaults.
-
loadIconTheme
public void loadIconTheme(Properties properties, UIDefaults currentDefaults, com.github.weisj.darklaf.properties.icons.IconResolver iconResolver) Description copied from class:ThemeLoad 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 useTheme.loadWithClass(String, Class)instead ofTheme.load(String).- Overrides:
loadIconThemein classTheme- Parameters:
properties- the properties to load the value into.currentDefaults- the current ui defaults.iconResolver- the icon resolver.
-
customizePlatformProperties
public void customizePlatformProperties(Properties properties, UIDefaults currentDefaults, com.github.weisj.darklaf.properties.icons.IconResolver iconResolver) Description copied from class:ThemeCustomize the platform defaults.Note: When overwriting a theme you should use
Theme.loadWithClass(String, Class)instead ofTheme.load(String).- Overrides:
customizePlatformPropertiesin classTheme- Parameters:
properties- the properties to load the values into.currentDefaults- the current ui defaults.
-
customizeUIProperties
public void customizeUIProperties(Properties properties, UIDefaults currentDefaults, com.github.weisj.darklaf.properties.icons.IconResolver iconResolver) Description copied from class:ThemeCustomize the ui defaults.Note: When overwriting a theme you should use
Theme.loadWithClass(String, Class)instead ofTheme.load(String).- Overrides:
customizeUIPropertiesin classTheme- Parameters:
properties- the properties to load the values into.currentDefaults- the current ui defaults.
-
getResourcePath
Description copied from class:ThemeThe path to the resource location relative to the classpath ofTheme.getLoaderClass().- Overrides:
getResourcePathin classTheme- Returns:
- the relative resource path
-
getPrefix
Description copied from class:ThemeGet the prefix for resource loading. -
getName
Description copied from class:ThemeGet the name of this theme. -
getDisplayName
Description copied from class:ThemeGet the display name of this theme.- Overrides:
getDisplayNamein classTheme- Returns:
- the display name of the theme.
-
getLoaderClass
Description copied from class:ThemeThe class used to determine the runtime location of resources. It is advised to explicitly return the class instead of usingObject.getClass()to protect against extending the theme.- Specified by:
getLoaderClassin classTheme- Returns:
- the loader class.
-
getPropertyFilePath
Description copied from class:ThemeGet the path for the file [prefix]_[name].properties in the themes resource location.- Overrides:
getPropertyFilePathin classTheme- Parameters:
name- the of the file.- Returns:
- the path relative to the location of
Theme.getLoaderClass().
-
useCustomDecorations
public boolean useCustomDecorations()Description copied from class:ThemeReturns whether this theme should use custom decorations if available.- Overrides:
useCustomDecorationsin classTheme- Returns:
- true if decoration should be used.
-
supportsCustomSelectionColor
public boolean supportsCustomSelectionColor()Description copied from class:ThemeReturns whether this theme supports custom selection colors.- Overrides:
supportsCustomSelectionColorin classTheme- Returns:
- true if supported.
-
supportsCustomAccentColor
public boolean supportsCustomAccentColor()Description copied from class:ThemeReturns whether this theme supports custom accent colors.- Overrides:
supportsCustomAccentColorin classTheme- Returns:
- true if supported.
-