Package generic.theme

Class StubThemeManager

java.lang.Object
generic.theme.ThemeManager
generic.theme.StubThemeManager

public class StubThemeManager extends ThemeManager
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.
  • Constructor Details

    • StubThemeManager

      public StubThemeManager()
  • Method Details

    • installPaletteColors

      protected void installPaletteColors()
    • restoreThemeValues

      public void restoreThemeValues()
      Description copied from class: ThemeManager
      Restores 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:
      restoreThemeValues in class ThemeManager
    • restoreColor

      public void restoreColor(String id)
      Description copied from class: ThemeManager
      Restores the current color value for the given color id to the value established by the current theme.
      Overrides:
      restoreColor in class ThemeManager
      Parameters:
      id - the color id to restore back to the original theme value
    • restoreFont

      public void restoreFont(String id)
      Description copied from class: ThemeManager
      Restores the current font value for the given font id to the value established by the current theme.
      Overrides:
      restoreFont in class ThemeManager
      Parameters:
      id - the font id to restore back to the original theme value
    • restoreIcon

      public void restoreIcon(String id)
      Description copied from class: ThemeManager
      Restores the current icon value for the given icon id to the value established by the current theme.
      Overrides:
      restoreIcon in class ThemeManager
      Parameters:
      id - the icon id to restore back to the original theme value
    • isChangedColor

      public boolean isChangedColor(String id)
      Description copied from class: ThemeManager
      Returns true if the color associated with the given id has been changed from the current theme value for that id.
      Overrides:
      isChangedColor in class ThemeManager
      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

      public boolean isChangedFont(String id)
      Description copied from class: ThemeManager
      Returns true if the font associated with the given id has been changed from the current theme value for that id.
      Overrides:
      isChangedFont in class ThemeManager
      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

      public boolean isChangedIcon(String id)
      Description copied from class: ThemeManager
      Returns true if the Icon associated with the given id has been changed from the current theme value for that id.
      Overrides:
      isChangedIcon in class ThemeManager
      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

      public void setTheme(GTheme theme)
      Description copied from class: ThemeManager
      Sets the application's active theme to the given theme.
      Overrides:
      setTheme in class ThemeManager
      Parameters:
      theme - the theme to make active
    • addTheme

      public void addTheme(GTheme newTheme)
      Description copied from class: ThemeManager
      Adds the given theme to set of all themes.
      Overrides:
      addTheme in class ThemeManager
      Parameters:
      newTheme - the theme to add
    • deleteTheme

      public void deleteTheme(GTheme theme)
      Description copied from class: ThemeManager
      Removes the theme from the set of all themes. Also, if the theme has an associated file, the file will be deleted.
      Overrides:
      deleteTheme in class ThemeManager
      Parameters:
      theme - the theme to delete
    • getAllThemes

      public Set<GTheme> getAllThemes()
      Description copied from class: ThemeManager
      Returns a set of all known themes.
      Overrides:
      getAllThemes in class ThemeManager
      Returns:
      a set of all known themes.
    • getSupportedThemes

      public List<GTheme> getSupportedThemes()
      Description copied from class: ThemeManager
      Returns a set of all known themes that are supported on the current platform.
      Overrides:
      getSupportedThemes in class ThemeManager
      Returns:
      a set of all known themes that are supported on the current platform.
    • getActiveTheme

      public GTheme getActiveTheme()
      Description copied from class: ThemeManager
      Returns the active theme.
      Overrides:
      getActiveTheme in class ThemeManager
      Returns:
      the active theme.
    • getLookAndFeelType

      public LafType getLookAndFeelType()
      Description copied from class: ThemeManager
      Returns the LafType for the currently active LookAndFeel
      Overrides:
      getLookAndFeelType in class ThemeManager
      Returns:
      the LafType for the currently active LookAndFeel
    • getTheme

      public GTheme getTheme(String themeName)
      Description copied from class: ThemeManager
      Returns the known theme that has the given name.
      Overrides:
      getTheme in class ThemeManager
      Parameters:
      themeName - the name of the theme to retrieve
      Returns:
      the known theme that has the given name
    • getThemeValues

      public GThemeValueMap getThemeValues()
      Description copied from class: ThemeManager
      Returns the theme values as defined by the current theme, ignoring any unsaved changes that are currently applied to the application.
      Overrides:
      getThemeValues in class ThemeManager
      Returns:
      the theme values as defined by the current theme, ignoring any unsaved changes that are currently applied to the application
    • setFont

      public void setFont(FontValue newValue)
      Description copied from class: ThemeManager
      Updates the current value for the font id in the newValue
      Overrides:
      setFont in class ThemeManager
      Parameters:
      newValue - the new FontValue to install in the current values.
    • setColor

      public void setColor(ColorValue newValue)
      Description copied from class: ThemeManager
      Updates the current value for the color id in the newValue
      Overrides:
      setColor in class ThemeManager
      Parameters:
      newValue - the new ColorValue to install in the current values.
    • setIcon

      public void setIcon(IconValue newValue)
      Description copied from class: ThemeManager
      Updates the current value for the Icon id in the newValue
      Overrides:
      setIcon in class ThemeManager
      Parameters:
      newValue - the new IconValue to install in the current values.
    • getJavaDefaults

      public GThemeValueMap getJavaDefaults()
      Description copied from class: ThemeManager
      Returns the GThemeValueMap containing all the default theme values defined by the current LookAndFeel.
      Overrides:
      getJavaDefaults in class ThemeManager
      Returns:
      the GThemeValueMap containing all the default theme values defined by the current LookAndFeel
    • getApplicationDarkDefaults

      public GThemeValueMap getApplicationDarkDefaults()
      Description copied from class: ThemeManager
      Returns the GThemeValueMap containing 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:
      getApplicationDarkDefaults in class ThemeManager
      Returns:
      the GThemeValueMap containing all the dark values defined in theme.properties files
    • getApplicationLightDefaults

      public GThemeValueMap getApplicationLightDefaults()
      Description copied from class: ThemeManager
      Returns the GThemeValueMap containing all the standard default values defined in theme.properties files.
      Overrides:
      getApplicationLightDefaults in class ThemeManager
      Returns:
      the GThemeValueMap containing all the standard values defined in theme.properties files
    • getDefaults

      public GThemeValueMap getDefaults()
      Description copied from class: ThemeManager
      Returns a GThemeValueMap containing all default values for the current theme. It is a combination of application defined defaults and java LookAndFeel defaults.
      Overrides:
      getDefaults in class ThemeManager
      Returns:
      the current set of defaults.
    • isUsingAquaUI

      public boolean isUsingAquaUI(ComponentUI UI)
      Description copied from class: ThemeManager
      Returns true if the given UI object is using the Aqua Look and Feel.
      Overrides:
      isUsingAquaUI in class ThemeManager
      Parameters:
      UI - the UI to examine.
      Returns:
      true if the UI is using Aqua
    • isUsingNimbusUI

      public boolean isUsingNimbusUI()
      Description copied from class: ThemeManager
      Returns true if 'Nimbus' is the current Look and Feel
      Overrides:
      isUsingNimbusUI in class ThemeManager
      Returns:
      true if 'Nimbus' is the current Look and Feel
    • hasThemeChanges

      public boolean hasThemeChanges()
      Description copied from class: ThemeManager
      Returns true if there are any unsaved changes to the current theme.
      Overrides:
      hasThemeChanges in class ThemeManager
      Returns:
      true if there are any unsaved changes to the current theme.
    • registerFont

      public void registerFont(Component component, String fontId)
      Description copied from class: ThemeManager
      Binds 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:
      registerFont in class ThemeManager
      Parameters:
      component - the component to set/update the font
      fontId - the id of the font to register with the given component
    • isDarkTheme

      public boolean isDarkTheme()
      Description copied from class: ThemeManager
      Returns true if the current theme use dark default values.
      Overrides:
      isDarkTheme in class ThemeManager
      Returns:
      true if the current theme use dark default values.
    • error

      protected void error(String message)
      Overrides:
      error in class ThemeManager
    • loadApplicationDefaults

      protected ApplicationThemeDefaults loadApplicationDefaults()
      Overrides:
      loadApplicationDefaults in class ThemeManager