571 return contentView.getSurfaceData(); 572 } 573 574 @Override // PlatformWindow 575 public void toBack() { 576 final long nsWindowPtr = getNSWindowPtr(); 577 nativePushNSWindowToBack(nsWindowPtr); 578 } 579 580 @Override // PlatformWindow 581 public void toFront() { 582 final long nsWindowPtr = getNSWindowPtr(); 583 updateFocusabilityForAutoRequestFocus(false); 584 nativePushNSWindowToFront(nsWindowPtr); 585 updateFocusabilityForAutoRequestFocus(true); 586 } 587 588 @Override 589 public void setResizable(boolean resizable) { 590 setStyleBits(RESIZABLE, resizable); 591 } 592 593 @Override 594 public void setMinimumSize(int width, int height) { 595 //TODO width, height should be used 596 final long nsWindowPtr = getNSWindowPtr(); 597 final Dimension min = target.getMinimumSize(); 598 final Dimension max = target.getMaximumSize(); 599 nativeSetNSWindowMinMax(nsWindowPtr, min.getWidth(), min.getHeight(), max.getWidth(), max.getHeight()); 600 } 601 602 @Override 603 public boolean requestWindowFocus() { 604 long ptr = getNSWindowPtr(); 605 if (CWrapper.NSWindow.canBecomeMainWindow(ptr)) { 606 CWrapper.NSWindow.makeMainWindow(ptr); 607 } 608 CWrapper.NSWindow.makeKeyAndOrderFront(ptr); 609 return true; 610 } 611 612 @Override 613 public boolean isActive() { 614 long ptr = getNSWindowPtr(); 615 return CWrapper.NSWindow.isKeyWindow(ptr); | 571 return contentView.getSurfaceData(); 572 } 573 574 @Override // PlatformWindow 575 public void toBack() { 576 final long nsWindowPtr = getNSWindowPtr(); 577 nativePushNSWindowToBack(nsWindowPtr); 578 } 579 580 @Override // PlatformWindow 581 public void toFront() { 582 final long nsWindowPtr = getNSWindowPtr(); 583 updateFocusabilityForAutoRequestFocus(false); 584 nativePushNSWindowToFront(nsWindowPtr); 585 updateFocusabilityForAutoRequestFocus(true); 586 } 587 588 @Override 589 public void setResizable(boolean resizable) { 590 setStyleBits(RESIZABLE, resizable); 591 592 // Re-apply the size constraints and the size to ensure the space 593 // occupied by the grow box is counted properly 594 setMinimumSize(1, 1); // the method ignores its arguments 595 596 Rectangle bounds = target.getBounds(); 597 setBounds(bounds.x, bounds.y, bounds.width, bounds.height); 598 } 599 600 @Override 601 public void setMinimumSize(int width, int height) { 602 //TODO width, height should be used 603 //NOTE: setResizable() calls setMinimumSize(1,1) relaying on the logic below 604 final long nsWindowPtr = getNSWindowPtr(); 605 final Dimension min = target.getMinimumSize(); 606 final Dimension max = target.getMaximumSize(); 607 nativeSetNSWindowMinMax(nsWindowPtr, min.getWidth(), min.getHeight(), max.getWidth(), max.getHeight()); 608 } 609 610 @Override 611 public boolean requestWindowFocus() { 612 long ptr = getNSWindowPtr(); 613 if (CWrapper.NSWindow.canBecomeMainWindow(ptr)) { 614 CWrapper.NSWindow.makeMainWindow(ptr); 615 } 616 CWrapper.NSWindow.makeKeyAndOrderFront(ptr); 617 return true; 618 } 619 620 @Override 621 public boolean isActive() { 622 long ptr = getNSWindowPtr(); 623 return CWrapper.NSWindow.isKeyWindow(ptr); |