Class ThemeDelegate
- All Implemented Interfaces:
Serializable,Comparable<Theme>,Comparator<Theme>
- Direct Known Subclasses:
RenamedTheme
- See Also:
- Serialized Form
-
Constructor Summary
ConstructorsConstructorDescriptionThemeDelegate(Theme delegate)ThemeDelegate(Theme delegate, FontSizeRule fontSizeRule, 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)Customize the global values.voidcustomizeIconTheme(Properties properties, UIDefaults currentDefaults)Customize the icon defaults.voidcustomizePlatformProperties(Properties properties, UIDefaults currentDefaults)Customize the platform defaults.voidcustomizeUIProperties(Properties properties, UIDefaults currentDefaults)Customize the ui defaults.derive(FontSizeRule fontSizeRule, AccentColorRule accentColorRule)Create a derived theme with the givenFontSizeRuleandAccentColorRule.Get the accent color rule.Returns the style rule for this theme.Returns contrast rule for the theme.Get the display name of this theme.Get 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)Load the theme defaults.voidloadIconTheme(Properties properties, UIDefaults currentDefaults)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, compare, compareTo, equals, hashCode, isDark, isHighContrast, load, loadAccentProperties, loadCustomProperties, loadPropertyFile, loadPropertyFile, loadStyleSheet, loadWithClass, toString, withDisplayNameMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Comparator
reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Constructor Details
-
ThemeDelegate
-
ThemeDelegate
-
-
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
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
Description copied from class:ThemeGet the font size rule for this theme.- Overrides:
getFontSizeRulein classTheme- Returns:
- the font size rule.
-
getAccentColorRule
Description copied from class:ThemeGet the accent color rule.- Overrides:
getAccentColorRulein classTheme- Returns:
- the accent color rule.
-
getColorToneRule
Description copied from class:ThemeReturns the style rule for this theme.- Specified by:
getColorToneRulein classTheme- Returns:
- the style rule.
-
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
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.
-
customizeGlobals
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
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
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.
-
customizePlatformProperties
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
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.
-