< prev index next >

src/java.desktop/windows/classes/sun/awt/windows/WWindowPeer.java

Print this page




 277     native void updateInsets(Insets i);
 278 
 279     static native int getSysMinWidth();
 280     static native int getSysMinHeight();
 281     static native int getSysIconWidth();
 282     static native int getSysIconHeight();
 283     static native int getSysSmIconWidth();
 284     static native int getSysSmIconHeight();
 285     /**windows/classes/sun/awt/windows/
 286      * Creates native icon from specified raster data and updates
 287      * icon for window and all descendant windows that inherit icon.
 288      * Raster data should be passed in the ARGB form.
 289      * Note that raster data format was changed to provide support
 290      * for XP icons with alpha-channel
 291      */
 292     native void setIconImagesData(int[] iconRaster, int w, int h,
 293                                   int[] smallIconRaster, int smw, int smh);
 294 
 295     synchronized native void reshapeFrame(int x, int y, int width, int height);
 296 






 297     public boolean requestWindowFocus(CausedFocusEvent.Cause cause) {
 298         if (!focusAllowedFor()) {
 299             return false;
 300         }
 301         return requestWindowFocus(cause == CausedFocusEvent.Cause.MOUSE_EVENT);
 302     }
 303     private native boolean requestWindowFocus(boolean isMouseEventCause);
 304 
 305     public boolean focusAllowedFor() {
 306         Window window = (Window)this.target;
 307         if (!window.isVisible() ||
 308             !window.isEnabled() ||
 309             !window.isFocusableWindow())
 310         {
 311             return false;
 312         }
 313         if (isModalBlocked()) {
 314             return false;
 315         }
 316         return true;


 473     /*
 474      * Called from native code when we have been dragged onto another screen.
 475      */
 476     void draggedToNewScreen() {
 477         SunToolkit.executeOnEventHandlerThread((Component)target,new Runnable()
 478         {
 479             @Override
 480             public void run() {
 481                 displayChanged();
 482             }
 483         });
 484     }
 485 
 486     public void updateGC() {
 487         int scrn = getScreenImOn();
 488         if (screenLog.isLoggable(PlatformLogger.Level.FINER)) {
 489             log.finer("Screen number: " + scrn);
 490         }
 491 
 492         // get current GD
 493         Win32GraphicsDevice oldDev = (Win32GraphicsDevice)winGraphicsConfig
 494                                      .getDevice();
 495 
 496         Win32GraphicsDevice newDev;
 497         GraphicsDevice devs[] = GraphicsEnvironment
 498             .getLocalGraphicsEnvironment()
 499             .getScreenDevices();
 500         // Occasionally during device addition/removal getScreenImOn can return
 501         // a non-existing screen number. Use the default device in this case.
 502         if (scrn >= devs.length) {
 503             newDev = (Win32GraphicsDevice)GraphicsEnvironment
 504                 .getLocalGraphicsEnvironment().getDefaultScreenDevice();
 505         } else {
 506             newDev = (Win32GraphicsDevice)devs[scrn];
 507         }
 508 
 509         // Set winGraphicsConfig to the default GC for the monitor this Window
 510         // is now mostly on.
 511         winGraphicsConfig = (Win32GraphicsConfig)newDev
 512                             .getDefaultConfiguration();
 513         if (screenLog.isLoggable(PlatformLogger.Level.FINE)) {
 514             if (winGraphicsConfig == null) {




 277     native void updateInsets(Insets i);
 278 
 279     static native int getSysMinWidth();
 280     static native int getSysMinHeight();
 281     static native int getSysIconWidth();
 282     static native int getSysIconHeight();
 283     static native int getSysSmIconWidth();
 284     static native int getSysSmIconHeight();
 285     /**windows/classes/sun/awt/windows/
 286      * Creates native icon from specified raster data and updates
 287      * icon for window and all descendant windows that inherit icon.
 288      * Raster data should be passed in the ARGB form.
 289      * Note that raster data format was changed to provide support
 290      * for XP icons with alpha-channel
 291      */
 292     native void setIconImagesData(int[] iconRaster, int w, int h,
 293                                   int[] smallIconRaster, int smw, int smh);
 294 
 295     synchronized native void reshapeFrame(int x, int y, int width, int height);
 296 
 297     native Dimension getNativeWindowSize();
 298 
 299     public Dimension getScaledWindowSize() {
 300         return getNativeWindowSize();
 301     }
 302 
 303     public boolean requestWindowFocus(CausedFocusEvent.Cause cause) {
 304         if (!focusAllowedFor()) {
 305             return false;
 306         }
 307         return requestWindowFocus(cause == CausedFocusEvent.Cause.MOUSE_EVENT);
 308     }
 309     private native boolean requestWindowFocus(boolean isMouseEventCause);
 310 
 311     public boolean focusAllowedFor() {
 312         Window window = (Window)this.target;
 313         if (!window.isVisible() ||
 314             !window.isEnabled() ||
 315             !window.isFocusableWindow())
 316         {
 317             return false;
 318         }
 319         if (isModalBlocked()) {
 320             return false;
 321         }
 322         return true;


 479     /*
 480      * Called from native code when we have been dragged onto another screen.
 481      */
 482     void draggedToNewScreen() {
 483         SunToolkit.executeOnEventHandlerThread((Component)target,new Runnable()
 484         {
 485             @Override
 486             public void run() {
 487                 displayChanged();
 488             }
 489         });
 490     }
 491 
 492     public void updateGC() {
 493         int scrn = getScreenImOn();
 494         if (screenLog.isLoggable(PlatformLogger.Level.FINER)) {
 495             log.finer("Screen number: " + scrn);
 496         }
 497 
 498         // get current GD
 499         Win32GraphicsDevice oldDev = winGraphicsConfig.getDevice();

 500 
 501         Win32GraphicsDevice newDev;
 502         GraphicsDevice devs[] = GraphicsEnvironment
 503             .getLocalGraphicsEnvironment()
 504             .getScreenDevices();
 505         // Occasionally during device addition/removal getScreenImOn can return
 506         // a non-existing screen number. Use the default device in this case.
 507         if (scrn >= devs.length) {
 508             newDev = (Win32GraphicsDevice)GraphicsEnvironment
 509                 .getLocalGraphicsEnvironment().getDefaultScreenDevice();
 510         } else {
 511             newDev = (Win32GraphicsDevice)devs[scrn];
 512         }
 513 
 514         // Set winGraphicsConfig to the default GC for the monitor this Window
 515         // is now mostly on.
 516         winGraphicsConfig = (Win32GraphicsConfig)newDev
 517                             .getDefaultConfiguration();
 518         if (screenLog.isLoggable(PlatformLogger.Level.FINE)) {
 519             if (winGraphicsConfig == null) {


< prev index next >