1 5 package javax.swing.plaf.metal; 6 7 import java.awt.*; 8 import java.beans.*; 9 import javax.swing.*; 10 11 17 class MetalFontDesktopProperty extends com.sun.java.swing.plaf.windows.DesktopProperty { 18 22 private static final String [] propertyMapping = { 23 "win.ansiVar.font.height", 24 "win.tooltip.font.height", 25 "win.ansiVar.font.height", 26 "win.menu.font.height", 27 "win.frame.captionFont.height", 28 "win.menu.font.height" 29 }; 30 31 34 private int type; 35 36 37 43 MetalFontDesktopProperty(int type) { 44 this(propertyMapping[type], Toolkit.getDefaultToolkit(), type); 45 } 46 47 56 MetalFontDesktopProperty(String key, Toolkit kit, int type) { 57 super(key, null, kit); 58 this.type = type; 59 } 60 61 65 protected Object configureValue(Object value) { 66 if (value instanceof Integer ) { 67 value = new Font(DefaultMetalTheme.getDefaultFontName(type), 68 DefaultMetalTheme.getDefaultFontStyle(type), 69 ((Integer )value).intValue()); 70 } 71 return super.configureValue(value); 72 } 73 74 77 protected Object getDefaultValue() { 78 return new Font(DefaultMetalTheme.getDefaultFontName(type), 79 DefaultMetalTheme.getDefaultFontStyle(type), 80 DefaultMetalTheme.getDefaultFontSize(type)); 81 } 82 } 83 | Popular Tags |