javax.swing.plaf.metal

Class MetalTheme

Known Direct Subclasses:
DefaultMetalTheme

public abstract class MetalTheme
extends Object

The base class for themes used by the MetalLookAndFeel. A default theme (DefaultMetalTheme) is provided, or you can create and use your own.
See Also:
MetalLookAndFeel.setCurrentTheme(MetalTheme)

Constructor Summary

MetalTheme()
Default constructor.

Method Summary

void
addCustomEntriesToTable(UIDefaults table)
Adds custom entries to the UI defaults table.
ColorUIResource
getAcceleratorForeground()
Returns the accelerator foreground color.
ColorUIResource
getAcceleratorSelectedForeground()
Returns the accelerator selected foreground color.
protected ColorUIResource
getBlack()
Returns the color used for black.
ColorUIResource
getControl()
Returns the control color.
ColorUIResource
getControlDarkShadow()
Returns the color used for dark shadows on controls.
ColorUIResource
getControlDisabled()
Returns the color used for disabled controls.
ColorUIResource
getControlHighlight()
Returns the color used to draw highlights for controls.
ColorUIResource
getControlInfo()
Returns the color used to display control info.
ColorUIResource
getControlShadow()
Returns the color used to draw shadows for controls.
ColorUIResource
getControlTextColor()
Returns the color used for text on controls.
abstract FontUIResource
getControlTextFont()
Returns the font used for text on controls.
ColorUIResource
getDesktopColor()
Returns the color used for the desktop background.
ColorUIResource
getFocusColor()
Returns the color used to draw focus highlights.
ColorUIResource
getHighlightedTextColor()
Returns the color used to draw highlighted text.
ColorUIResource
getInactiveControlTextColor()
Returns the color used to draw text on inactive controls.
ColorUIResource
getInactiveSystemTextColor()
Returns the color used to draw inactive system text.
ColorUIResource
getMenuBackground()
Returns the background color for menu items.
ColorUIResource
getMenuDisabledForeground()
Returns the foreground color for disabled menu items.
ColorUIResource
getMenuForeground()
Returns the foreground color for menu items.
ColorUIResource
getMenuSelectedBackground()
Returns the background color for selected menu items.
ColorUIResource
getMenuSelectedForeground()
Returns the foreground color for selected menu items.
abstract FontUIResource
getMenuTextFont()
Returns the font used for text in menus.
abstract String
getName()
Returns the name of the theme.
protected abstract ColorUIResource
getPrimary1()
Returns the first primary color for this theme.
protected abstract ColorUIResource
getPrimary2()
Returns the second primary color for this theme.
protected abstract ColorUIResource
getPrimary3()
Returns the third primary color for this theme.
ColorUIResource
getPrimaryControl()
Returns the primary color for controls.
ColorUIResource
getPrimaryControlDarkShadow()
Returns the primary color for the dark shadow on controls.
ColorUIResource
getPrimaryControlHighlight()
Returns the primary color for the highlight on controls.
ColorUIResource
getPrimaryControlInfo()
Returns the primary color for the information on controls.
ColorUIResource
getPrimaryControlShadow()
Returns the primary color for the shadow on controls.
protected abstract ColorUIResource
getSecondary1()
Returns the first secondary color for this theme.
protected abstract ColorUIResource
getSecondary2()
Returns the second secondary color for this theme.
protected abstract ColorUIResource
getSecondary3()
Returns the third secondary color for this theme.
ColorUIResource
getSeparatorBackground()
Returns the background color for separators.
ColorUIResource
getSeparatorForeground()
Returns the foreground color for separators.
abstract FontUIResource
getSubTextFont()
Returns the font used for sub text.
ColorUIResource
getSystemTextColor()
Returns the color used for system text.
abstract FontUIResource
getSystemTextFont()
Returns the font used for system text.
ColorUIResource
getTextHighlightColor()
Returns the color used to highlight text.
ColorUIResource
getUserTextColor()
Returns the color used to display user text.
abstract FontUIResource
getUserTextFont()
Returns the font used for user text.
protected ColorUIResource
getWhite()
Returns the color used for white.
ColorUIResource
getWindowBackground()
Returns the window background color.
ColorUIResource
getWindowTitleBackground()
Returns the window title background color.
abstract FontUIResource
getWindowTitleFont()
Returns the font used for window titles.
ColorUIResource
getWindowTitleForeground()
Returns the window title foreground color.
ColorUIResource
getWindowTitleInactiveBackground()
Returns the background color for an inactive window title.
ColorUIResource
getWindowTitleInactiveForeground()
Returns the foreground color for an inactive window title.

Methods inherited from class java.lang.Object

clone, equals, extends Object> getClass, finalize, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Details

MetalTheme

public MetalTheme()
Default constructor.

Method Details

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 getPrimary1().
Returns:
The accelerator foreground color.

getAcceleratorSelectedForeground

public ColorUIResource getAcceleratorSelectedForeground()
Returns the accelerator selected foreground color. The default implementation returns the color from 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 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 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 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 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 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 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 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 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 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 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 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 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 getSecondary3().
Returns:
The background color for menu items.

getMenuDisabledForeground

public ColorUIResource getMenuDisabledForeground()
Returns the foreground color for disabled menu items. The default implementation returns the color from getSecondary2().
Returns:
The foreground color for disabled menu items.

getMenuForeground

public ColorUIResource getMenuForeground()
Returns the foreground color for menu items. The default implementation returns the color from getBlack().
Returns:
The foreground color for menu items.

getMenuSelectedBackground

public ColorUIResource getMenuSelectedBackground()
Returns the background color for selected menu items. The default implementation returns the color from getPrimary2().
Returns:
The background color for selected menu items.

getMenuSelectedForeground

public ColorUIResource getMenuSelectedForeground()
Returns the foreground color for selected menu items. The default implementation returns the value from getBlack().
Returns:
The foreground color for selected menu items.

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 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 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 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 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 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 getWhite().
Returns:
The background color for separators.

getSeparatorForeground

public ColorUIResource getSeparatorForeground()
Returns the foreground color for separators. The default implementation returns the value from 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 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 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 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 getWhite().
Returns:
The window background color.

getWindowTitleBackground

public ColorUIResource getWindowTitleBackground()
Returns the window title background color. The default implementation returns the color from 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 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 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 getBlack().
Returns:
The foreground color for an inactive window title.

MetalTheme.java -- Copyright (C) 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Classpath. GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GNU Classpath; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version.