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.
| Constructor and Description |
|---|
MetalTheme()
|
| Modifier and Type | Method and Description |
|---|---|
void |
addCustomEntriesToTable(UIDefaults
Adds values specific to this theme to the defaults table.
|
ColorUIResource |
getAcceleratorForeground()
Returns the accelerator foreground color.
|
ColorUIResource |
getAcceleratorSelectedForeground()
Returns the accelerator selected foreground color.
|
protected ColorUIResource |
getBlack()
Returns the black color.
|
ColorUIResource |
getControl()
Returns the control color.
|
ColorUIResource |
getControlDarkShadow()
Returns the control dark shadow color.
|
ColorUIResource |
getControlDisabled()
Returns the control disabled color.
|
ColorUIResource |
getControlHighlight()
Returns the control highlight color.
|
ColorUIResource |
getControlInfo()
Returns the control info color.
|
ColorUIResource |
getControlShadow()
Returns the control shadow color.
|
ColorUIResource |
getControlTextColor()
Returns the control text color.
|
abstract FontUIResource |
getControlTextFont()
Returns the control text font.
|
ColorUIResource |
getDesktopColor()
Returns the desktop color.
|
ColorUIResource |
getFocusColor()
Returns the focus color.
|
ColorUIResource |
getHighlightedTextColor()
Returns the highlighted text color.
|
ColorUIResource |
getInactiveControlTextColor()
Returns the inactive control text color.
|
ColorUIResource |
getInactiveSystemTextColor()
Returns the inactive system text color.
|
ColorUIResource |
getMenuBackground()
Returns the menu background color.
|
ColorUIResource |
getMenuDisabledForeground()
Returns the menu disabled foreground color.
|
ColorUIResource |
getMenuForeground()
Returns the menu foreground color.
|
ColorUIResource |
getMenuSelectedBackground()
Returns the menu selected background color.
|
ColorUIResource |
getMenuSelectedForeground()
Returns the menu selected foreground color.
|
abstract FontUIResource |
getMenuTextFont()
Returns the menu text font.
|
abstract String |
getName()
Returns the name of this theme.
|
protected abstract ColorUIResource |
getPrimary1()
Returns the primary 1 color.
|
protected abstract ColorUIResource |
getPrimary2()
Returns the primary 2 color.
|
protected abstract ColorUIResource |
getPrimary3()
Returns the primary 3 color.
|
ColorUIResource |
getPrimaryControl()
Returns the primary control color.
|
ColorUIResource |
getPrimaryControlDarkShadow()
Returns the primary control dark shadow color.
|
ColorUIResource |
getPrimaryControlHighlight()
Returns the primary control highlight color.
|
ColorUIResource |
getPrimaryControlInfo()
Returns the primary control info color.
|
ColorUIResource |
getPrimaryControlShadow()
Returns the primary control shadow color.
|
protected abstract ColorUIResource |
getSecondary1()
Returns the secondary 1 color.
|
protected abstract ColorUIResource |
getSecondary2()
Returns the secondary 2 color.
|
protected abstract ColorUIResource |
getSecondary3()
Returns the secondary 3 color.
|
ColorUIResource |
getSeparatorBackground()
Returns the separator background color.
|
ColorUIResource |
getSeparatorForeground()
Returns the separator foreground color.
|
abstract FontUIResource |
getSubTextFont()
Returns the sub-text font.
|
ColorUIResource |
getSystemTextColor()
Returns the system text color.
|
abstract FontUIResource |
getSystemTextFont()
Returns the system text font.
|
ColorUIResource |
getTextHighlightColor()
Returns the text highlight color.
|
ColorUIResource |
getUserTextColor()
Returns the user text color.
|
abstract FontUIResource |
getUserTextFont()
Returns the user text font.
|
protected ColorUIResource |
getWhite()
Returns the white color.
|
ColorUIResource |
getWindowBackground()
Returns the window background color.
|
ColorUIResource |
getWindowTitleBackground()
Returns the window title background color.
|
abstract FontUIResource |
getWindowTitleFont()
Returns the window title font.
|
ColorUIResource |
getWindowTitleForeground()
Returns the window title foreground color.
|
ColorUIResource |
getWindowTitleInactiveBackground()
Returns the window title inactive background color.
|
ColorUIResource |
getWindowTitleInactiveForeground()
Returns the window title inactive foreground color.
|
public abstract StringgetName()
protected abstract ColorUIResourcegetPrimary1()
protected abstract ColorUIResourcegetPrimary2()
protected abstract ColorUIResourcegetPrimary3()
protected abstract ColorUIResourcegetSecondary1()
protected abstract ColorUIResourcegetSecondary2()
protected abstract ColorUIResourcegetSecondary3()
public abstract FontUIResourcegetControlTextFont()
public abstract FontUIResourcegetSystemTextFont()
public abstract FontUIResourcegetUserTextFont()
public abstract FontUIResourcegetMenuTextFont()
public abstract FontUIResourcegetWindowTitleFont()
public abstract FontUIResourcegetSubTextFont()
protected ColorUIResourcegetWhite()
0xFFFFFFFF).
protected ColorUIResourcegetBlack()
0xFF000000).
public ColorUIResourcegetFocusColor()
getPrimary2().
public ColorUIResourcegetDesktopColor()
getPrimary2().
public ColorUIResourcegetControl()
getSecondary3().
public ColorUIResourcegetControlShadow()
getSecondary2().
public ColorUIResourcegetControlDarkShadow()
getSecondary1().
public ColorUIResourcegetControlInfo()
getBlack().
public ColorUIResourcegetControlHighlight()
getWhite().
public ColorUIResourcegetControlDisabled()
getSecondary2().
public ColorUIResourcegetPrimaryControl()
getPrimary3().
public ColorUIResourcegetPrimaryControlShadow()
getPrimary2().
public ColorUIResourcegetPrimaryControlDarkShadow()
getPrimary1().
public ColorUIResourcegetPrimaryControlInfo()
getBlack().
public ColorUIResourcegetPrimaryControlHighlight()
getWhite().
public ColorUIResourcegetSystemTextColor()
getBlack().
public ColorUIResourcegetControlTextColor()
getControlInfo().
public ColorUIResourcegetInactiveControlTextColor()
getControlDisabled().
public ColorUIResourcegetInactiveSystemTextColor()
getSecondary2().
public ColorUIResourcegetUserTextColor()
getBlack().
public ColorUIResourcegetTextHighlightColor()
getPrimary3().
public ColorUIResourcegetHighlightedTextColor()
getControlTextColor().
public ColorUIResourcegetWindowBackground()
getWhite().
public ColorUIResourcegetWindowTitleBackground()
getPrimary3().
public ColorUIResourcegetWindowTitleForeground()
getBlack().
public ColorUIResourcegetWindowTitleInactiveBackground()
getSecondary3().
public ColorUIResourcegetWindowTitleInactiveForeground()
getBlack().
public ColorUIResourcegetMenuBackground()
getSecondary3().
public ColorUIResourcegetMenuForeground()
getBlack().
public ColorUIResourcegetMenuSelectedBackground()
getPrimary2().
public ColorUIResourcegetMenuSelectedForeground()
getBlack().
public ColorUIResourcegetMenuDisabledForeground()
getSecondary2().
public ColorUIResourcegetSeparatorBackground()
getWhite().
public ColorUIResourcegetSeparatorForeground()
getPrimary1().
public ColorUIResourcegetAcceleratorForeground()
getPrimary1().
public ColorUIResourcegetAcceleratorSelectedForeground()
getBlack().
public void addCustomEntriesToTable(UIDefaultstable)
MetalLookAndFeel.
This implementation does nothing; it is provided for subclasses that wish to customize the defaults table.
table - the
UIDefaults to add the values to
MetalLookAndFeel.getDefaults()