src/share/classes/javax/swing/plaf/nimbus/NimbusLookAndFeel.java

Print this page


   1 /*
   2  * Copyright (c) 2005, 2013, 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


  44 import java.beans.PropertyChangeListener;
  45 import java.util.*;
  46 import javax.swing.GrayFilter;
  47 import javax.swing.Icon;
  48 import javax.swing.JToolBar;
  49 import javax.swing.border.TitledBorder;
  50 import javax.swing.plaf.BorderUIResource;
  51 import javax.swing.plaf.ColorUIResource;
  52 import sun.swing.ImageIconUIResource;
  53 import sun.swing.plaf.synth.SynthIcon;
  54 import sun.swing.plaf.GTKKeybindings;
  55 import sun.swing.plaf.WindowsKeybindings;
  56 import sun.security.action.GetPropertyAction;
  57 
  58 /**
  59  * <p>The NimbusLookAndFeel class.</p>
  60  *
  61  * @author Jasper Potts
  62  * @author Richard Bair
  63  */

  64 public class NimbusLookAndFeel extends SynthLookAndFeel {
  65 
  66     /** Set of standard region names for UIDefaults Keys */
  67     private static final String[] COMPONENT_KEYS = new String[]{"ArrowButton", "Button",
  68                     "CheckBox", "CheckBoxMenuItem", "ColorChooser", "ComboBox",
  69                     "DesktopPane", "DesktopIcon", "EditorPane", "FileChooser",
  70                     "FormattedTextField", "InternalFrame",
  71                     "InternalFrameTitlePane", "Label", "List", "Menu",
  72                     "MenuBar", "MenuItem", "OptionPane", "Panel",
  73                     "PasswordField", "PopupMenu", "PopupMenuSeparator",
  74                     "ProgressBar", "RadioButton", "RadioButtonMenuItem",
  75                     "RootPane", "ScrollBar", "ScrollBarTrack", "ScrollBarThumb",
  76                     "ScrollPane", "Separator", "Slider", "SliderTrack",
  77                     "SliderThumb", "Spinner", "SplitPane", "TabbedPane",
  78                     "Table", "TableHeader", "TextArea", "TextField", "TextPane",
  79                     "ToggleButton", "ToolBar", "ToolTip", "Tree", "Viewport"};
  80 
  81     /**
  82      * A reference to the auto-generated file NimbusDefaults. This file contains
  83      * the default mappings and values for the look and feel as specified in the


   1 /*
   2  * Copyright (c) 2005, 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


  44 import java.beans.PropertyChangeListener;
  45 import java.util.*;
  46 import javax.swing.GrayFilter;
  47 import javax.swing.Icon;
  48 import javax.swing.JToolBar;
  49 import javax.swing.border.TitledBorder;
  50 import javax.swing.plaf.BorderUIResource;
  51 import javax.swing.plaf.ColorUIResource;
  52 import sun.swing.ImageIconUIResource;
  53 import sun.swing.plaf.synth.SynthIcon;
  54 import sun.swing.plaf.GTKKeybindings;
  55 import sun.swing.plaf.WindowsKeybindings;
  56 import sun.security.action.GetPropertyAction;
  57 
  58 /**
  59  * <p>The NimbusLookAndFeel class.</p>
  60  *
  61  * @author Jasper Potts
  62  * @author Richard Bair
  63  */
  64 @SuppressWarnings("serial") // Superclass is not serializable across versions
  65 public class NimbusLookAndFeel extends SynthLookAndFeel {
  66 
  67     /** Set of standard region names for UIDefaults Keys */
  68     private static final String[] COMPONENT_KEYS = new String[]{"ArrowButton", "Button",
  69                     "CheckBox", "CheckBoxMenuItem", "ColorChooser", "ComboBox",
  70                     "DesktopPane", "DesktopIcon", "EditorPane", "FileChooser",
  71                     "FormattedTextField", "InternalFrame",
  72                     "InternalFrameTitlePane", "Label", "List", "Menu",
  73                     "MenuBar", "MenuItem", "OptionPane", "Panel",
  74                     "PasswordField", "PopupMenu", "PopupMenuSeparator",
  75                     "ProgressBar", "RadioButton", "RadioButtonMenuItem",
  76                     "RootPane", "ScrollBar", "ScrollBarTrack", "ScrollBarThumb",
  77                     "ScrollPane", "Separator", "Slider", "SliderTrack",
  78                     "SliderThumb", "Spinner", "SplitPane", "TabbedPane",
  79                     "Table", "TableHeader", "TextArea", "TextField", "TextPane",
  80                     "ToggleButton", "ToolBar", "ToolTip", "Tree", "Viewport"};
  81 
  82     /**
  83      * A reference to the auto-generated file NimbusDefaults. This file contains
  84      * the default mappings and values for the look and feel as specified in the