458 public SurfaceData replaceSurfaceData() { 459 return contentView.replaceSurfaceData(); 460 } 461 462 @Override // PlatformWindow 463 public void setBounds(int x, int y, int w, int h) { 464 // assert CThreading.assertEventQueue(); 465 nativeSetNSWindowBounds(getNSWindowPtr(), x, y, w, h); 466 } 467 468 private boolean isMaximized() { 469 return undecorated ? this.normalBounds != null : zoomed; 470 } 471 472 private void maximize() { 473 if (peer == null || isMaximized()) { 474 return; 475 } 476 if (!undecorated) { 477 zoomed = true; 478 CWrapper.NSWindow.zoom(getNSWindowPtr()); 479 } else { 480 deliverZoom(true); 481 482 this.normalBounds = peer.getBounds(); 483 484 GraphicsConfiguration config = getPeer().getGraphicsConfiguration(); 485 Insets i = ((CGraphicsDevice)config.getDevice()).getScreenInsets(); 486 Rectangle toBounds = config.getBounds(); 487 setBounds(toBounds.x + i.left, 488 toBounds.y + i.top, 489 toBounds.width - i.left - i.right, 490 toBounds.height - i.top - i.bottom); 491 } 492 } 493 494 private void unmaximize() { 495 if (!isMaximized()) { 496 return; 497 } 498 if (!undecorated) { | 458 public SurfaceData replaceSurfaceData() { 459 return contentView.replaceSurfaceData(); 460 } 461 462 @Override // PlatformWindow 463 public void setBounds(int x, int y, int w, int h) { 464 // assert CThreading.assertEventQueue(); 465 nativeSetNSWindowBounds(getNSWindowPtr(), x, y, w, h); 466 } 467 468 private boolean isMaximized() { 469 return undecorated ? this.normalBounds != null : zoomed; 470 } 471 472 private void maximize() { 473 if (peer == null || isMaximized()) { 474 return; 475 } 476 if (!undecorated) { 477 zoomed = true; 478 if(!CWrapper.NSWindow.isZoomed(getNSWindowPtr())){ 479 CWrapper.NSWindow.zoom(getNSWindowPtr()); 480 } 481 } else { 482 deliverZoom(true); 483 484 this.normalBounds = peer.getBounds(); 485 486 GraphicsConfiguration config = getPeer().getGraphicsConfiguration(); 487 Insets i = ((CGraphicsDevice)config.getDevice()).getScreenInsets(); 488 Rectangle toBounds = config.getBounds(); 489 setBounds(toBounds.x + i.left, 490 toBounds.y + i.top, 491 toBounds.width - i.left - i.right, 492 toBounds.height - i.top - i.bottom); 493 } 494 } 495 496 private void unmaximize() { 497 if (!isMaximized()) { 498 return; 499 } 500 if (!undecorated) { |