Class MetalTheme

java.lang.Object
javax.swing.plaf.metal.MetalTheme
Direct Known Subclasses:
DefaultMetalTheme

public abstract class MetalTheme extends Object
MetalTheme provides the color palette and fonts used by the Java Look and Feel.

MetalTheme is abstract, see DefaultMetalTheme and OceanTheme for concrete implementations.

MetalLookAndFeel maintains the current theme that the the ComponentUI implementations for metal use. Refer to MetalLookAndFeel.setCurrentTheme(MetalTheme) for details on changing the current theme.

MetalTheme provides a number of public methods for getting colors. These methods are implemented in terms of a handful of protected abstract methods. A subclass need only override the protected abstract methods (getPrimary1, getPrimary2, getPrimary3, getSecondary1, getSecondary2, and getSecondary3); although a subclass may override the other public methods for more control over the set of colors that are used.

Concrete implementations of MetalTheme must return non-null values from all methods. While the behavior of returning null is not specified, returning null will result in incorrect behavior.

It is strongly recommended that subclasses return completely opaque colors. To do otherwise may result in rendering problems, such as visual garbage.

See Also:
  • Constructor Details Link icon

    • MetalTheme Link icon

      protected MetalTheme()
      Constructor for subclasses to call.
  • Method Details Link icon

    • getName Link icon

      public abstract String getName()
      Returns the name of this theme.
      Returns:
      the name of this theme
    • getPrimary1 Link icon

      protected abstract ColorUIResource getPrimary1()
      Returns the primary 1 color.
      Returns:
      the primary 1 color
    • getPrimary2 Link icon

      protected abstract ColorUIResource getPrimary2()
      Returns the primary 2 color.
      Returns:
      the primary 2 color
    • getPrimary3 Link icon

      protected abstract ColorUIResource getPrimary3()
      Returns the primary 3 color.
      Returns:
      the primary 3 color
    • getSecondary1 Link icon

      protected abstract ColorUIResource getSecondary1()
      Returns the secondary 1 color.
      Returns:
      the secondary 1 color
    • getSecondary2 Link icon

      protected abstract ColorUIResource getSecondary2()
      Returns the secondary 2 color.
      Returns:
      the secondary 2 color
    • getSecondary3 Link icon

      protected abstract ColorUIResource getSecondary3()
      Returns the secondary 3 color.
      Returns:
      the secondary 3 color
    • getControlTextFont Link icon

      public abstract FontUIResource getControlTextFont()
      Returns the control text font.
      Returns:
      the control text font
    • getSystemTextFont Link icon

      public abstract FontUIResource getSystemTextFont()
      Returns the system text font.
      Returns:
      the system text font
    • getUserTextFont Link icon

      public abstract FontUIResource getUserTextFont()
      Returns the user text font.
      Returns:
      the user text font
    • getMenuTextFont Link icon

      public abstract FontUIResource getMenuTextFont()
      Returns the menu text font.
      Returns:
      the menu text font
    • getWindowTitleFont Link icon

      public abstract FontUIResource getWindowTitleFont()
      Returns the window title font.
      Returns:
      the window title font
    • getSubTextFont Link icon

      public abstract FontUIResource getSubTextFont()
      Returns the sub-text font.
      Returns:
      the sub-text font
    • getWhite Link icon

      protected ColorUIResource getWhite()
      Returns the white color. This returns opaque white (0xFFFFFFFF).
      Returns:
      the white color
    • getBlack Link icon

      protected ColorUIResource getBlack()
      Returns the black color. This returns opaque black (0xFF000000).
      Returns:
      the black color
    • getFocusColor Link icon

      public ColorUIResource getFocusColor()
      Returns the focus color. This returns the value of getPrimary2().
      Returns:
      the focus color
    • getDesktopColor Link icon

      public ColorUIResource getDesktopColor()
      Returns the desktop color. This returns the value of getPrimary2().
      Returns:
      the desktop color
    • getControl Link icon

      public ColorUIResource getControl()
      Returns the control color. This returns the value of getSecondary3().
      Returns:
      the control color
    • getControlShadow Link icon

      public ColorUIResource getControlShadow()
      Returns the control shadow color. This returns the value of getSecondary2().
      Returns:
      the control shadow color
    • getControlDarkShadow Link icon

      public ColorUIResource getControlDarkShadow()
      Returns the control dark shadow color. This returns the value of getSecondary1().
      Returns:
      the control dark shadow color
    • getControlInfo Link icon

      public ColorUIResource getControlInfo()
      Returns the control info color. This returns the value of getBlack().
      Returns:
      the control info color
    • getControlHighlight Link icon

      public ColorUIResource getControlHighlight()
      Returns the control highlight color. This returns the value of getWhite().
      Returns:
      the control highlight color
    • getControlDisabled Link icon

      public ColorUIResource getControlDisabled()
      Returns the control disabled color. This returns the value of getSecondary2().
      Returns:
      the control disabled color
    • getPrimaryControl Link icon

      public ColorUIResource getPrimaryControl()
      Returns the primary control color. This returns the value of getPrimary3().
      Returns:
      the primary control color
    • getPrimaryControlShadow Link icon

      public ColorUIResource getPrimaryControlShadow()
      Returns the primary control shadow color. This returns the value of getPrimary2().
      Returns:
      the primary control shadow color
    • getPrimaryControlDarkShadow Link icon

      public ColorUIResource getPrimaryControlDarkShadow()
      Returns the primary control dark shadow color. This returns the value of getPrimary1().
      Returns:
      the primary control dark shadow color
    • getPrimaryControlInfo Link icon

      public ColorUIResource getPrimaryControlInfo()
      Returns the primary control info color. This returns the value of getBlack().
      Returns:
      the primary control info color
    • getPrimaryControlHighlight Link icon

      public ColorUIResource getPrimaryControlHighlight()
      Returns the primary control highlight color. This returns the value of getWhite().
      Returns:
      the primary control highlight color
    • getSystemTextColor Link icon

      public ColorUIResource getSystemTextColor()
      Returns the system text color. This returns the value of getBlack().
      Returns:
      the system text color
    • getControlTextColor Link icon

      public ColorUIResource getControlTextColor()
      Returns the control text color. This returns the value of getControlInfo().
      Returns:
      the control text color
    • getInactiveControlTextColor Link icon

      public ColorUIResource getInactiveControlTextColor()
      Returns the inactive control text color. This returns the value of getControlDisabled().
      Returns:
      the inactive control text color
    • getInactiveSystemTextColor Link icon

      public ColorUIResource getInactiveSystemTextColor()
      Returns the inactive system text color. This returns the value of getSecondary2().
      Returns:
      the inactive system text color
    • getUserTextColor Link icon

      public ColorUIResource getUserTextColor()
      Returns the user text color. This returns the value of getBlack().
      Returns:
      the user text color
    • getTextHighlightColor Link icon

      public ColorUIResource getTextHighlightColor()
      Returns the text highlight color. This returns the value of getPrimary3().
      Returns:
      the text highlight color
    • getHighlightedTextColor Link icon

      public ColorUIResource getHighlightedTextColor()
      Returns the highlighted text color. This returns the value of getControlTextColor().
      Returns:
      the highlighted text color
    • getWindowBackground Link icon

      public ColorUIResource getWindowBackground()
      Returns the window background color. This returns the value of getWhite().
      Returns:
      the window background color
    • getWindowTitleBackground Link icon

      public ColorUIResource getWindowTitleBackground()
      Returns the window title background color. This returns the value of getPrimary3().
      Returns:
      the window title background color
    • getWindowTitleForeground Link icon

      public ColorUIResource getWindowTitleForeground()
      Returns the window title foreground color. This returns the value of getBlack().
      Returns:
      the window title foreground color
    • getWindowTitleInactiveBackground Link icon

      public ColorUIResource getWindowTitleInactiveBackground()
      Returns the window title inactive background color. This returns the value of getSecondary3().
      Returns:
      the window title inactive background color
    • getWindowTitleInactiveForeground Link icon

      public ColorUIResource getWindowTitleInactiveForeground()
      Returns the window title inactive foreground color. This returns the value of getBlack().
      Returns:
      the window title inactive foreground color
    • getMenuBackground Link icon

      public ColorUIResource getMenuBackground()
      Returns the menu background color. This returns the value of getSecondary3().
      Returns:
      the menu background color
    • getMenuForeground Link icon

      public ColorUIResource getMenuForeground()
      Returns the menu foreground color. This returns the value of getBlack().
      Returns:
      the menu foreground color
    • getMenuSelectedBackground Link icon

      public ColorUIResource getMenuSelectedBackground()
      Returns the menu selected background color. This returns the value of getPrimary2().
      Returns:
      the menu selected background color
    • getMenuSelectedForeground Link icon

      public ColorUIResource getMenuSelectedForeground()
      Returns the menu selected foreground color. This returns the value of getBlack().
      Returns:
      the menu selected foreground color
    • getMenuDisabledForeground Link icon

      public ColorUIResource getMenuDisabledForeground()
      Returns the menu disabled foreground color. This returns the value of getSecondary2().
      Returns:
      the menu disabled foreground color
    • getSeparatorBackground Link icon

      public ColorUIResource getSeparatorBackground()
      Returns the separator background color. This returns the value of getWhite().
      Returns:
      the separator background color
    • getSeparatorForeground Link icon

      public ColorUIResource getSeparatorForeground()
      Returns the separator foreground color. This returns the value of getPrimary1().
      Returns:
      the separator foreground color
    • getAcceleratorForeground Link icon

      public ColorUIResource getAcceleratorForeground()
      Returns the accelerator foreground color. This returns the value of getPrimary1().
      Returns:
      the accelerator foreground color
    • getAcceleratorSelectedForeground Link icon

      public ColorUIResource getAcceleratorSelectedForeground()
      Returns the accelerator selected foreground color. This returns the value of getBlack().
      Returns:
      the accelerator selected foreground color
    • addCustomEntriesToTable Link icon

      public void addCustomEntriesToTable(UIDefaults table)
      Adds values specific to this theme to the defaults table. This method is invoked when the look and feel defaults are obtained from MetalLookAndFeel.

      This implementation does nothing; it is provided for subclasses that wish to customize the defaults table.

      Parameters:
      table - the UIDefaults to add the values to
      See Also: