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

MetalFontDesktopProperty

public class MetalFontDesktopProperty extends com.sun.java.swing.plaf.windows.DesktopProperty
DesktopProperty that only uses font height in configuring font. This is only used on Windows.
version
@(#)MetalFontDesktopProperty.java 1.4 03/12/19

Fields Summary
private static final String[]
propertyMapping
Maps from metal font theme type as defined in MetalTheme to the corresponding desktop property name.
private int
type
Corresponds to a MetalTheme font type.
Constructors Summary
MetalFontDesktopProperty(int type)
Creates a MetalFontDesktopProperty. The key used to lookup the desktop property is determined from the type of font.

param
type MetalTheme font type.



                                
      
        this(propertyMapping[type], Toolkit.getDefaultToolkit(), type);
    
MetalFontDesktopProperty(String key, Toolkit kit, int type)
Creates a MetalFontDesktopProperty.

param
key Key used in looking up desktop value.
param
toolkit Toolkit used to fetch property from, can be null in which default will be used.
param
type Type of font being used, corresponds to MetalTheme font type.

        super(key, null, kit);
        this.type = type;
    
Methods Summary
protected java.lang.ObjectconfigureValue(java.lang.Object value)
Overriden to create a Font with the size coming from the desktop and the style and name coming from DefaultMetalTheme.

        if (value instanceof Integer) {
            value = new Font(DefaultMetalTheme.getDefaultFontName(type),
                             DefaultMetalTheme.getDefaultFontStyle(type),
                             ((Integer)value).intValue());
        }
        return super.configureValue(value);
    
protected java.lang.ObjectgetDefaultValue()
Returns the default font.

        return new Font(DefaultMetalTheme.getDefaultFontName(type),
                        DefaultMetalTheme.getDefaultFontStyle(type),
                        DefaultMetalTheme.getDefaultFontSize(type));