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

Print this page




 576         return contentView.getSurfaceData();
 577     }
 578 
 579     @Override  // PlatformWindow
 580     public void toBack() {
 581         final long nsWindowPtr = getNSWindowPtr();
 582         nativePushNSWindowToBack(nsWindowPtr);
 583     }
 584 
 585     @Override  // PlatformWindow
 586     public void toFront() {
 587         final long nsWindowPtr = getNSWindowPtr();
 588         updateFocusabilityForAutoRequestFocus(false);
 589         nativePushNSWindowToFront(nsWindowPtr);
 590         updateFocusabilityForAutoRequestFocus(true);
 591     }
 592 
 593     @Override
 594     public void setResizable(boolean resizable) {
 595         setStyleBits(RESIZABLE, resizable);







 596     }
 597 
 598     @Override
 599     public void setMinimumSize(int width, int height) {
 600         //TODO width, height should be used

 601         final long nsWindowPtr = getNSWindowPtr();
 602         final Dimension min = target.getMinimumSize();
 603         final Dimension max = target.getMaximumSize();
 604         nativeSetNSWindowMinMax(nsWindowPtr, min.getWidth(), min.getHeight(), max.getWidth(), max.getHeight());
 605     }
 606 
 607     @Override
 608     public boolean rejectFocusRequest(CausedFocusEvent.Cause cause) {
 609         // Cross-app activation requests are not allowed.
 610         if (cause != CausedFocusEvent.Cause.MOUSE_EVENT &&
 611             !((LWCToolkit)Toolkit.getDefaultToolkit()).isApplicationActive())
 612         {
 613             focusLogger.fine("the app is inactive, so the request is rejected");
 614             return true;
 615         }
 616         return false;
 617     }
 618 
 619     @Override
 620     public boolean requestWindowFocus() {




 576         return contentView.getSurfaceData();
 577     }
 578 
 579     @Override  // PlatformWindow
 580     public void toBack() {
 581         final long nsWindowPtr = getNSWindowPtr();
 582         nativePushNSWindowToBack(nsWindowPtr);
 583     }
 584 
 585     @Override  // PlatformWindow
 586     public void toFront() {
 587         final long nsWindowPtr = getNSWindowPtr();
 588         updateFocusabilityForAutoRequestFocus(false);
 589         nativePushNSWindowToFront(nsWindowPtr);
 590         updateFocusabilityForAutoRequestFocus(true);
 591     }
 592 
 593     @Override
 594     public void setResizable(boolean resizable) {
 595         setStyleBits(RESIZABLE, resizable);
 596 
 597         // Re-apply the size constraints and the size to ensure the space
 598         // occupied by the grow box is counted properly
 599         setMinimumSize(1, 1); // the method ignores its arguments
 600 
 601         Rectangle bounds = peer.getBounds();
 602         setBounds(bounds.x, bounds.y, bounds.width, bounds.height);
 603     }
 604 
 605     @Override
 606     public void setMinimumSize(int width, int height) {
 607         //TODO width, height should be used
 608         //NOTE: setResizable() calls setMinimumSize(1,1) relaying on the logic below
 609         final long nsWindowPtr = getNSWindowPtr();
 610         final Dimension min = target.getMinimumSize();
 611         final Dimension max = target.getMaximumSize();
 612         nativeSetNSWindowMinMax(nsWindowPtr, min.getWidth(), min.getHeight(), max.getWidth(), max.getHeight());
 613     }
 614 
 615     @Override
 616     public boolean rejectFocusRequest(CausedFocusEvent.Cause cause) {
 617         // Cross-app activation requests are not allowed.
 618         if (cause != CausedFocusEvent.Cause.MOUSE_EVENT &&
 619             !((LWCToolkit)Toolkit.getDefaultToolkit()).isApplicationActive())
 620         {
 621             focusLogger.fine("the app is inactive, so the request is rejected");
 622             return true;
 623         }
 624         return false;
 625     }
 626 
 627     @Override
 628     public boolean requestWindowFocus() {