Package generic.theme
Class StubThemeManager
java.lang.Object
generic.theme.ThemeManager
generic.theme.StubThemeManager
Version of ThemeManager that is used before an application or test installs a full
ApplicationThemeManager. Provides enough basic functionality used by the Gui class to
allow simple unit tests to run.
-
Field Summary
Fields inherited from class generic.theme.ThemeManager
activeLafType, activeTheme, applicationDefaults, currentValues, INSTANCE, javaDefaults, THEME_DIR, useDarkDefaults -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds the given theme to set of all themes.voiddeleteTheme(GTheme theme) Removes the theme from the set of all themes.protected voidReturns the active theme.Returns a set of all known themes.Returns theGThemeValueMapcontaining all the dark default values defined in theme.properties files.Returns theGThemeValueMapcontaining all the standard default values defined in theme.properties files.Returns aGThemeValueMapcontaining all default values for the current theme.Returns theGThemeValueMapcontaining all the default theme values defined by the currentLookAndFeel.Returns theLafTypefor the currently activeLookAndFeelReturns a set of all known themes that are supported on the current platform.Returns the known theme that has the given name.Returns the theme values as defined by the current theme, ignoring any unsaved changes that are currently applied to the application.booleanReturns true if there are any unsaved changes to the current theme.protected voidbooleanisChangedColor(String id) Returns true if the color associated with the given id has been changed from the current theme value for that id.booleanisChangedFont(String id) Returns true if the font associated with the given id has been changed from the current theme value for that id.booleanisChangedIcon(String id) Returns true if the Icon associated with the given id has been changed from the current theme value for that id.booleanReturns true if the current theme use dark default values.booleanReturns true if the current UI is using the Aqua Look and Feel.booleanReturns true if the given UI object is using the Aqua Look and Feel.booleanReturns true if 'Nimbus' is the current Look and Feelprotected ApplicationThemeDefaultsvoidregisterFont(Component component, String fontId) Binds the component to the font identified by the given font id.voidrestoreColor(String id) Restores the current color value for the given color id to the value established by the current theme.voidrestoreFont(String id) Restores the current font value for the given font id to the value established by the current theme.voidrestoreIcon(String id) Restores the current icon value for the given icon id to the value established by the current theme.voidRestores all the current application back to the values as specified by the active theme.voidsetColor(ColorValue newValue) Updates the current value for the color id in the newValuevoidUpdates the current value for the font id in the newValuevoidUpdates the current value for theIconid in the newValuevoidSets the application's active theme to the given theme.Methods inherited from class generic.theme.ThemeManager
addThemeListener, adjustFonts, buildCurrentValues, getColor, getCurrentValues, getDefaultTheme, getFont, getIcon, getInstance, getNonDefaultValues, hasColor, hasFont, hasIcon, hasThemeValueChanges, installInGui, isBlinkingCursors, isUpdatingTheme, isUsingFlatUI, notifyThemeChanged, registerFont, removeThemeListener, setBlinkingCursors, setColor, setFont, setIcon, setLookAndFeel, unRegisterFont, update
-
Constructor Details
-
StubThemeManager
public StubThemeManager()
-
-
Method Details
-
installPaletteColors
protected void installPaletteColors() -
restoreThemeValues
public void restoreThemeValues()Description copied from class:ThemeManagerRestores all the current application back to the values as specified by the active theme. In other words, reverts any changes to the active theme that haven't been saved.- Overrides:
restoreThemeValuesin classThemeManager
-
restoreColor
Description copied from class:ThemeManagerRestores the current color value for the given color id to the value established by the current theme.- Overrides:
restoreColorin classThemeManager- Parameters:
id- the color id to restore back to the original theme value
-
restoreFont
Description copied from class:ThemeManagerRestores the current font value for the given font id to the value established by the current theme.- Overrides:
restoreFontin classThemeManager- Parameters:
id- the font id to restore back to the original theme value
-
restoreIcon
Description copied from class:ThemeManagerRestores the current icon value for the given icon id to the value established by the current theme.- Overrides:
restoreIconin classThemeManager- Parameters:
id- the icon id to restore back to the original theme value
-
isChangedColor
Description copied from class:ThemeManagerReturns true if the color associated with the given id has been changed from the current theme value for that id.- Overrides:
isChangedColorin classThemeManager- Parameters:
id- the color id to check if it has been changed- Returns:
- true if the color associated with the given id has been changed from the current theme value for that id.
-
isChangedFont
Description copied from class:ThemeManagerReturns true if the font associated with the given id has been changed from the current theme value for that id.- Overrides:
isChangedFontin classThemeManager- Parameters:
id- the font id to check if it has been changed- Returns:
- true if the font associated with the given id has been changed from the current theme value for that id.
-
isChangedIcon
Description copied from class:ThemeManagerReturns true if the Icon associated with the given id has been changed from the current theme value for that id.- Overrides:
isChangedIconin classThemeManager- Parameters:
id- the Icon id to check if it has been changed- Returns:
- true if the Icon associated with the given id has been changed from the current theme value for that id.
-
setTheme
Description copied from class:ThemeManagerSets the application's active theme to the given theme.- Overrides:
setThemein classThemeManager- Parameters:
theme- the theme to make active
-
addTheme
Description copied from class:ThemeManagerAdds the given theme to set of all themes.- Overrides:
addThemein classThemeManager- Parameters:
newTheme- the theme to add
-
deleteTheme
Description copied from class:ThemeManagerRemoves the theme from the set of all themes. Also, if the theme has an associated file, the file will be deleted.- Overrides:
deleteThemein classThemeManager- Parameters:
theme- the theme to delete
-
getAllThemes
Description copied from class:ThemeManagerReturns a set of all known themes.- Overrides:
getAllThemesin classThemeManager- Returns:
- a set of all known themes.
-
getSupportedThemes
Description copied from class:ThemeManagerReturns a set of all known themes that are supported on the current platform.- Overrides:
getSupportedThemesin classThemeManager- Returns:
- a set of all known themes that are supported on the current platform.
-
getActiveTheme
Description copied from class:ThemeManagerReturns the active theme.- Overrides:
getActiveThemein classThemeManager- Returns:
- the active theme.
-
getLookAndFeelType
Description copied from class:ThemeManagerReturns theLafTypefor the currently activeLookAndFeel- Overrides:
getLookAndFeelTypein classThemeManager- Returns:
- the
LafTypefor the currently activeLookAndFeel
-
getTheme
Description copied from class:ThemeManagerReturns the known theme that has the given name.- Overrides:
getThemein classThemeManager- Parameters:
themeName- the name of the theme to retrieve- Returns:
- the known theme that has the given name
-
getThemeValues
Description copied from class:ThemeManagerReturns the theme values as defined by the current theme, ignoring any unsaved changes that are currently applied to the application.- Overrides:
getThemeValuesin classThemeManager- Returns:
- the theme values as defined by the current theme, ignoring any unsaved changes that are currently applied to the application
-
setFont
Description copied from class:ThemeManagerUpdates the current value for the font id in the newValue- Overrides:
setFontin classThemeManager- Parameters:
newValue- the newFontValueto install in the current values.
-
setColor
Description copied from class:ThemeManagerUpdates the current value for the color id in the newValue- Overrides:
setColorin classThemeManager- Parameters:
newValue- the newColorValueto install in the current values.
-
setIcon
Description copied from class:ThemeManagerUpdates the current value for theIconid in the newValue- Overrides:
setIconin classThemeManager- Parameters:
newValue- the newIconValueto install in the current values.
-
getJavaDefaults
Description copied from class:ThemeManagerReturns theGThemeValueMapcontaining all the default theme values defined by the currentLookAndFeel.- Overrides:
getJavaDefaultsin classThemeManager- Returns:
- the
GThemeValueMapcontaining all the default theme values defined by the currentLookAndFeel
-
getApplicationDarkDefaults
Description copied from class:ThemeManagerReturns theGThemeValueMapcontaining all the dark default values defined in theme.properties files. Note that dark defaults includes light defaults that haven't been overridden by a dark default with the same id.- Overrides:
getApplicationDarkDefaultsin classThemeManager- Returns:
- the
GThemeValueMapcontaining all the dark values defined in theme.properties files
-
getApplicationLightDefaults
Description copied from class:ThemeManagerReturns theGThemeValueMapcontaining all the standard default values defined in theme.properties files.- Overrides:
getApplicationLightDefaultsin classThemeManager- Returns:
- the
GThemeValueMapcontaining all the standard values defined in theme.properties files
-
getDefaults
Description copied from class:ThemeManagerReturns aGThemeValueMapcontaining all default values for the current theme. It is a combination of application defined defaults and javaLookAndFeeldefaults.- Overrides:
getDefaultsin classThemeManager- Returns:
- the current set of defaults.
-
isUsingAquaUI
Description copied from class:ThemeManagerReturns true if the given UI object is using the Aqua Look and Feel.- Overrides:
isUsingAquaUIin classThemeManager- Parameters:
UI- the UI to examine. (This parameter is ignored)- Returns:
- true if the UI is using Aqua
-
isUsingAquaUI
public boolean isUsingAquaUI()Description copied from class:ThemeManagerReturns true if the current UI is using the Aqua Look and Feel.- Overrides:
isUsingAquaUIin classThemeManager- Returns:
- true if the UI is using Aqua
-
isUsingNimbusUI
public boolean isUsingNimbusUI()Description copied from class:ThemeManagerReturns true if 'Nimbus' is the current Look and Feel- Overrides:
isUsingNimbusUIin classThemeManager- Returns:
- true if 'Nimbus' is the current Look and Feel
-
hasThemeChanges
public boolean hasThemeChanges()Description copied from class:ThemeManagerReturns true if there are any unsaved changes to the current theme.- Overrides:
hasThemeChangesin classThemeManager- Returns:
- true if there are any unsaved changes to the current theme.
-
registerFont
Description copied from class:ThemeManagerBinds the component to the font identified by the given font id. Whenever the font for the font id changes, the component will updated with the new font.- Overrides:
registerFontin classThemeManager- Parameters:
component- the component to set/update the fontfontId- the id of the font to register with the given component
-
isDarkTheme
public boolean isDarkTheme()Description copied from class:ThemeManagerReturns true if the current theme use dark default values.- Overrides:
isDarkThemein classThemeManager- Returns:
- true if the current theme use dark default values.
-
error
- Overrides:
errorin classThemeManager
-
loadApplicationDefaults
- Overrides:
loadApplicationDefaultsin classThemeManager
-