home *** CD-ROM | disk | FTP | other *** search
/ Chip 1999 July / CHIP-1999-07.iso / software / jdk / jdk121.exe / disk1 / data1.cab / demos / demo / jfc / Metalworks / DemoMetalTheme.java < prev    next >
Encoding:
Java Source  |  1999-03-27  |  2.4 KB  |  64 lines

  1. /*
  2.  * @(#)DemoMetalTheme.java    1.4 98/08/26
  3.  *
  4.  * Copyright 1998 by Sun Microsystems, Inc.,
  5.  * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
  6.  * All rights reserved.
  7.  *
  8.  * This software is the confidential and proprietary information
  9.  * of Sun Microsystems, Inc. ("Confidential Information").  You
  10.  * shall not disclose such Confidential Information and shall use
  11.  * it only in accordance with the terms of the license agreement
  12.  * you entered into with Sun.
  13.  */
  14.  
  15.  
  16. import javax.swing.plaf.*;
  17. import javax.swing.plaf.metal.*;
  18. import javax.swing.*;
  19. import javax.swing.border.*;
  20. import java.awt.*;
  21.  
  22. /**
  23.  * This class describes a theme using large fonts.
  24.  * It's great for giving demos of your software to a group
  25.  * where people will have trouble seeing what you're doing.
  26.  *
  27.  * @version 1.4 08/26/98
  28.  * @author Steve Wilson
  29.  */
  30. public class DemoMetalTheme extends DefaultMetalTheme {
  31.  
  32.     public String getName() { return "Presentation"; }
  33.  
  34.     private final FontUIResource controlFont = new FontUIResource("Dialog", Font.BOLD, 18);
  35.     private final FontUIResource systemFont = new FontUIResource("Dialog", Font.PLAIN, 18);
  36.     private final FontUIResource userFont = new FontUIResource("SansSerif", Font.PLAIN, 18);
  37.     private final FontUIResource smallFont = new FontUIResource("Dialog", Font.PLAIN, 14);
  38.  
  39.     public FontUIResource getControlTextFont() { return controlFont;}
  40.     public FontUIResource getSystemTextFont() { return systemFont;}
  41.     public FontUIResource getUserTextFont() { return userFont;}
  42.     public FontUIResource getMenuTextFont() { return controlFont;}
  43.     public FontUIResource getWindowTitleFont() { return controlFont;}
  44.     public FontUIResource getSubTextFont() { return smallFont;}
  45.  
  46.     public void addCustomEntriesToTable(UIDefaults table) {
  47.          super.addCustomEntriesToTable(table);
  48.  
  49.          final int internalFrameIconSize = 22;
  50.          table.put("InternalFrame.closeIcon", MetalIconFactory.getInternalFrameCloseIcon(internalFrameIconSize));
  51.          table.put("InternalFrame.maximizeIcon", MetalIconFactory.getInternalFrameMaximizeIcon(internalFrameIconSize));
  52.          table.put("InternalFrame.iconizeIcon", MetalIconFactory.getInternalFrameMinimizeIcon(internalFrameIconSize));
  53.          table.put("InternalFrame.minimizeIcon", MetalIconFactory.getInternalFrameAltMaximizeIcon(internalFrameIconSize));
  54.  
  55.  
  56.  
  57.          table.put( "ScrollBar.width", new Integer(21) );
  58.  
  59.  
  60.  
  61.     }
  62.  
  63. }
  64.