src/share/classes/javax/swing/plaf/metal/DefaultMetalTheme.java

Print this page


   1 /*
   2  * Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


  71  *
  72  *   // Update the ComponentUIs for all Components. This
  73  *   // needs to be invoked for all windows.
  74  *   SwingUtilities.updateComponentTreeUI(rootComponent);
  75  * </pre>
  76  * <p>
  77  * <strong>Warning:</strong>
  78  * Serialized objects of this class will not be compatible with
  79  * future Swing releases. The current serialization support is
  80  * appropriate for short term storage or RMI between applications running
  81  * the same version of Swing.  As of 1.4, support for long term storage
  82  * of all JavaBeans&trade;
  83  * has been added to the <code>java.beans</code> package.
  84  * Please see {@link java.beans.XMLEncoder}.
  85  *
  86  * @see MetalLookAndFeel
  87  * @see MetalLookAndFeel#setCurrentTheme
  88  *
  89  * @author Steve Wilson
  90  */

  91 public class DefaultMetalTheme extends MetalTheme {
  92     /**
  93      * Whether or not fonts should be plain.  This is only used if
  94      * the defaults property 'swing.boldMetal' == "false".
  95      */
  96     private static final boolean PLAIN_FONTS;
  97 
  98     /**
  99      * Names of the fonts to use.
 100      */
 101     private static final String[] fontNames = {
 102         Font.DIALOG,Font.DIALOG,Font.DIALOG,Font.DIALOG,Font.DIALOG,Font.DIALOG
 103     };
 104     /**
 105      * Styles for the fonts.  This is ignored if the defaults property
 106      * <code>swing.boldMetal</code> is false, or PLAIN_FONTS is true.
 107      */
 108     private static final int[] fontStyles = {
 109         Font.BOLD, Font.PLAIN, Font.PLAIN, Font.BOLD, Font.BOLD, Font.PLAIN
 110     };


   1 /*
   2  * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


  71  *
  72  *   // Update the ComponentUIs for all Components. This
  73  *   // needs to be invoked for all windows.
  74  *   SwingUtilities.updateComponentTreeUI(rootComponent);
  75  * </pre>
  76  * <p>
  77  * <strong>Warning:</strong>
  78  * Serialized objects of this class will not be compatible with
  79  * future Swing releases. The current serialization support is
  80  * appropriate for short term storage or RMI between applications running
  81  * the same version of Swing.  As of 1.4, support for long term storage
  82  * of all JavaBeans&trade;
  83  * has been added to the <code>java.beans</code> package.
  84  * Please see {@link java.beans.XMLEncoder}.
  85  *
  86  * @see MetalLookAndFeel
  87  * @see MetalLookAndFeel#setCurrentTheme
  88  *
  89  * @author Steve Wilson
  90  */
  91 @SuppressWarnings("serial") // Same-version serialization only
  92 public class DefaultMetalTheme extends MetalTheme {
  93     /**
  94      * Whether or not fonts should be plain.  This is only used if
  95      * the defaults property 'swing.boldMetal' == "false".
  96      */
  97     private static final boolean PLAIN_FONTS;
  98 
  99     /**
 100      * Names of the fonts to use.
 101      */
 102     private static final String[] fontNames = {
 103         Font.DIALOG,Font.DIALOG,Font.DIALOG,Font.DIALOG,Font.DIALOG,Font.DIALOG
 104     };
 105     /**
 106      * Styles for the fonts.  This is ignored if the defaults property
 107      * <code>swing.boldMetal</code> is false, or PLAIN_FONTS is true.
 108      */
 109     private static final int[] fontStyles = {
 110         Font.BOLD, Font.PLAIN, Font.PLAIN, Font.BOLD, Font.BOLD, Font.PLAIN
 111     };