Save This Page
Home » openjdk-7 » javax » swing » plaf » metal » [javadoc | source]
javax.swing.plaf.metal
abstract public class: MetalTheme [javadoc | source]
java.lang.Object
   javax.swing.plaf.metal.MetalTheme

Direct Known Subclasses:
    DefaultMetalTheme, MetalHighContrastTheme, OceanTheme

{@code MetalTheme} provides the color palette and fonts used by the Java Look and Feel.

{@code MetalTheme} is abstract, see {@code DefaultMetalTheme} and {@code OceanTheme} for concrete implementations.

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

{@code 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 ({@code getPrimary1}, {@code getPrimary2}, {@code getPrimary3}, {@code getSecondary1}, {@code getSecondary2}, and {@code getSecondary3}); although a subclass may override the other public methods for more control over the set of colors that are used.

Concrete implementations of {@code MetalTheme} must return {@code non-null} values from all methods. While the behavior of returning {@code null} is not specified, returning {@code 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.

Field Summary
static final  int CONTROL_TEXT_FONT     
static final  int SYSTEM_TEXT_FONT     
static final  int USER_TEXT_FONT     
static final  int MENU_TEXT_FONT     
static final  int WINDOW_TITLE_FONT     
static final  int SUB_TEXT_FONT     
static  ColorUIResource white     
Method from javax.swing.plaf.metal.MetalTheme Summary:
addCustomEntriesToTable,   getAcceleratorForeground,   getAcceleratorSelectedForeground,   getBlack,   getControl,   getControlDarkShadow,   getControlDisabled,   getControlHighlight,   getControlInfo,   getControlShadow,   getControlTextColor,   getControlTextFont,   getDesktopColor,   getFocusColor,   getHighlightedTextColor,   getInactiveControlTextColor,   getInactiveSystemTextColor,   getMenuBackground,   getMenuDisabledForeground,   getMenuForeground,   getMenuSelectedBackground,   getMenuSelectedForeground,   getMenuTextFont,   getName,   getPrimary1,   getPrimary2,   getPrimary3,   getPrimaryControl,   getPrimaryControlDarkShadow,   getPrimaryControlHighlight,   getPrimaryControlInfo,   getPrimaryControlShadow,   getSecondary1,   getSecondary2,   getSecondary3,   getSeparatorBackground,   getSeparatorForeground,   getSubTextFont,   getSystemTextColor,   getSystemTextFont,   getTextHighlightColor,   getUserTextColor,   getUserTextFont,   getWhite,   getWindowBackground,   getWindowTitleBackground,   getWindowTitleFont,   getWindowTitleForeground,   getWindowTitleInactiveBackground,   getWindowTitleInactiveForeground,   install,   isSystemTheme
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from javax.swing.plaf.metal.MetalTheme Detail:
 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 {@code MetalLookAndFeel}.

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

 public ColorUIResource getAcceleratorForeground() 
    Returns the accelerator foreground color. This returns the value of {@code getPrimary1()}.
 public ColorUIResource getAcceleratorSelectedForeground() 
    Returns the accelerator selected foreground color. This returns the value of {@code getBlack()}.
 protected ColorUIResource getBlack() 
    Returns the black color. This returns opaque black ({@code 0xFF000000}).
 public ColorUIResource getControl() 
    Returns the control color. This returns the value of {@code getSecondary3()}.
 public ColorUIResource getControlDarkShadow() 
    Returns the control dark shadow color. This returns the value of {@code getSecondary1()}.
 public ColorUIResource getControlDisabled() 
    Returns the control disabled color. This returns the value of {@code getSecondary2()}.
 public ColorUIResource getControlHighlight() 
    Returns the control highlight color. This returns the value of {@code getWhite()}.
 public ColorUIResource getControlInfo() 
    Returns the control info color. This returns the value of {@code getBlack()}.
 public ColorUIResource getControlShadow() 
    Returns the control shadow color. This returns the value of {@code getSecondary2()}.
 public ColorUIResource getControlTextColor() 
    Returns the control text color. This returns the value of {@code getControlInfo()}.
 abstract public FontUIResource getControlTextFont()
    Returns the control text font.
 public ColorUIResource getDesktopColor() 
    Returns the desktop color. This returns the value of {@code getPrimary2()}.
 public ColorUIResource getFocusColor() 
    Returns the focus color. This returns the value of {@code getPrimary2()}.
 public ColorUIResource getHighlightedTextColor() 
    Returns the highlighted text color. This returns the value of {@code getControlTextColor()}.
 public ColorUIResource getInactiveControlTextColor() 
    Returns the inactive control text color. This returns the value of {@code getControlDisabled()}.
 public ColorUIResource getInactiveSystemTextColor() 
    Returns the inactive system text color. This returns the value of {@code getSecondary2()}.
 public ColorUIResource getMenuBackground() 
    Returns the menu background color. This returns the value of {@code getSecondary3()}.
 public ColorUIResource getMenuDisabledForeground() 
    Returns the menu disabled foreground color. This returns the value of {@code getSecondary2()}.
 public ColorUIResource getMenuForeground() 
    Returns the menu foreground color. This returns the value of {@code getBlack()}.
 public ColorUIResource getMenuSelectedBackground() 
    Returns the menu selected background color. This returns the value of {@code getPrimary2()}.
 public ColorUIResource getMenuSelectedForeground() 
    Returns the menu selected foreground color. This returns the value of {@code getBlack()}.
 abstract public FontUIResource getMenuTextFont()
    Returns the menu text font.
 abstract public String getName()
    Returns the name of this theme.
 abstract protected ColorUIResource getPrimary1()
    Returns the primary 1 color.
 abstract protected ColorUIResource getPrimary2()
    Returns the primary 2 color.
 abstract protected ColorUIResource getPrimary3()
    Returns the primary 3 color.
 public ColorUIResource getPrimaryControl() 
    Returns the primary control color. This returns the value of {@code getPrimary3()}.
 public ColorUIResource getPrimaryControlDarkShadow() 
    Returns the primary control dark shadow color. This returns the value of {@code getPrimary1()}.
 public ColorUIResource getPrimaryControlHighlight() 
    Returns the primary control highlight color. This returns the value of {@code getWhite()}.
 public ColorUIResource getPrimaryControlInfo() 
    Returns the primary control info color. This returns the value of {@code getBlack()}.
 public ColorUIResource getPrimaryControlShadow() 
    Returns the primary control shadow color. This returns the value of {@code getPrimary2()}.
 abstract protected ColorUIResource getSecondary1()
    Returns the secondary 1 color.
 abstract protected ColorUIResource getSecondary2()
    Returns the secondary 2 color.
 abstract protected ColorUIResource getSecondary3()
    Returns the secondary 3 color.
 public ColorUIResource getSeparatorBackground() 
    Returns the separator background color. This returns the value of {@code getWhite()}.
 public ColorUIResource getSeparatorForeground() 
    Returns the separator foreground color. This returns the value of {@code getPrimary1()}.
 abstract public FontUIResource getSubTextFont()
    Returns the sub-text font.
 public ColorUIResource getSystemTextColor() 
    Returns the system text color. This returns the value of {@code getBlack()}.
 abstract public FontUIResource getSystemTextFont()
    Returns the system text font.
 public ColorUIResource getTextHighlightColor() 
    Returns the text highlight color. This returns the value of {@code getPrimary3()}.
 public ColorUIResource getUserTextColor() 
    Returns the user text color. This returns the value of {@code getBlack()}.
 abstract public FontUIResource getUserTextFont()
    Returns the user text font.
 protected ColorUIResource getWhite() 
    Returns the white color. This returns opaque white ({@code 0xFFFFFFFF}).
 public ColorUIResource getWindowBackground() 
    Returns the window background color. This returns the value of {@code getWhite()}.
 public ColorUIResource getWindowTitleBackground() 
    Returns the window title background color. This returns the value of {@code getPrimary3()}.
 abstract public FontUIResource getWindowTitleFont()
    Returns the window title font.
 public ColorUIResource getWindowTitleForeground() 
    Returns the window title foreground color. This returns the value of {@code getBlack()}.
 public ColorUIResource getWindowTitleInactiveBackground() 
    Returns the window title inactive background color. This returns the value of {@code getSecondary3()}.
 public ColorUIResource getWindowTitleInactiveForeground() 
    Returns the window title inactive foreground color. This returns the value of {@code getBlack()}.
  void install() 
    This is invoked when a MetalLookAndFeel is installed and about to start using this theme. When we can add API this should be nuked in favor of DefaultMetalTheme overriding addCustomEntriesToTable.
 boolean isSystemTheme() 
    Returns true if this is a theme provided by the core platform.