This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.


javax.swing.plaf.metal
class MetalTheme

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

public abstract class MetalTheme
extends Object

{@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 {@link MetalLookAndFeel#setCurrentTheme 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.


Constructor Summary

          
 
Method Summary
 void

          Adds values specific to this theme to the defaults table.
 ColorUIResource

          Returns the accelerator foreground color.
 ColorUIResource

          Returns the accelerator selected foreground color.
protected ColorUIResource

          Returns the black color.
 ColorUIResource

          Returns the control color.
 ColorUIResource

          Returns the control dark shadow color.
 ColorUIResource

          Returns the control disabled color.
 ColorUIResource

          Returns the control highlight color.
 ColorUIResource

          Returns the control info color.
 ColorUIResource

          Returns the control shadow color.
 ColorUIResource

          Returns the control text color.
abstract FontUIResource

          Returns the control text font.
 ColorUIResource

          Returns the desktop color.
 ColorUIResource

          Returns the focus color.
 ColorUIResource

          Returns the highlighted text color.
 ColorUIResource

          Returns the inactive control text color.
 ColorUIResource

          Returns the inactive system text color.
 ColorUIResource

          Returns the menu background color.
 ColorUIResource

          Returns the menu disabled foreground color.
 ColorUIResource

          Returns the menu foreground color.
 ColorUIResource

          Returns the menu selected background color.
 ColorUIResource

          Returns the menu selected foreground color.
abstract FontUIResource

          Returns the menu text font.
abstract String

          Returns the name of this theme.
protected abstract ColorUIResource

          Returns the primary 1 color.
protected abstract ColorUIResource

          Returns the primary 2 color.
protected abstract ColorUIResource

          Returns the primary 3 color.
 ColorUIResource

          Returns the primary control color.
 ColorUIResource

          Returns the primary control dark shadow color.
 ColorUIResource

          Returns the primary control highlight color.
 ColorUIResource

          Returns the primary control info color.
 ColorUIResource

          Returns the primary control shadow color.
protected abstract ColorUIResource

          Returns the secondary 1 color.
protected abstract ColorUIResource

          Returns the secondary 2 color.
protected abstract ColorUIResource

          Returns the secondary 3 color.
 ColorUIResource

          Returns the separator background color.
 ColorUIResource

          Returns the separator foreground color.
abstract FontUIResource

          Returns the sub-text font.
 ColorUIResource

          Returns the system text color.
abstract FontUIResource

          Returns the system text font.
 ColorUIResource

          Returns the text highlight color.
 ColorUIResource

          Returns the user text color.
abstract FontUIResource

          Returns the user text font.
protected ColorUIResource

          Returns the white color.
 ColorUIResource

          Returns the window background color.
 ColorUIResource

          Returns the window title background color.
abstract FontUIResource

          Returns the window title font.
 ColorUIResource

          Returns the window title foreground color.
 ColorUIResource

          Returns the window title inactive background color.
 ColorUIResource

          Returns the window title inactive foreground color.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MetalTheme

public MetalTheme()
Method Detail

addCustomEntriesToTable

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.

Parameters:
table - the {@code UIDefaults} to add the values to

getAcceleratorForeground

public ColorUIResource getAcceleratorForeground()
Returns the accelerator foreground color. This returns the value of {@code getPrimary1()}.

Returns:
the accelerator foreground color

getAcceleratorSelectedForeground

public ColorUIResource getAcceleratorSelectedForeground()
Returns the accelerator selected foreground color. This returns the value of {@code getBlack()}.

Returns:
the accelerator selected foreground color

getBlack

protected ColorUIResource getBlack()
Returns the black color. This returns opaque black ({@code 0xFF000000}).

Returns:
the black color

getControl

public ColorUIResource getControl()
Returns the control color. This returns the value of {@code getSecondary3()}.

Returns:
the control color

getControlDarkShadow

public ColorUIResource getControlDarkShadow()
Returns the control dark shadow color. This returns the value of {@code getSecondary1()}.

Returns:
the control dark shadow color

getControlDisabled

public ColorUIResource getControlDisabled()
Returns the control disabled color. This returns the value of {@code getSecondary2()}.

Returns:
the control disabled color

getControlHighlight

public ColorUIResource getControlHighlight()
Returns the control highlight color. This returns the value of {@code getWhite()}.

Returns:
the control highlight color

getControlInfo

public ColorUIResource getControlInfo()
Returns the control info color. This returns the value of {@code getBlack()}.

Returns:
the control info color

getControlShadow

public ColorUIResource getControlShadow()
Returns the control shadow color. This returns the value of {@code getSecondary2()}.

Returns:
the control shadow color

getControlTextColor

public ColorUIResource getControlTextColor()
Returns the control text color. This returns the value of {@code getControlInfo()}.

Returns:
the control text color

getControlTextFont

public abstract FontUIResource getControlTextFont()
Returns the control text font.

Returns:
the control text font

getDesktopColor

public ColorUIResource getDesktopColor()
Returns the desktop color. This returns the value of {@code getPrimary2()}.

Returns:
the desktop color

getFocusColor

public ColorUIResource getFocusColor()
Returns the focus color. This returns the value of {@code getPrimary2()}.

Returns:
the focus color

getHighlightedTextColor

public ColorUIResource getHighlightedTextColor()
Returns the highlighted text color. This returns the value of {@code getControlTextColor()}.

Returns:
the highlighted text color

getInactiveControlTextColor

public ColorUIResource getInactiveControlTextColor()
Returns the inactive control text color. This returns the value of {@code getControlDisabled()}.

Returns:
the inactive control text color

getInactiveSystemTextColor

public ColorUIResource getInactiveSystemTextColor()
Returns the inactive system text color. This returns the value of {@code getSecondary2()}.

Returns:
the inactive system text color

getMenuBackground

public ColorUIResource getMenuBackground()
Returns the menu background color. This returns the value of {@code getSecondary3()}.

Returns:
the menu background color

getMenuDisabledForeground

public ColorUIResource getMenuDisabledForeground()
Returns the menu disabled foreground color. This returns the value of {@code getSecondary2()}.

Returns:
the menu disabled foreground color

getMenuForeground

public ColorUIResource getMenuForeground()
Returns the menu foreground color. This returns the value of {@code getBlack()}.

Returns:
the menu foreground color

getMenuSelectedBackground

public ColorUIResource getMenuSelectedBackground()
Returns the menu selected background color. This returns the value of {@code getPrimary2()}.

Returns:
the menu selected background color

getMenuSelectedForeground

public ColorUIResource getMenuSelectedForeground()
Returns the menu selected foreground color. This returns the value of {@code getBlack()}.

Returns:
the menu selected foreground color

getMenuTextFont

public abstract FontUIResource getMenuTextFont()
Returns the menu text font.

Returns:
the menu text font

getName

public abstract String getName()
Returns the name of this theme.

Returns:
the name of this theme

getPrimary1

protected abstract ColorUIResource getPrimary1()
Returns the primary 1 color.

Returns:
the primary 1 color

getPrimary2

protected abstract ColorUIResource getPrimary2()
Returns the primary 2 color.

Returns:
the primary 2 color

getPrimary3

protected abstract ColorUIResource getPrimary3()
Returns the primary 3 color.

Returns:
the primary 3 color

getPrimaryControl

public ColorUIResource getPrimaryControl()
Returns the primary control color. This returns the value of {@code getPrimary3()}.

Returns:
the primary control color

getPrimaryControlDarkShadow

public ColorUIResource getPrimaryControlDarkShadow()
Returns the primary control dark shadow color. This returns the value of {@code getPrimary1()}.

Returns:
the primary control dark shadow color

getPrimaryControlHighlight

public ColorUIResource getPrimaryControlHighlight()
Returns the primary control highlight color. This returns the value of {@code getWhite()}.

Returns:
the primary control highlight color

getPrimaryControlInfo

public ColorUIResource getPrimaryControlInfo()
Returns the primary control info color. This returns the value of {@code getBlack()}.

Returns:
the primary control info color

getPrimaryControlShadow

public ColorUIResource getPrimaryControlShadow()
Returns the primary control shadow color. This returns the value of {@code getPrimary2()}.

Returns:
the primary control shadow color

getSecondary1

protected abstract ColorUIResource getSecondary1()
Returns the secondary 1 color.

Returns:
the secondary 1 color

getSecondary2

protected abstract ColorUIResource getSecondary2()
Returns the secondary 2 color.

Returns:
the secondary 2 color

getSecondary3

protected abstract ColorUIResource getSecondary3()
Returns the secondary 3 color.

Returns:
the secondary 3 color

getSeparatorBackground

public ColorUIResource getSeparatorBackground()
Returns the separator background color. This returns the value of {@code getWhite()}.

Returns:
the separator background color

getSeparatorForeground

public ColorUIResource getSeparatorForeground()
Returns the separator foreground color. This returns the value of {@code getPrimary1()}.

Returns:
the separator foreground color

getSubTextFont

public abstract FontUIResource getSubTextFont()
Returns the sub-text font.

Returns:
the sub-text font

getSystemTextColor

public ColorUIResource getSystemTextColor()
Returns the system text color. This returns the value of {@code getBlack()}.

Returns:
the system text color

getSystemTextFont

public abstract FontUIResource getSystemTextFont()
Returns the system text font.

Returns:
the system text font

getTextHighlightColor

public ColorUIResource getTextHighlightColor()
Returns the text highlight color. This returns the value of {@code getPrimary3()}.

Returns:
the text highlight color

getUserTextColor

public ColorUIResource getUserTextColor()
Returns the user text color. This returns the value of {@code getBlack()}.

Returns:
the user text color

getUserTextFont

public abstract FontUIResource getUserTextFont()
Returns the user text font.

Returns:
the user text font

getWhite

protected ColorUIResource getWhite()
Returns the white color. This returns opaque white ({@code 0xFFFFFFFF}).

Returns:
the white color

getWindowBackground

public ColorUIResource getWindowBackground()
Returns the window background color. This returns the value of {@code getWhite()}.

Returns:
the window background color

getWindowTitleBackground

public ColorUIResource getWindowTitleBackground()
Returns the window title background color. This returns the value of {@code getPrimary3()}.

Returns:
the window title background color

getWindowTitleFont

public abstract FontUIResource getWindowTitleFont()
Returns the window title font.

Returns:
the window title font

getWindowTitleForeground

public ColorUIResource getWindowTitleForeground()
Returns the window title foreground color. This returns the value of {@code getBlack()}.

Returns:
the window title foreground color

getWindowTitleInactiveBackground

public ColorUIResource getWindowTitleInactiveBackground()
Returns the window title inactive background color. This returns the value of {@code getSecondary3()}.

Returns:
the window title inactive background color

getWindowTitleInactiveForeground

public ColorUIResource getWindowTitleInactiveForeground()
Returns the window title inactive foreground color. This returns the value of {@code getBlack()}.

Returns:
the window title inactive foreground color


This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.
This page displays the Jadeite version of the documention, which is derived from the offical documentation that contains this copyright notice:
Copyright 2008 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.
The official Sun™ documentation can be found here at http://java.sun.com/javase/6/docs/api/.