javax.swing.plaf.metal

Class MetalTheme

public abstract class MetalTheme extends Object

The base class for themes used by the {@link MetalLookAndFeel}. A default theme ({@link DefaultMetalTheme}) is provided, or you can create and use your own.

See Also: setCurrentTheme

Constructor Summary
MetalTheme()
Default constructor.
Method Summary
voidaddCustomEntriesToTable(UIDefaults table)
Adds custom entries to the UI defaults table.
ColorUIResourcegetAcceleratorForeground()
Returns the accelerator foreground color.
ColorUIResourcegetAcceleratorSelectedForeground()
Returns the accelerator selected foreground color.
protected ColorUIResourcegetBlack()
Returns the color used for black.
ColorUIResourcegetControl()
Returns the control color.
ColorUIResourcegetControlDarkShadow()
Returns the color used for dark shadows on controls.
ColorUIResourcegetControlDisabled()
Returns the color used for disabled controls.
ColorUIResourcegetControlHighlight()
Returns the color used to draw highlights for controls.
ColorUIResourcegetControlInfo()
Returns the color used to display control info.
ColorUIResourcegetControlShadow()
Returns the color used to draw shadows for controls.
ColorUIResourcegetControlTextColor()
Returns the color used for text on controls.
abstract FontUIResourcegetControlTextFont()
Returns the font used for text on controls.
ColorUIResourcegetDesktopColor()
Returns the color used for the desktop background.
ColorUIResourcegetFocusColor()
Returns the color used to draw focus highlights.
ColorUIResourcegetHighlightedTextColor()
Returns the color used to draw highlighted text.
ColorUIResourcegetInactiveControlTextColor()
Returns the color used to draw text on inactive controls.
ColorUIResourcegetInactiveSystemTextColor()
Returns the color used to draw inactive system text.
ColorUIResourcegetMenuBackground()
Returns the background color for menu items.
ColorUIResourcegetMenuDisabledForeground()
Returns the foreground color for disabled menu items.
ColorUIResourcegetMenuForeground()
Returns the foreground color for menu items.
ColorUIResourcegetMenuSelectedBackground()
Returns the background color for selected menu items.
ColorUIResourcegetMenuSelectedForeground()
Returns the foreground color for selected menu items.
abstract FontUIResourcegetMenuTextFont()
Returns the font used for text in menus.
abstract StringgetName()
Returns the name of the theme.
protected abstract ColorUIResourcegetPrimary1()
Returns the first primary color for this theme.
protected abstract ColorUIResourcegetPrimary2()
Returns the second primary color for this theme.
protected abstract ColorUIResourcegetPrimary3()
Returns the third primary color for this theme.
ColorUIResourcegetPrimaryControl()
Returns the primary color for controls.
ColorUIResourcegetPrimaryControlDarkShadow()
Returns the primary color for the dark shadow on controls.
ColorUIResourcegetPrimaryControlHighlight()
Returns the primary color for the highlight on controls.
ColorUIResourcegetPrimaryControlInfo()
Returns the primary color for the information on controls.
ColorUIResourcegetPrimaryControlShadow()
Returns the primary color for the shadow on controls.
protected abstract ColorUIResourcegetSecondary1()
Returns the first secondary color for this theme.
protected abstract ColorUIResourcegetSecondary2()
Returns the second secondary color for this theme.
protected abstract ColorUIResourcegetSecondary3()
Returns the third secondary color for this theme.
ColorUIResourcegetSeparatorBackground()
Returns the background color for separators.
ColorUIResourcegetSeparatorForeground()
Returns the foreground color for separators.
abstract FontUIResourcegetSubTextFont()
Returns the font used for sub text.
ColorUIResourcegetSystemTextColor()
Returns the color used for system text.
abstract FontUIResourcegetSystemTextFont()
Returns the font used for system text.
ColorUIResourcegetTextHighlightColor()
Returns the color used to highlight text.
ColorUIResourcegetUserTextColor()
Returns the color used to display user text.
abstract FontUIResourcegetUserTextFont()
Returns the font used for user text.
protected ColorUIResourcegetWhite()
Returns the color used for white.
ColorUIResourcegetWindowBackground()
Returns the window background color.
ColorUIResourcegetWindowTitleBackground()
Returns the window title background color.
abstract FontUIResourcegetWindowTitleFont()
Returns the font used for window titles.
ColorUIResourcegetWindowTitleForeground()
Returns the window title foreground color.
ColorUIResourcegetWindowTitleInactiveBackground()
Returns the background color for an inactive window title.
ColorUIResourcegetWindowTitleInactiveForeground()
Returns the foreground color for an inactive window title.

Constructor Detail

MetalTheme

public MetalTheme()
Default constructor.

Method Detail

addCustomEntriesToTable

public void addCustomEntriesToTable(UIDefaults table)
Adds custom entries to the UI defaults table. This method is empty.

Parameters: table the table.

getAcceleratorForeground

public ColorUIResource getAcceleratorForeground()
Returns the accelerator foreground color. The default implementation returns the color from {@link #getPrimary1()}.

Returns: The accelerator foreground color.

getAcceleratorSelectedForeground

public ColorUIResource getAcceleratorSelectedForeground()
Returns the accelerator selected foreground color. The default implementation returns the color from {@link #getBlack()}.

Returns: The accelerator selected foreground color.

getBlack

protected ColorUIResource getBlack()
Returns the color used for black.

Returns: The color used for black.

getControl

public ColorUIResource getControl()
Returns the control color. The default implementation returns the color from {@link #getSecondary3()}.

Returns: The control color.

getControlDarkShadow

public ColorUIResource getControlDarkShadow()
Returns the color used for dark shadows on controls. The default implementation returns the color from {@link #getSecondary1()}.

Returns: The color used for dark shadows on controls.

getControlDisabled

public ColorUIResource getControlDisabled()
Returns the color used for disabled controls. The default implementation returns the color from {@link #getSecondary1()}.

Returns: The color used for disabled controls.

getControlHighlight

public ColorUIResource getControlHighlight()
Returns the color used to draw highlights for controls. The default implementation returns the color from {@link #getWhite()}.

Returns: The color used to draw highlights for controls.

getControlInfo

public ColorUIResource getControlInfo()
Returns the color used to display control info. The default implementation returns the color from {@link #getBlack()}.

Returns: The color used to display control info.

getControlShadow

public ColorUIResource getControlShadow()
Returns the color used to draw shadows for controls. The default implementation returns the color from {@link #getSecondary2()}.

Returns: The color used to draw shadows for controls.

getControlTextColor

public ColorUIResource getControlTextColor()
Returns the color used for text on controls. The default implementation returns the color from {@link #getControlInfo()}.

Returns: The color used for text on controls.

getControlTextFont

public abstract FontUIResource getControlTextFont()
Returns the font used for text on controls.

Returns: The font used for text on controls.

getDesktopColor

public ColorUIResource getDesktopColor()
Returns the color used for the desktop background. The default implementation returns the color from {@link #getPrimary2()}.

Returns: The color used for the desktop background.

getFocusColor

public ColorUIResource getFocusColor()
Returns the color used to draw focus highlights. The default implementation returns the color from {@link #getPrimary2()}.

Returns: The color used to draw focus highlights.

getHighlightedTextColor

public ColorUIResource getHighlightedTextColor()
Returns the color used to draw highlighted text. The default implementation returns the color from {@link #getHighlightedTextColor()}.

Returns: The color used to draw highlighted text.

getInactiveControlTextColor

public ColorUIResource getInactiveControlTextColor()
Returns the color used to draw text on inactive controls. The default implementation returns the color from {@link #getControlDisabled()}.

Returns: The color used to draw text on inactive controls.

getInactiveSystemTextColor

public ColorUIResource getInactiveSystemTextColor()
Returns the color used to draw inactive system text. The default implementation returns the color from {@link #getSecondary2()}.

Returns: The color used to draw inactive system text.

getMenuBackground

public ColorUIResource getMenuBackground()
Returns the background color for menu items. The default implementation returns the color from {@link #getSecondary3()}.

Returns: The background color for menu items.

See Also: getMenuSelectedBackground

getMenuDisabledForeground

public ColorUIResource getMenuDisabledForeground()
Returns the foreground color for disabled menu items. The default implementation returns the color from {@link #getSecondary2()}.

Returns: The foreground color for disabled menu items.

See Also: getMenuForeground

getMenuForeground

public ColorUIResource getMenuForeground()
Returns the foreground color for menu items. The default implementation returns the color from {@link #getBlack()}.

Returns: The foreground color for menu items.

See Also: getMenuDisabledForeground getMenuSelectedForeground

getMenuSelectedBackground

public ColorUIResource getMenuSelectedBackground()
Returns the background color for selected menu items. The default implementation returns the color from {@link #getPrimary2()}.

Returns: The background color for selected menu items.

See Also: getMenuBackground

getMenuSelectedForeground

public ColorUIResource getMenuSelectedForeground()
Returns the foreground color for selected menu items. The default implementation returns the value from {@link #getBlack()}.

Returns: The foreground color for selected menu items.

See Also: getMenuForeground

getMenuTextFont

public abstract FontUIResource getMenuTextFont()
Returns the font used for text in menus.

Returns: The font used for text in menus.

getName

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

Returns: The name of the theme.

getPrimary1

protected abstract ColorUIResource getPrimary1()
Returns the first primary color for this theme.

Returns: The first primary color.

getPrimary2

protected abstract ColorUIResource getPrimary2()
Returns the second primary color for this theme.

Returns: The second primary color.

getPrimary3

protected abstract ColorUIResource getPrimary3()
Returns the third primary color for this theme.

Returns: The third primary color.

getPrimaryControl

public ColorUIResource getPrimaryControl()
Returns the primary color for controls. The default implementation returns the color from {@link #getPrimary3()}.

Returns: The primary color for controls.

getPrimaryControlDarkShadow

public ColorUIResource getPrimaryControlDarkShadow()
Returns the primary color for the dark shadow on controls. The default implementation returns the color from {@link #getPrimary1()}.

Returns: The primary color for the dark shadow on controls.

getPrimaryControlHighlight

public ColorUIResource getPrimaryControlHighlight()
Returns the primary color for the highlight on controls. The default implementation returns the color from {@link #getWhite()}.

Returns: The primary color for the highlight on controls.

getPrimaryControlInfo

public ColorUIResource getPrimaryControlInfo()
Returns the primary color for the information on controls. The default implementation returns the color from {@link #getBlack()}.

Returns: The primary color for the information on controls.

getPrimaryControlShadow

public ColorUIResource getPrimaryControlShadow()
Returns the primary color for the shadow on controls. The default implementation returns the color from {@link #getPrimary2()}.

Returns: The primary color for the shadow on controls.

getSecondary1

protected abstract ColorUIResource getSecondary1()
Returns the first secondary color for this theme.

Returns: The first secondary color.

getSecondary2

protected abstract ColorUIResource getSecondary2()
Returns the second secondary color for this theme.

Returns: The second secondary color.

getSecondary3

protected abstract ColorUIResource getSecondary3()
Returns the third secondary color for this theme.

Returns: The third secondary color.

getSeparatorBackground

public ColorUIResource getSeparatorBackground()
Returns the background color for separators. The default implementation returns the color from {@link #getWhite()}.

Returns: The background color for separators.

getSeparatorForeground

public ColorUIResource getSeparatorForeground()
Returns the foreground color for separators. The default implementation returns the value from {@link #getPrimary1()}.

Returns: The foreground color for separators.

getSubTextFont

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

Returns: The font used for sub text.

getSystemTextColor

public ColorUIResource getSystemTextColor()
Returns the color used for system text. The default implementation returns the color from {@link #getBlack()}.

Returns: The color used for system text.

getSystemTextFont

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

Returns: The font used for system text.

getTextHighlightColor

public ColorUIResource getTextHighlightColor()
Returns the color used to highlight text. The default implementation returns the color from {@link #getPrimary3()}.

Returns: The color used to highlight text.

getUserTextColor

public ColorUIResource getUserTextColor()
Returns the color used to display user text. The default implementation returns the color from {@link #getBlack()}.

Returns: The color used to display user text.

getUserTextFont

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

Returns: The font used for user text.

getWhite

protected ColorUIResource getWhite()
Returns the color used for white.

Returns: The color used for white.

getWindowBackground

public ColorUIResource getWindowBackground()
Returns the window background color. The default implementation returns the color from {@link #getWhite()}.

Returns: The window background color.

getWindowTitleBackground

public ColorUIResource getWindowTitleBackground()
Returns the window title background color. The default implementation returns the color from {@link #getPrimary3()}.

Returns: The window title background color.

getWindowTitleFont

public abstract FontUIResource getWindowTitleFont()
Returns the font used for window titles.

Returns: The font used for window titles.

getWindowTitleForeground

public ColorUIResource getWindowTitleForeground()
Returns the window title foreground color. The default implementation returns the color from {@link #getBlack()}.

Returns: The window title foreground color.

getWindowTitleInactiveBackground

public ColorUIResource getWindowTitleInactiveBackground()
Returns the background color for an inactive window title. The default implementation returns the color from {@link #getSecondary3()}.

Returns: The background color for an inactive window title.

getWindowTitleInactiveForeground

public ColorUIResource getWindowTitleInactiveForeground()
Returns the foreground color for an inactive window title. The default implementation returns the color from {@link #getBlack()}.

Returns: The foreground color for an inactive window title.