FileDocCategorySizeDatePackage
DefaultMetalTheme.javaAPI DocJava SE 5 API9140Fri Aug 26 14:58:06 BST 2005javax.swing.plaf.metal

DefaultMetalTheme

public class DefaultMetalTheme extends MetalTheme
This class describes the default Metal Theme.

Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. As of 1.4, support for long term storage of all JavaBeansTM has been added to the java.beans package. Please see {@link java.beans.XMLEncoder}.

version
1.27 03/03/04
author
Steve Wilson

Fields Summary
private static final boolean
PLAIN_FONTS
Whether or not fonts should be plain. This is only used if the defaults property 'swing.boldMetal' == "false".
private static final String[]
fontNames
Names of the fonts to use.
private static final int[]
fontStyles
Styles for the fonts. This is ignored if the defaults property swing.boldMetal is false, or PLAIN_FONTS is true.
private static final int[]
fontSizes
Sizes for the fonts.
private static final String[]
defaultNames
System property names used to look up fonts.
private static final ColorUIResource
primary1
private static final ColorUIResource
primary2
private static final ColorUIResource
primary3
private static final ColorUIResource
secondary1
private static final ColorUIResource
secondary2
private static final ColorUIResource
secondary3
private FontDelegate
fontDelegate
Constructors Summary
public DefaultMetalTheme()

        install();
    
Methods Summary
public javax.swing.plaf.FontUIResourcegetControlTextFont()

 
        return getFont(CONTROL_TEXT_FONT);
    
static java.lang.StringgetDefaultFontName(int key)
Returns the ideal font name for the font identified by key.


                    
        
        return fontNames[key];
    
static intgetDefaultFontSize(int key)
Returns the ideal font size for the font identified by key.

        return fontSizes[key];
    
static intgetDefaultFontStyle(int key)
Returns the ideal font style for the font identified by key.

        if (key != WINDOW_TITLE_FONT) {
            Object boldMetal = UIManager.get("swing.boldMetal");
            if (boldMetal != null) {
                if (Boolean.FALSE.equals(boldMetal)) {
                    return Font.PLAIN;
                }
            }
            else if (PLAIN_FONTS) {
                return Font.PLAIN;
            }
        }
        return fontStyles[key];
    
static java.lang.StringgetDefaultPropertyName(int key)
Returns the default used to look up the specified font.

        return defaultNames[key];
    
private javax.swing.plaf.FontUIResourcegetFont(int key)

        return fontDelegate.getFont(key);
    
public javax.swing.plaf.FontUIResourcegetMenuTextFont()

 
        return getFont(MENU_TEXT_FONT);
    
public java.lang.StringgetName()


        return "Steel"; 
protected javax.swing.plaf.ColorUIResourcegetPrimary1()

 return primary1; 
protected javax.swing.plaf.ColorUIResourcegetPrimary2()

 return primary2; 
protected javax.swing.plaf.ColorUIResourcegetPrimary3()

 return primary3; 
protected javax.swing.plaf.ColorUIResourcegetSecondary1()

 return secondary1; 
protected javax.swing.plaf.ColorUIResourcegetSecondary2()

 return secondary2; 
protected javax.swing.plaf.ColorUIResourcegetSecondary3()

 return secondary3; 
public javax.swing.plaf.FontUIResourcegetSubTextFont()

 
        return getFont(SUB_TEXT_FONT);
    
public javax.swing.plaf.FontUIResourcegetSystemTextFont()

 
        return getFont(SYSTEM_TEXT_FONT);
    
public javax.swing.plaf.FontUIResourcegetUserTextFont()

 
        return getFont(USER_TEXT_FONT);
    
public javax.swing.plaf.FontUIResourcegetWindowTitleFont()

 
        return getFont(WINDOW_TITLE_FONT);
    
voidinstall()

        if (MetalLookAndFeel.isWindows() &&
                             MetalLookAndFeel.useSystemFonts()) {
            fontDelegate = new WindowsFontDelegate();
        }
        else {
            fontDelegate = new FontDelegate();
        }
    
booleanisSystemTheme()
Returns true if this is a theme provided by the core platform.

        return (getClass() == DefaultMetalTheme.class);