modules/graphics/src/main/java/com/sun/javafx/tk/quantum/WindowStage.java

Print this page




 386         int iheight = image.getHeight();
 387 
 388         //Iterate through each scanline of the image
 389         //and pass it one at a time to the scaling object
 390         for (int z = 0; z < iheight; z++) {
 391             buf.position(z*image.getScanlineStride());
 392             buf.get(bytes, 0, image.getScanlineStride());
 393             scaler.putSourceScanline(bytes, 0);
 394         }
 395 
 396         buf.rewind();
 397 
 398         final Image img = image.iconify(scaler.getDestination(), SMALL_ICON_WIDTH, SMALL_ICON_HEIGHT);
 399         platformWindow.setIcon(PixelUtils.imageToPixels(img));
 400     }
 401 
 402     @Override public void setTitle(String title) {
 403         platformWindow.setTitle(title);
 404     }
 405 




 406     @Override public void setVisible(final boolean visible) {
 407         // Before setting visible to false on the native window, we unblock
 408         // other windows.
 409         if (!visible) {
 410             removeActiveWindow(this);
 411             if (modality == Modality.WINDOW_MODAL) {
 412                 if (owner != null && owner instanceof WindowStage) {
 413                     ((WindowStage) owner).setEnabled(true);
 414                 }
 415             } else if (modality == Modality.APPLICATION_MODAL) {
 416                 windowsSetEnabled(true);
 417             } else {
 418                 // Note: This method is required to workaround a glass issue
 419                 // mentioned in RT-12607
 420                 if (owner != null && owner instanceof WindowStage) {
 421                     WindowStage ownerStage = (WindowStage)owner;
 422                     ownerStage.requestToFront();
 423                 }
 424             }
 425         }




 386         int iheight = image.getHeight();
 387 
 388         //Iterate through each scanline of the image
 389         //and pass it one at a time to the scaling object
 390         for (int z = 0; z < iheight; z++) {
 391             buf.position(z*image.getScanlineStride());
 392             buf.get(bytes, 0, image.getScanlineStride());
 393             scaler.putSourceScanline(bytes, 0);
 394         }
 395 
 396         buf.rewind();
 397 
 398         final Image img = image.iconify(scaler.getDestination(), SMALL_ICON_WIDTH, SMALL_ICON_HEIGHT);
 399         platformWindow.setIcon(PixelUtils.imageToPixels(img));
 400     }
 401 
 402     @Override public void setTitle(String title) {
 403         platformWindow.setTitle(title);
 404     }
 405 
 406     @Override public void setUpdatesCursor(boolean updatesCursor) {
 407         platformWindow.setUpdatesCursor(updatesCursor);
 408     }
 409 
 410     @Override public void setVisible(final boolean visible) {
 411         // Before setting visible to false on the native window, we unblock
 412         // other windows.
 413         if (!visible) {
 414             removeActiveWindow(this);
 415             if (modality == Modality.WINDOW_MODAL) {
 416                 if (owner != null && owner instanceof WindowStage) {
 417                     ((WindowStage) owner).setEnabled(true);
 418                 }
 419             } else if (modality == Modality.APPLICATION_MODAL) {
 420                 windowsSetEnabled(true);
 421             } else {
 422                 // Note: This method is required to workaround a glass issue
 423                 // mentioned in RT-12607
 424                 if (owner != null && owner instanceof WindowStage) {
 425                     WindowStage ownerStage = (WindowStage)owner;
 426                     ownerStage.requestToFront();
 427                 }
 428             }
 429         }