java.lang.Objectjavax.swing.plaf.metal.MetalTheme
public abstract class MetalTheme
MetalTheme provides the color palette and fonts used by the Java Look and Feel.
This abstract class acts as a generic way to describe the colors used by Metal. Subclasses of MetalTheme can be used to swap the colors in a Metal application.
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 Summary | |
---|---|
MetalTheme
() |
Method Summary | |
---|---|
void |
addCustomEntriesToTable
(
UIDefaults
![]() ![]() |
ColorUIResource |
getAcceleratorForeground
() ![]() ![]() |
ColorUIResource |
getAcceleratorSelectedForeground
() ![]() ![]() |
protected ColorUIResource |
getBlack
() ![]() ![]() |
ColorUIResource |
getControl
() ![]() ![]() |
ColorUIResource |
getControlDarkShadow
() ![]() ![]() |
ColorUIResource |
getControlDisabled
() ![]() ![]() |
ColorUIResource |
getControlHighlight
() ![]() ![]() |
ColorUIResource |
getControlInfo
() ![]() ![]() |
ColorUIResource |
getControlShadow
() ![]() ![]() |
ColorUIResource |
getControlTextColor
() ![]() ![]() |
abstract FontUIResource |
getControlTextFont
() ![]() ![]() |
ColorUIResource |
getDesktopColor
() ![]() ![]() |
ColorUIResource |
getFocusColor
() ![]() ![]() |
ColorUIResource |
getHighlightedTextColor
() ![]() ![]() |
ColorUIResource |
getInactiveControlTextColor
() ![]() ![]() |
ColorUIResource |
getInactiveSystemTextColor
() ![]() ![]() |
ColorUIResource |
getMenuBackground
() ![]() ![]() |
ColorUIResource |
getMenuDisabledForeground
() ![]() ![]() |
ColorUIResource |
getMenuForeground
() ![]() ![]() |
ColorUIResource |
getMenuSelectedBackground
() ![]() ![]() |
ColorUIResource |
getMenuSelectedForeground
() ![]() ![]() |
abstract FontUIResource |
getMenuTextFont
() ![]() ![]() |
abstract String |
getName
() ![]() ![]() |
protected abstract ColorUIResource |
getPrimary1
() ![]() ![]() |
protected abstract ColorUIResource |
getPrimary2
() ![]() ![]() |
protected abstract ColorUIResource |
getPrimary3
() ![]() ![]() |
ColorUIResource |
getPrimaryControl
() ![]() ![]() |
ColorUIResource |
getPrimaryControlDarkShadow
() ![]() ![]() |
ColorUIResource |
getPrimaryControlHighlight
() ![]() ![]() |
ColorUIResource |
getPrimaryControlInfo
() ![]() ![]() |
ColorUIResource |
getPrimaryControlShadow
() ![]() ![]() |
protected abstract ColorUIResource |
getSecondary1
() ![]() ![]() |
protected abstract ColorUIResource |
getSecondary2
() ![]() ![]() |
protected abstract ColorUIResource |
getSecondary3
() ![]() ![]() |
ColorUIResource |
getSeparatorBackground
() ![]() ![]() |
ColorUIResource |
getSeparatorForeground
() ![]() ![]() |
abstract FontUIResource |
getSubTextFont
() ![]() ![]() |
ColorUIResource |
getSystemTextColor
() Returns the ![]() ![]() ![]() ![]() |
abstract FontUIResource |
getSystemTextFont
() ![]() ![]() |
ColorUIResource |
getTextHighlightColor
() ![]() ![]() |
ColorUIResource |
getUserTextColor
() ![]() ![]() |
abstract FontUIResource |
getUserTextFont
() ![]() ![]() |
protected ColorUIResource |
getWhite
() ![]() ![]() |
ColorUIResource |
getWindowBackground
() ![]() ![]() |
ColorUIResource |
getWindowTitleBackground
() ![]() ![]() |
abstract FontUIResource |
getWindowTitleFont
() ![]() ![]() |
ColorUIResource |
getWindowTitleForeground
() ![]() ![]() |
ColorUIResource |
getWindowTitleInactiveBackground
() ![]() ![]() |
ColorUIResource |
getWindowTitleInactiveForeground
() ![]() ![]() |
Methods inherited from class java.lang. Object |
---|
clone , equals , finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait |
Constructor Detail |
---|
public MetalTheme()
Method Detail |
---|
public abstract String getName()
protected abstract ColorUIResource getPrimary1()
protected abstract ColorUIResource getPrimary2()
protected abstract ColorUIResource getPrimary3()
protected abstract ColorUIResource getSecondary1()
protected abstract ColorUIResource getSecondary2()
protected abstract ColorUIResource getSecondary3()
public abstract FontUIResource getControlTextFont()
public abstract FontUIResource getSystemTextFont()
public abstract FontUIResource getUserTextFont()
public abstract FontUIResource getMenuTextFont()
public abstract FontUIResource getWindowTitleFont()
public abstract FontUIResource getSubTextFont()
protected ColorUIResource getWhite()
protected ColorUIResource getBlack()
public ColorUIResource getFocusColor()
public ColorUIResource getDesktopColor()
public ColorUIResource getControl()
public ColorUIResource getControlShadow()
public ColorUIResource getControlDarkShadow()
public ColorUIResource getControlInfo()
public ColorUIResource getControlHighlight()
public ColorUIResource getControlDisabled()
public ColorUIResource getPrimaryControl()
public ColorUIResource getPrimaryControlShadow()
public ColorUIResource getPrimaryControlDarkShadow()
public ColorUIResource getPrimaryControlInfo()
public ColorUIResource getPrimaryControlHighlight()
public ColorUIResource getSystemTextColor()
public ColorUIResource getControlTextColor()
public ColorUIResource getInactiveControlTextColor()
public ColorUIResource getInactiveSystemTextColor()
public ColorUIResource getUserTextColor()
public ColorUIResource getTextHighlightColor()
public ColorUIResource getHighlightedTextColor()
public ColorUIResource getWindowBackground()
public ColorUIResource getWindowTitleBackground()
public ColorUIResource getWindowTitleForeground()
public ColorUIResource getWindowTitleInactiveBackground()
public ColorUIResource getWindowTitleInactiveForeground()
public ColorUIResource getMenuBackground()
public ColorUIResource getMenuForeground()
public ColorUIResource getMenuSelectedBackground()
public ColorUIResource getMenuSelectedForeground()
public ColorUIResource getMenuDisabledForeground()
public ColorUIResource getSeparatorBackground()
public ColorUIResource getSeparatorForeground()
public ColorUIResource getAcceleratorForeground()
public ColorUIResource getAcceleratorSelectedForeground()
public void addCustomEntriesToTable(UIDefaults table)
This implementation does nothing; it is provided for subclasses that wish to customize the defaults table.