FileDocCategorySizeDatePackage
MetalTheme.javaAPI DocJava SE 6 API14117Tue Jun 10 00:26:50 BST 2008javax.swing.plaf.metal

MetalTheme

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.

see
DefaultMetalTheme
see
OceanTheme
see
MetalLookAndFeel#setCurrentTheme
version
1.29 07/12/06
author
Steve Wilson

Fields Summary
static final int
CONTROL_TEXT_FONT
static final int
SYSTEM_TEXT_FONT
static final int
USER_TEXT_FONT
static final int
MENU_TEXT_FONT
static final int
WINDOW_TITLE_FONT
static final int
SUB_TEXT_FONT
static ColorUIResource
white
private static ColorUIResource
black
Constructors Summary
Methods Summary
public voidaddCustomEntriesToTable(javax.swing.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.

param
table the {@code UIDefaults} to add the values to
see
MetalLookAndFeel#getDefaults

public javax.swing.plaf.ColorUIResourcegetAcceleratorForeground()
Returns the accelerator foreground color. This returns the value of {@code getPrimary1()}.

return
the accelerator foreground color

 return getPrimary1(); 
public javax.swing.plaf.ColorUIResourcegetAcceleratorSelectedForeground()
Returns the accelerator selected foreground color. This returns the value of {@code getBlack()}.

return
the accelerator selected foreground color

 return getBlack(); 
protected javax.swing.plaf.ColorUIResourcegetBlack()
Returns the black color. This returns opaque black ({@code 0xFF000000}).

return
the black color

 return black; 
public javax.swing.plaf.ColorUIResourcegetControl()
Returns the control color. This returns the value of {@code getSecondary3()}.

return
the control color

 return getSecondary3(); 
public javax.swing.plaf.ColorUIResourcegetControlDarkShadow()
Returns the control dark shadow color. This returns the value of {@code getSecondary1()}.

return
the control dark shadow color

 return getSecondary1(); 
public javax.swing.plaf.ColorUIResourcegetControlDisabled()
Returns the control disabled color. This returns the value of {@code getSecondary2()}.

return
the control disabled color

 return getSecondary2(); 
public javax.swing.plaf.ColorUIResourcegetControlHighlight()
Returns the control highlight color. This returns the value of {@code getWhite()}.

return
the control highlight color

 return getWhite(); 
public javax.swing.plaf.ColorUIResourcegetControlInfo()
Returns the control info color. This returns the value of {@code getBlack()}.

return
the control info color

 return getBlack(); 
public javax.swing.plaf.ColorUIResourcegetControlShadow()
Returns the control shadow color. This returns the value of {@code getSecondary2()}.

return
the control shadow color

 return getSecondary2(); 
public javax.swing.plaf.ColorUIResourcegetControlTextColor()
Returns the control text color. This returns the value of {@code getControlInfo()}.

return
the control text color

 return getControlInfo(); 
public abstract javax.swing.plaf.FontUIResourcegetControlTextFont()
Returns the control text font.

return
the control text font

public javax.swing.plaf.ColorUIResourcegetDesktopColor()
Returns the desktop color. This returns the value of {@code getPrimary2()}.

return
the desktop color

 return getPrimary2(); 
public javax.swing.plaf.ColorUIResourcegetFocusColor()
Returns the focus color. This returns the value of {@code getPrimary2()}.

return
the focus color

 return getPrimary2(); 
public javax.swing.plaf.ColorUIResourcegetHighlightedTextColor()
Returns the highlighted text color. This returns the value of {@code getControlTextColor()}.

return
the highlighted text color

 return getControlTextColor(); 
public javax.swing.plaf.ColorUIResourcegetInactiveControlTextColor()
Returns the inactive control text color. This returns the value of {@code getControlDisabled()}.

return
the inactive control text color

 return getControlDisabled(); 
public javax.swing.plaf.ColorUIResourcegetInactiveSystemTextColor()
Returns the inactive system text color. This returns the value of {@code getSecondary2()}.

return
the inactive system text color

 return getSecondary2(); 
public javax.swing.plaf.ColorUIResourcegetMenuBackground()
Returns the menu background color. This returns the value of {@code getSecondary3()}.

return
the menu background color

 return getSecondary3(); 
public javax.swing.plaf.ColorUIResourcegetMenuDisabledForeground()
Returns the menu disabled foreground color. This returns the value of {@code getSecondary2()}.

return
the menu disabled foreground color

 return getSecondary2(); 
public javax.swing.plaf.ColorUIResourcegetMenuForeground()
Returns the menu foreground color. This returns the value of {@code getBlack()}.

return
the menu foreground color

 return  getBlack(); 
public javax.swing.plaf.ColorUIResourcegetMenuSelectedBackground()
Returns the menu selected background color. This returns the value of {@code getPrimary2()}.

return
the menu selected background color

 return getPrimary2(); 
public javax.swing.plaf.ColorUIResourcegetMenuSelectedForeground()
Returns the menu selected foreground color. This returns the value of {@code getBlack()}.

return
the menu selected foreground color

 return getBlack(); 
public abstract javax.swing.plaf.FontUIResourcegetMenuTextFont()
Returns the menu text font.

return
the menu text font

public abstract java.lang.StringgetName()
Returns the name of this theme.

return
the name of this theme

protected abstract javax.swing.plaf.ColorUIResourcegetPrimary1()
Returns the primary 1 color.

return
the primary 1 color

protected abstract javax.swing.plaf.ColorUIResourcegetPrimary2()
Returns the primary 2 color.

return
the primary 2 color

protected abstract javax.swing.plaf.ColorUIResourcegetPrimary3()
Returns the primary 3 color.

return
the primary 3 color

public javax.swing.plaf.ColorUIResourcegetPrimaryControl()
Returns the primary control color. This returns the value of {@code getPrimary3()}.

return
the primary control color

 return getPrimary3(); 
public javax.swing.plaf.ColorUIResourcegetPrimaryControlDarkShadow()
Returns the primary control dark shadow color. This returns the value of {@code getPrimary1()}.

return
the primary control dark shadow color

 return getPrimary1(); 
public javax.swing.plaf.ColorUIResourcegetPrimaryControlHighlight()
Returns the primary control highlight color. This returns the value of {@code getWhite()}.

return
the primary control highlight color

 return getWhite(); 
public javax.swing.plaf.ColorUIResourcegetPrimaryControlInfo()
Returns the primary control info color. This returns the value of {@code getBlack()}.

return
the primary control info color

 return getBlack(); 
public javax.swing.plaf.ColorUIResourcegetPrimaryControlShadow()
Returns the primary control shadow color. This returns the value of {@code getPrimary2()}.

return
the primary control shadow color

 return getPrimary2(); 
protected abstract javax.swing.plaf.ColorUIResourcegetSecondary1()
Returns the secondary 1 color.

return
the secondary 1 color

protected abstract javax.swing.plaf.ColorUIResourcegetSecondary2()
Returns the secondary 2 color.

return
the secondary 2 color

protected abstract javax.swing.plaf.ColorUIResourcegetSecondary3()
Returns the secondary 3 color.

return
the secondary 3 color

public javax.swing.plaf.ColorUIResourcegetSeparatorBackground()
Returns the separator background color. This returns the value of {@code getWhite()}.

return
the separator background color

 return getWhite(); 
public javax.swing.plaf.ColorUIResourcegetSeparatorForeground()
Returns the separator foreground color. This returns the value of {@code getPrimary1()}.

return
the separator foreground color

 return getPrimary1(); 
public abstract javax.swing.plaf.FontUIResourcegetSubTextFont()
Returns the sub-text font.

return
the sub-text font

public javax.swing.plaf.ColorUIResourcegetSystemTextColor()
Returns the system text color. This returns the value of {@code getBlack()}.

return
the system text color

 return getBlack(); 
public abstract javax.swing.plaf.FontUIResourcegetSystemTextFont()
Returns the system text font.

return
the system text font

public javax.swing.plaf.ColorUIResourcegetTextHighlightColor()
Returns the text highlight color. This returns the value of {@code getPrimary3()}.

return
the text highlight color

 return getPrimary3(); 
public javax.swing.plaf.ColorUIResourcegetUserTextColor()
Returns the user text color. This returns the value of {@code getBlack()}.

return
the user text color

 return getBlack(); 
public abstract javax.swing.plaf.FontUIResourcegetUserTextFont()
Returns the user text font.

return
the user text font

protected javax.swing.plaf.ColorUIResourcegetWhite()
Returns the white color. This returns opaque white ({@code 0xFFFFFFFF}).

return
the white color


                     
       

                   
         // these are blue in Metal Default Theme

                   
       

                   
       

                   
         // these are gray in Metal Default Theme

                   
       

                   
       

                   
       

                   
       

                   
       

                   
       

                   
       

                 
       

                       
        return white; 
public javax.swing.plaf.ColorUIResourcegetWindowBackground()
Returns the window background color. This returns the value of {@code getWhite()}.

return
the window background color

 return getWhite(); 
public javax.swing.plaf.ColorUIResourcegetWindowTitleBackground()
Returns the window title background color. This returns the value of {@code getPrimary3()}.

return
the window title background color

 return getPrimary3(); 
public abstract javax.swing.plaf.FontUIResourcegetWindowTitleFont()
Returns the window title font.

return
the window title font

public javax.swing.plaf.ColorUIResourcegetWindowTitleForeground()
Returns the window title foreground color. This returns the value of {@code getBlack()}.

return
the window title foreground color

 return getBlack(); 
public javax.swing.plaf.ColorUIResourcegetWindowTitleInactiveBackground()
Returns the window title inactive background color. This returns the value of {@code getSecondary3()}.

return
the window title inactive background color

 return getSecondary3(); 
public javax.swing.plaf.ColorUIResourcegetWindowTitleInactiveForeground()
Returns the window title inactive foreground color. This returns the value of {@code getBlack()}.

return
the window title inactive foreground color

 return getBlack(); 
voidinstall()
This is invoked when a MetalLookAndFeel is installed and about to start using this theme. When we can add API this should be nuked in favor of DefaultMetalTheme overriding addCustomEntriesToTable.

    
booleanisSystemTheme()
Returns true if this is a theme provided by the core platform.

        return false;