337 * @see sun.awt.SunToolkit#syncNativeQueue(long)
338 */
339 @Override
340 protected boolean syncNativeQueue(long timeout) {
341 return nativeSyncQueue(timeout);
342 }
343
344 @Override
345 public native void beep();
346
347 @Override
348 public int getScreenResolution() throws HeadlessException {
349 return (int) ((CGraphicsDevice) GraphicsEnvironment
350 .getLocalGraphicsEnvironment().getDefaultScreenDevice())
351 .getXResolution();
352 }
353
354 @Override
355 public Insets getScreenInsets(final GraphicsConfiguration gc) {
356 final CGraphicsConfig cgc = (CGraphicsConfig) gc;
357 final int displayId = cgc.getDevice().getCoreGraphicsScreen();
358 Rectangle fullScreen, workArea;
359 final long screen = CWrapper.NSScreen.screenByDisplayId(displayId);
360 try {
361 fullScreen = CWrapper.NSScreen.frame(screen).getBounds();
362 workArea = CWrapper.NSScreen.visibleFrame(screen).getBounds();
363 } finally {
364 CWrapper.NSObject.release(screen);
365 }
366 // Convert between Cocoa's coordinate system and Java.
367 int bottom = workArea.y - fullScreen.y;
368 int top = fullScreen.height - workArea.height - bottom;
369 int left = workArea.x - fullScreen.x;
370 int right = fullScreen.width - workArea.width - left;
371 return new Insets(top, left, bottom, right);
372 }
373
374 @Override
375 public void sync() {
376 // TODO Auto-generated method stub
377
|
337 * @see sun.awt.SunToolkit#syncNativeQueue(long)
338 */
339 @Override
340 protected boolean syncNativeQueue(long timeout) {
341 return nativeSyncQueue(timeout);
342 }
343
344 @Override
345 public native void beep();
346
347 @Override
348 public int getScreenResolution() throws HeadlessException {
349 return (int) ((CGraphicsDevice) GraphicsEnvironment
350 .getLocalGraphicsEnvironment().getDefaultScreenDevice())
351 .getXResolution();
352 }
353
354 @Override
355 public Insets getScreenInsets(final GraphicsConfiguration gc) {
356 final CGraphicsConfig cgc = (CGraphicsConfig) gc;
357 final int displayId = cgc.getDevice().getCGDisplayID();
358 Rectangle fullScreen, workArea;
359 final long screen = CWrapper.NSScreen.screenByDisplayId(displayId);
360 try {
361 fullScreen = CWrapper.NSScreen.frame(screen).getBounds();
362 workArea = CWrapper.NSScreen.visibleFrame(screen).getBounds();
363 } finally {
364 CWrapper.NSObject.release(screen);
365 }
366 // Convert between Cocoa's coordinate system and Java.
367 int bottom = workArea.y - fullScreen.y;
368 int top = fullScreen.height - workArea.height - bottom;
369 int left = workArea.x - fullScreen.x;
370 int right = fullScreen.width - workArea.width - left;
371 return new Insets(top, left, bottom, right);
372 }
373
374 @Override
375 public void sync() {
376 // TODO Auto-generated method stub
377
|