92 import java.util.HashMap;
93 import java.util.Locale;
94 import java.util.Map;
95 import java.util.MissingResourceException;
96 import java.util.Objects;
97 import java.util.ResourceBundle;
98 import java.util.concurrent.Callable;
99
100 import javax.swing.UIManager;
101
102 import com.apple.laf.AquaMenuBarUI;
103 import sun.awt.AWTAccessor;
104 import sun.awt.AppContext;
105 import sun.awt.CGraphicsConfig;
106 import sun.awt.CGraphicsDevice;
107 import sun.awt.LightweightFrame;
108 import sun.awt.PlatformGraphicsInfo;
109 import sun.awt.SunToolkit;
110 import sun.awt.datatransfer.DataTransferer;
111 import sun.awt.util.ThreadGroupUtils;
112 import sun.java2d.opengl.OGLRenderQueue;
113 import sun.lwawt.LWComponentPeer;
114 import sun.lwawt.LWCursorManager;
115 import sun.lwawt.LWToolkit;
116 import sun.lwawt.LWWindowPeer;
117 import sun.lwawt.LWWindowPeer.PeerType;
118 import sun.lwawt.PlatformComponent;
119 import sun.lwawt.PlatformDropTarget;
120 import sun.lwawt.PlatformWindow;
121 import sun.lwawt.SecurityWarningWindow;
122 import sun.security.action.GetBooleanAction;
123
124 @SuppressWarnings("serial") // JDK implementation class
125 final class NamedCursor extends Cursor {
126 NamedCursor(String name) {
127 super(name);
128 }
129 }
130
131 /**
468 }
469
470 @Override
471 public native void beep();
472
473 @Override
474 public int getScreenResolution() throws HeadlessException {
475 return (int) ((CGraphicsDevice) GraphicsEnvironment
476 .getLocalGraphicsEnvironment().getDefaultScreenDevice())
477 .getXResolution();
478 }
479
480 @Override
481 public Insets getScreenInsets(final GraphicsConfiguration gc) {
482 return ((CGraphicsConfig) gc).getDevice().getScreenInsets();
483 }
484
485 @Override
486 public void sync() {
487 // flush the OGL pipeline (this is a no-op if OGL is not enabled)
488 OGLRenderQueue.sync();
489 // setNeedsDisplay() selector was sent to the appropriate CALayer so now
490 // we have to flush the native selectors queue.
491 flushNativeSelectors();
492 }
493
494 @Override
495 public RobotPeer createRobot(Robot target, GraphicsDevice screen) {
496 return new CRobot(target, (CGraphicsDevice)screen);
497 }
498
499 private native boolean isCapsLockOn();
500
501 /*
502 * NOTE: Among the keys this method is supposed to check,
503 * only Caps Lock works as a true locking key with OS X.
504 * There is no Scroll Lock key on modern Apple keyboards,
505 * and with a PC keyboard plugged in Scroll Lock is simply
506 * ignored: no LED lights up if you press it.
507 * The key located at the same position on Apple keyboards
508 * as Num Lock on PC keyboards is called Clear, doesn't lock
|
92 import java.util.HashMap;
93 import java.util.Locale;
94 import java.util.Map;
95 import java.util.MissingResourceException;
96 import java.util.Objects;
97 import java.util.ResourceBundle;
98 import java.util.concurrent.Callable;
99
100 import javax.swing.UIManager;
101
102 import com.apple.laf.AquaMenuBarUI;
103 import sun.awt.AWTAccessor;
104 import sun.awt.AppContext;
105 import sun.awt.CGraphicsConfig;
106 import sun.awt.CGraphicsDevice;
107 import sun.awt.LightweightFrame;
108 import sun.awt.PlatformGraphicsInfo;
109 import sun.awt.SunToolkit;
110 import sun.awt.datatransfer.DataTransferer;
111 import sun.awt.util.ThreadGroupUtils;
112 import sun.java2d.macos.MacOSFlags;
113 import sun.java2d.metal.MTLRenderQueue;
114 import sun.java2d.opengl.OGLRenderQueue;
115 import sun.lwawt.LWComponentPeer;
116 import sun.lwawt.LWCursorManager;
117 import sun.lwawt.LWToolkit;
118 import sun.lwawt.LWWindowPeer;
119 import sun.lwawt.LWWindowPeer.PeerType;
120 import sun.lwawt.PlatformComponent;
121 import sun.lwawt.PlatformDropTarget;
122 import sun.lwawt.PlatformWindow;
123 import sun.lwawt.SecurityWarningWindow;
124 import sun.security.action.GetBooleanAction;
125
126 @SuppressWarnings("serial") // JDK implementation class
127 final class NamedCursor extends Cursor {
128 NamedCursor(String name) {
129 super(name);
130 }
131 }
132
133 /**
470 }
471
472 @Override
473 public native void beep();
474
475 @Override
476 public int getScreenResolution() throws HeadlessException {
477 return (int) ((CGraphicsDevice) GraphicsEnvironment
478 .getLocalGraphicsEnvironment().getDefaultScreenDevice())
479 .getXResolution();
480 }
481
482 @Override
483 public Insets getScreenInsets(final GraphicsConfiguration gc) {
484 return ((CGraphicsConfig) gc).getDevice().getScreenInsets();
485 }
486
487 @Override
488 public void sync() {
489 // flush the OGL pipeline (this is a no-op if OGL is not enabled)
490 if (MacOSFlags.isMetalEnabled()) {
491 MTLRenderQueue.sync();
492 } else {
493 OGLRenderQueue.sync();
494 }
495 // setNeedsDisplay() selector was sent to the appropriate CALayer so now
496 // we have to flush the native selectors queue.
497 flushNativeSelectors();
498 }
499
500 @Override
501 public RobotPeer createRobot(Robot target, GraphicsDevice screen) {
502 return new CRobot(target, (CGraphicsDevice)screen);
503 }
504
505 private native boolean isCapsLockOn();
506
507 /*
508 * NOTE: Among the keys this method is supposed to check,
509 * only Caps Lock works as a true locking key with OS X.
510 * There is no Scroll Lock key on modern Apple keyboards,
511 * and with a PC keyboard plugged in Scroll Lock is simply
512 * ignored: no LED lights up if you press it.
513 * The key located at the same position on Apple keyboards
514 * as Num Lock on PC keyboards is called Clear, doesn't lock
|