home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / J A V A / Java Development Kit V1.2 / jdk12-win32(1).exe / data1.cab / demos / demo / jfc / Metalworks / BigContrastMetalTheme.java < prev    next >
Encoding:
Java Source  |  1998-12-01  |  2.9 KB  |  76 lines

  1. /*
  2.  * @(#)BigContrastMetalTheme.java    1.7 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 "green" colors.
  24.  *
  25.  * @version 1.7 08/26/98
  26.  * @author Steve Wilson
  27.  */
  28. public class BigContrastMetalTheme extends ContrastMetalTheme {
  29.  
  30.     public String getName() { return "Low Vision"; }
  31.  
  32.     private final FontUIResource controlFont = new FontUIResource("Dialog", Font.BOLD, 24);
  33.     private final FontUIResource systemFont = new FontUIResource("Dialog", Font.PLAIN, 24);
  34.     private final FontUIResource windowTitleFont = new FontUIResource("Dialog", Font.BOLD, 24);
  35.     private final FontUIResource userFont = new FontUIResource("SansSerif", Font.PLAIN, 24);
  36.     private final FontUIResource smallFont = new FontUIResource("Dialog", Font.PLAIN, 20);
  37.  
  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 windowTitleFont;}
  44.     public FontUIResource getSubTextFont() { return smallFont;}
  45.  
  46.     public void addCustomEntriesToTable(UIDefaults table) {
  47.          super.addCustomEntriesToTable(table);
  48.  
  49.          final int internalFrameIconSize = 30;
  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.     Border blackLineBorder = new BorderUIResource( new MatteBorder( 2,2,2,2, Color.black) );
  57.     Border textBorder = blackLineBorder;
  58.  
  59.         table.put( "ToolTip.border", blackLineBorder);
  60.     table.put( "TitledBorder.border", blackLineBorder);
  61.  
  62.  
  63.         table.put( "TextField.border", textBorder);
  64.         table.put( "PasswordField.border", textBorder);
  65.         table.put( "TextArea.border", textBorder);
  66.         table.put( "TextPane.font", textBorder);
  67.  
  68.         table.put( "ScrollPane.border", blackLineBorder);
  69.  
  70.         table.put( "ScrollBar.width", new Integer(25) );
  71.  
  72.  
  73.  
  74.     }
  75. }
  76.