src/java.desktop/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java

Print this page




 659             if(logger.isLoggable(PlatformLogger.Level.FINE)) {
 660                 logger.fine("NSWindow already disposed?", new Exception("Pointer to native NSWindow is invalid."));
 661             }
 662         }
 663         return nsWindowPtr;
 664     }
 665 
 666     public SurfaceData getSurfaceData() {
 667         return contentView.getSurfaceData();
 668     }
 669 
 670     @Override  // PlatformWindow
 671     public void toBack() {
 672         final long nsWindowPtr = getNSWindowPtr();
 673         nativePushNSWindowToBack(nsWindowPtr);
 674     }
 675 
 676     @Override  // PlatformWindow
 677     public void toFront() {
 678         final long nsWindowPtr = getNSWindowPtr();







 679         updateFocusabilityForAutoRequestFocus(false);
 680         nativePushNSWindowToFront(nsWindowPtr);
 681         updateFocusabilityForAutoRequestFocus(true);
 682     }
 683 
 684     @Override
 685     public void setResizable(final boolean resizable) {
 686         setStyleBits(RESIZABLE, resizable);
 687     }
 688 
 689     @Override
 690     public void setSizeConstraints(int minW, int minH, int maxW, int maxH) {
 691         nativeSetNSWindowMinMax(getNSWindowPtr(), minW, minH, maxW, maxH);
 692     }
 693 
 694     @Override
 695     public boolean rejectFocusRequest(CausedFocusEvent.Cause cause) {
 696         // Cross-app activation requests are not allowed.
 697         if (cause != CausedFocusEvent.Cause.MOUSE_EVENT &&
 698             !((LWCToolkit)Toolkit.getDefaultToolkit()).isApplicationActive())




 659             if(logger.isLoggable(PlatformLogger.Level.FINE)) {
 660                 logger.fine("NSWindow already disposed?", new Exception("Pointer to native NSWindow is invalid."));
 661             }
 662         }
 663         return nsWindowPtr;
 664     }
 665 
 666     public SurfaceData getSurfaceData() {
 667         return contentView.getSurfaceData();
 668     }
 669 
 670     @Override  // PlatformWindow
 671     public void toBack() {
 672         final long nsWindowPtr = getNSWindowPtr();
 673         nativePushNSWindowToBack(nsWindowPtr);
 674     }
 675 
 676     @Override  // PlatformWindow
 677     public void toFront() {
 678         final long nsWindowPtr = getNSWindowPtr();
 679         Container parent = getPeer().getTarget().getParent();
 680         LWCToolkit lwcToolkit = (LWCToolkit) Toolkit.getDefaultToolkit();
 681         if(DefaultKeyboardFocusManager.getCurrentKeyboardFocusManager().getActiveWindow()
 682                 instanceof CEmbeddedFrame
 683                 && !lwcToolkit.isApplicationActive()) {
 684             lwcToolkit.activateApplication();
 685         }
 686         updateFocusabilityForAutoRequestFocus(false);
 687         nativePushNSWindowToFront(nsWindowPtr);
 688         updateFocusabilityForAutoRequestFocus(true);
 689     }
 690 
 691     @Override
 692     public void setResizable(final boolean resizable) {
 693         setStyleBits(RESIZABLE, resizable);
 694     }
 695 
 696     @Override
 697     public void setSizeConstraints(int minW, int minH, int maxW, int maxH) {
 698         nativeSetNSWindowMinMax(getNSWindowPtr(), minW, minH, maxW, maxH);
 699     }
 700 
 701     @Override
 702     public boolean rejectFocusRequest(CausedFocusEvent.Cause cause) {
 703         // Cross-app activation requests are not allowed.
 704         if (cause != CausedFocusEvent.Cause.MOUSE_EVENT &&
 705             !((LWCToolkit)Toolkit.getDefaultToolkit()).isApplicationActive())