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

Print this page




 321         }
 322     }
 323 
 324     @Override
 325     public void setBounds(int x, int y, int w, int h, int op) {
 326         if ((op & SET_CLIENT_SIZE) != 0) {
 327             // SET_CLIENT_SIZE is only applicable to window peers, so handle it here
 328             // instead of pulling 'insets' field up to LWComponentPeer
 329             // no need to add insets since Window's notion of width and height includes insets.
 330             op &= ~SET_CLIENT_SIZE;
 331             op |= SET_SIZE;
 332         }
 333 
 334         if (w < MINIMUM_WIDTH) {
 335             w = MINIMUM_WIDTH;
 336         }
 337         if (h < MINIMUM_HEIGHT) {
 338             h = MINIMUM_HEIGHT;
 339         }
 340 












 341         // Don't post ComponentMoved/Resized and Paint events
 342         // until we've got a notification from the delegate
 343         setBounds(x, y, w, h, op, false, false);
 344         // Get updated bounds, so we don't have to handle 'op' here manually
 345         Rectangle r = getBounds();
 346         platformWindow.setBounds(r.x, r.y, r.width, r.height);
 347     }
 348 
 349     @Override
 350     public Point getLocationOnScreen() {
 351         return platformWindow.getLocationOnScreen();
 352     }
 353 
 354     /**
 355      * Overridden from LWContainerPeer to return the correct insets.
 356      * Insets are queried from the delegate and are kept up to date by
 357      * requiering when needed (i.e. when the window geometry is changed).
 358      */
 359     @Override
 360     public Insets getInsets() {


 388     public void setAlwaysOnTop(boolean value) {
 389         platformWindow.setAlwaysOnTop(value);
 390     }
 391 
 392     @Override
 393     public void updateFocusableWindowState() {
 394         platformWindow.updateFocusableWindowState();
 395     }
 396 
 397     @Override
 398     public void setModalBlocked(Dialog blocker, boolean blocked) {
 399         synchronized (getPeerTreeLock()) {
 400             this.blocker = blocked ? (LWWindowPeer)blocker.getPeer() : null;
 401         }
 402 
 403         platformWindow.setModalBlocked(blocked);
 404     }
 405 
 406     @Override
 407     public void updateMinimumSize() {
 408         Dimension d = null;
 409         if (getTarget().isMinimumSizeSet()) {
 410             d = getTarget().getMinimumSize();
 411         }
 412         if (d == null) {
 413             d = new Dimension(MINIMUM_WIDTH, MINIMUM_HEIGHT);
 414         }
 415         platformWindow.setMinimumSize(d.width, d.height);
 416     }
 417 
 418     @Override
 419     public void updateIconImages() {
 420         getPlatformWindow().updateIconImages();
 421     }
 422 
 423     @Override
 424     public void setOpacity(float opacity) {
 425         getPlatformWindow().setOpacity(opacity);
 426         repaintPeer();
 427     }
 428 
 429     @Override
 430     public final void setOpaque(final boolean isOpaque) {
 431         if (this.isOpaque != isOpaque) {
 432             this.isOpaque = isOpaque;
 433             updateOpaque();
 434         }
 435     }




 321         }
 322     }
 323 
 324     @Override
 325     public void setBounds(int x, int y, int w, int h, int op) {
 326         if ((op & SET_CLIENT_SIZE) != 0) {
 327             // SET_CLIENT_SIZE is only applicable to window peers, so handle it here
 328             // instead of pulling 'insets' field up to LWComponentPeer
 329             // no need to add insets since Window's notion of width and height includes insets.
 330             op &= ~SET_CLIENT_SIZE;
 331             op |= SET_SIZE;
 332         }
 333 
 334         if (w < MINIMUM_WIDTH) {
 335             w = MINIMUM_WIDTH;
 336         }
 337         if (h < MINIMUM_HEIGHT) {
 338             h = MINIMUM_HEIGHT;
 339         }
 340 
 341         if (graphicsConfig instanceof TextureSizeConstraining) {
 342             final int maxW = ((TextureSizeConstraining)graphicsConfig).getMaxTextureWidth();
 343             final int maxH = ((TextureSizeConstraining)graphicsConfig).getMaxTextureHeight();
 344 
 345             if (w > maxW) {
 346                 w = maxW;
 347             }
 348             if (h > maxH) {
 349                 h = maxH;
 350             }
 351         }
 352 
 353         // Don't post ComponentMoved/Resized and Paint events
 354         // until we've got a notification from the delegate
 355         setBounds(x, y, w, h, op, false, false);
 356         // Get updated bounds, so we don't have to handle 'op' here manually
 357         Rectangle r = getBounds();
 358         platformWindow.setBounds(r.x, r.y, r.width, r.height);
 359     }
 360 
 361     @Override
 362     public Point getLocationOnScreen() {
 363         return platformWindow.getLocationOnScreen();
 364     }
 365 
 366     /**
 367      * Overridden from LWContainerPeer to return the correct insets.
 368      * Insets are queried from the delegate and are kept up to date by
 369      * requiering when needed (i.e. when the window geometry is changed).
 370      */
 371     @Override
 372     public Insets getInsets() {


 400     public void setAlwaysOnTop(boolean value) {
 401         platformWindow.setAlwaysOnTop(value);
 402     }
 403 
 404     @Override
 405     public void updateFocusableWindowState() {
 406         platformWindow.updateFocusableWindowState();
 407     }
 408 
 409     @Override
 410     public void setModalBlocked(Dialog blocker, boolean blocked) {
 411         synchronized (getPeerTreeLock()) {
 412             this.blocker = blocked ? (LWWindowPeer)blocker.getPeer() : null;
 413         }
 414 
 415         platformWindow.setModalBlocked(blocked);
 416     }
 417 
 418     @Override
 419     public void updateMinimumSize() {
 420         int maxW = Integer.MAX_VALUE, maxH = Integer.MAX_VALUE;
 421         if (graphicsConfig instanceof TextureSizeConstraining) {
 422             maxW = ((TextureSizeConstraining)graphicsConfig).getMaxTextureWidth();
 423             maxH = ((TextureSizeConstraining)graphicsConfig).getMaxTextureHeight();


 424         }
 425         platformWindow.setSizeConstraints(MINIMUM_WIDTH, MINIMUM_HEIGHT, maxW, maxH);
 426     }
 427 
 428     @Override
 429     public void updateIconImages() {
 430         getPlatformWindow().updateIconImages();
 431     }
 432 
 433     @Override
 434     public void setOpacity(float opacity) {
 435         getPlatformWindow().setOpacity(opacity);
 436         repaintPeer();
 437     }
 438 
 439     @Override
 440     public final void setOpaque(final boolean isOpaque) {
 441         if (this.isOpaque != isOpaque) {
 442             this.isOpaque = isOpaque;
 443             updateOpaque();
 444         }
 445     }