1 36 37 40 41 42 import javax.swing.plaf.*; 43 import javax.swing.plaf.metal.*; 44 import javax.swing.*; 45 import javax.swing.border.*; 46 import java.awt.*; 47 48 54 public class BigContrastMetalTheme extends ContrastMetalTheme { 55 56 public String getName() { return "Low Vision"; } 57 58 private final FontUIResource controlFont = new FontUIResource("Dialog", Font.BOLD, 24); 59 private final FontUIResource systemFont = new FontUIResource("Dialog", Font.PLAIN, 24); 60 private final FontUIResource windowTitleFont = new FontUIResource("Dialog", Font.BOLD, 24); 61 private final FontUIResource userFont = new FontUIResource("SansSerif", Font.PLAIN, 24); 62 private final FontUIResource smallFont = new FontUIResource("Dialog", Font.PLAIN, 20); 63 64 65 public FontUIResource getControlTextFont() { return controlFont;} 66 public FontUIResource getSystemTextFont() { return systemFont;} 67 public FontUIResource getUserTextFont() { return userFont;} 68 public FontUIResource getMenuTextFont() { return controlFont;} 69 public FontUIResource getWindowTitleFont() { return windowTitleFont;} 70 public FontUIResource getSubTextFont() { return smallFont;} 71 72 public void addCustomEntriesToTable(UIDefaults table) { 73 super.addCustomEntriesToTable(table); 74 75 final int internalFrameIconSize = 30; 76 table.put("InternalFrame.closeIcon", MetalIconFactory.getInternalFrameCloseIcon(internalFrameIconSize)); 77 table.put("InternalFrame.maximizeIcon", MetalIconFactory.getInternalFrameMaximizeIcon(internalFrameIconSize)); 78 table.put("InternalFrame.iconifyIcon", MetalIconFactory.getInternalFrameMinimizeIcon(internalFrameIconSize)); 79 table.put("InternalFrame.minimizeIcon", MetalIconFactory.getInternalFrameAltMaximizeIcon(internalFrameIconSize)); 80 81 82 Border blackLineBorder = new BorderUIResource( new MatteBorder( 2,2,2,2, Color.black) ); 83 Border textBorder = blackLineBorder; 84 85 table.put( "ToolTip.border", blackLineBorder); 86 table.put( "TitledBorder.border", blackLineBorder); 87 88 89 table.put( "TextField.border", textBorder); 90 table.put( "PasswordField.border", textBorder); 91 table.put( "TextArea.border", textBorder); 92 table.put( "TextPane.font", textBorder); 93 94 table.put( "ScrollPane.border", blackLineBorder); 95 96 table.put( "ScrollBar.width", new Integer (25) ); 97 98 99 100 } 101 } 102 | Popular Tags |