jdk/src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java
changeset 25563 248400a88627
parent 24865 09b1d992ca72
child 25564 871d3490f14d
equal deleted inserted replaced
25562:af98568d21e9 25563:248400a88627
    42 import java.util.concurrent.Callable;
    42 import java.util.concurrent.Callable;
    43 import java.net.MalformedURLException;
    43 import java.net.MalformedURLException;
    44 
    44 
    45 import sun.awt.*;
    45 import sun.awt.*;
    46 import sun.awt.datatransfer.DataTransferer;
    46 import sun.awt.datatransfer.DataTransferer;
       
    47 import sun.awt.util.ThreadGroupUtils;
    47 import sun.java2d.opengl.OGLRenderQueue;
    48 import sun.java2d.opengl.OGLRenderQueue;
    48 import sun.lwawt.*;
    49 import sun.lwawt.*;
    49 import sun.lwawt.LWWindowPeer.PeerType;
    50 import sun.lwawt.LWWindowPeer.PeerType;
    50 import sun.security.action.GetBooleanAction;
    51 import sun.security.action.GetBooleanAction;
    51 
    52 
    68     // the easy way and just support up to 5 mouse buttons,
    69     // the easy way and just support up to 5 mouse buttons,
    69     // like Windows.
    70     // like Windows.
    70     private static final int BUTTONS = 5;
    71     private static final int BUTTONS = 5;
    71 
    72 
    72     private static native void initIDs();
    73     private static native void initIDs();
    73 
    74     private static native void initAppkit(ThreadGroup appKitThreadGroup, boolean headless);
    74     private static CInputMethodDescriptor sInputMethodDescriptor;
    75     private static CInputMethodDescriptor sInputMethodDescriptor;
    75 
    76 
    76     static {
    77     static {
    77         System.err.flush();
    78         System.err.flush();
    78 
    79 
   117 
   118 
   118     public LWCToolkit() {
   119     public LWCToolkit() {
   119         areExtraMouseButtonsEnabled = Boolean.parseBoolean(System.getProperty("sun.awt.enableExtraMouseButtons", "true"));
   120         areExtraMouseButtonsEnabled = Boolean.parseBoolean(System.getProperty("sun.awt.enableExtraMouseButtons", "true"));
   120         //set system property if not yet assigned
   121         //set system property if not yet assigned
   121         System.setProperty("sun.awt.enableExtraMouseButtons", ""+areExtraMouseButtonsEnabled);
   122         System.setProperty("sun.awt.enableExtraMouseButtons", ""+areExtraMouseButtonsEnabled);
       
   123         initAppkit(ThreadGroupUtils.getRootThreadGroup(), GraphicsEnvironment.isHeadless());
   122     }
   124     }
   123 
   125 
   124     /*
   126     /*
   125      * System colors with default initial values, overwritten by toolkit if system values differ and are available.
   127      * System colors with default initial values, overwritten by toolkit if system values differ and are available.
   126      */
   128      */
   164     }
   166     }
   165 
   167 
   166     // This is only called from native code.
   168     // This is only called from native code.
   167     static void systemColorsChanged() {
   169     static void systemColorsChanged() {
   168         EventQueue.invokeLater(() -> {
   170         EventQueue.invokeLater(() -> {
   169             AccessController.doPrivileged ((PrivilegedAction<Object>) () -> {
   171             AccessController.doPrivileged( (PrivilegedAction<Object>) () -> {
   170                 AWTAccessor.getSystemColorAccessor().updateSystemColors();
   172                 AWTAccessor.getSystemColorAccessor().updateSystemColors();
   171                 return null;
   173                 return null;
   172             });
   174             });
   173         });
   175         });
   174     }
   176     }