src/share/classes/javax/swing/plaf/synth/SynthLookAndFeel.java

Print this page


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


  46  * feel. SynthLookAndFeel does not directly provide a look, all painting is
  47  * delegated.
  48  * You need to either provide a configuration file, by way of the
  49  * {@link #load} method, or provide your own {@link SynthStyleFactory}
  50  * to {@link #setStyleFactory}. Refer to the
  51  * <a href="package-summary.html">package summary</a> for an example of
  52  * loading a file, and {@link javax.swing.plaf.synth.SynthStyleFactory} for
  53  * an example of providing your own <code>SynthStyleFactory</code> to
  54  * <code>setStyleFactory</code>.
  55  * <p>
  56  * <strong>Warning:</strong>
  57  * This class implements {@link Serializable} as a side effect of it
  58  * extending {@link BasicLookAndFeel}. It is not intended to be serialized.
  59  * An attempt to serialize it will
  60  * result in {@link NotSerializableException}.
  61  *
  62  * @serial exclude
  63  * @since 1.5
  64  * @author Scott Violet
  65  */

  66 public class SynthLookAndFeel extends BasicLookAndFeel {
  67     /**
  68      * Used in a handful of places where we need an empty Insets.
  69      */
  70     static final Insets EMPTY_UIRESOURCE_INSETS = new InsetsUIResource(
  71                                                             0, 0, 0, 0);
  72 
  73     /**
  74      * AppContext key to get the current SynthStyleFactory.
  75      */
  76     private static final Object STYLE_FACTORY_KEY =
  77                   new StringBuffer("com.sun.java.swing.plaf.gtk.StyleCache");
  78 
  79     /**
  80      * AppContext key to get selectedUI.
  81      */
  82     private static final Object SELECTED_UI_KEY = new StringBuilder("selectedUI");
  83 
  84     /**
  85      * AppContext key to get selectedUIState.


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


  46  * feel. SynthLookAndFeel does not directly provide a look, all painting is
  47  * delegated.
  48  * You need to either provide a configuration file, by way of the
  49  * {@link #load} method, or provide your own {@link SynthStyleFactory}
  50  * to {@link #setStyleFactory}. Refer to the
  51  * <a href="package-summary.html">package summary</a> for an example of
  52  * loading a file, and {@link javax.swing.plaf.synth.SynthStyleFactory} for
  53  * an example of providing your own <code>SynthStyleFactory</code> to
  54  * <code>setStyleFactory</code>.
  55  * <p>
  56  * <strong>Warning:</strong>
  57  * This class implements {@link Serializable} as a side effect of it
  58  * extending {@link BasicLookAndFeel}. It is not intended to be serialized.
  59  * An attempt to serialize it will
  60  * result in {@link NotSerializableException}.
  61  *
  62  * @serial exclude
  63  * @since 1.5
  64  * @author Scott Violet
  65  */
  66 @SuppressWarnings("serial") // Superclass is not serializable across versions
  67 public class SynthLookAndFeel extends BasicLookAndFeel {
  68     /**
  69      * Used in a handful of places where we need an empty Insets.
  70      */
  71     static final Insets EMPTY_UIRESOURCE_INSETS = new InsetsUIResource(
  72                                                             0, 0, 0, 0);
  73 
  74     /**
  75      * AppContext key to get the current SynthStyleFactory.
  76      */
  77     private static final Object STYLE_FACTORY_KEY =
  78                   new StringBuffer("com.sun.java.swing.plaf.gtk.StyleCache");
  79 
  80     /**
  81      * AppContext key to get selectedUI.
  82      */
  83     private static final Object SELECTED_UI_KEY = new StringBuilder("selectedUI");
  84 
  85     /**
  86      * AppContext key to get selectedUIState.