src/share/classes/com/sun/java/swing/plaf/gtk/GTKLookAndFeel.java

Print this page


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


  34 import java.security.PrivilegedAction;
  35 import java.util.Locale;
  36 import javax.swing.*;
  37 import javax.swing.colorchooser.*;
  38 import javax.swing.plaf.*;
  39 import javax.swing.plaf.synth.*;
  40 import javax.swing.text.DefaultEditorKit;
  41 
  42 import com.sun.java.swing.plaf.gtk.GTKConstants.PositionType;
  43 import com.sun.java.swing.plaf.gtk.GTKConstants.StateType;
  44 import sun.awt.SunToolkit;
  45 import sun.awt.UNIXToolkit;
  46 import sun.awt.OSInfo;
  47 import sun.security.action.GetPropertyAction;
  48 import sun.swing.DefaultLayoutStyle;
  49 import sun.swing.SwingUtilities2;
  50 
  51 /**
  52  * @author Scott Violet
  53  */

  54 public class GTKLookAndFeel extends SynthLookAndFeel {
  55     private static final boolean IS_22;
  56 
  57     /**
  58      * Whether or not text is drawn antialiased.  This keys off the
  59      * desktop property 'gnome.Xft/Antialias' and 'gnome.Xft/RGBA'
  60      * We should assume ON - or some variation of ON as no GTK desktop
  61      * ships with it OFF.
  62      */
  63     static Object aaTextInfo;
  64 
  65     /**
  66      * Solaris, or Linux with Sun JDS in a CJK Locale.
  67      * Used to determine if Sun's high quality CJK fonts are present.
  68      */
  69     private static boolean isSunCJK;
  70 
  71     /*
  72      * Used to override if system (desktop) text anti-aliasing settings should
  73      * be used. The reasons for this are are is that currently its "off"


   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


  34 import java.security.PrivilegedAction;
  35 import java.util.Locale;
  36 import javax.swing.*;
  37 import javax.swing.colorchooser.*;
  38 import javax.swing.plaf.*;
  39 import javax.swing.plaf.synth.*;
  40 import javax.swing.text.DefaultEditorKit;
  41 
  42 import com.sun.java.swing.plaf.gtk.GTKConstants.PositionType;
  43 import com.sun.java.swing.plaf.gtk.GTKConstants.StateType;
  44 import sun.awt.SunToolkit;
  45 import sun.awt.UNIXToolkit;
  46 import sun.awt.OSInfo;
  47 import sun.security.action.GetPropertyAction;
  48 import sun.swing.DefaultLayoutStyle;
  49 import sun.swing.SwingUtilities2;
  50 
  51 /**
  52  * @author Scott Violet
  53  */
  54 @SuppressWarnings("serial") // Superclass not serializable
  55 public class GTKLookAndFeel extends SynthLookAndFeel {
  56     private static final boolean IS_22;
  57 
  58     /**
  59      * Whether or not text is drawn antialiased.  This keys off the
  60      * desktop property 'gnome.Xft/Antialias' and 'gnome.Xft/RGBA'
  61      * We should assume ON - or some variation of ON as no GTK desktop
  62      * ships with it OFF.
  63      */
  64     static Object aaTextInfo;
  65 
  66     /**
  67      * Solaris, or Linux with Sun JDS in a CJK Locale.
  68      * Used to determine if Sun's high quality CJK fonts are present.
  69      */
  70     private static boolean isSunCJK;
  71 
  72     /*
  73      * Used to override if system (desktop) text anti-aliasing settings should
  74      * be used. The reasons for this are are is that currently its "off"