< prev index next >

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

Print this page




 523     void draggedToNewScreen() {
 524         SunToolkit.executeOnEventHandlerThread((Component)target,new Runnable()
 525         {
 526             @Override
 527             public void run() {
 528                 displayChanged();
 529             }
 530         });
 531     }
 532 
 533     public void updateGC() {
 534         int scrn = getScreenImOn();
 535         if (screenLog.isLoggable(PlatformLogger.Level.FINER)) {
 536             log.finer("Screen number: " + scrn);
 537         }
 538 
 539         // get current GD
 540         Win32GraphicsDevice oldDev = winGraphicsConfig.getDevice();
 541 
 542         Win32GraphicsDevice newDev;
 543         GraphicsDevice devs[] = GraphicsEnvironment
 544             .getLocalGraphicsEnvironment()
 545             .getScreenDevices();
 546         // Occasionally during device addition/removal getScreenImOn can return
 547         // a non-existing screen number. Use the default device in this case.
 548         if (scrn >= devs.length) {
 549             newDev = (Win32GraphicsDevice)GraphicsEnvironment
 550                 .getLocalGraphicsEnvironment().getDefaultScreenDevice();
 551         } else {
 552             newDev = (Win32GraphicsDevice)devs[scrn];
 553         }
 554 
 555         // Set winGraphicsConfig to the default GC for the monitor this Window
 556         // is now mostly on.
 557         winGraphicsConfig = (Win32GraphicsConfig)newDev
 558                             .getDefaultConfiguration();
 559         if (screenLog.isLoggable(PlatformLogger.Level.FINE)) {
 560             if (winGraphicsConfig == null) {
 561                 screenLog.fine("Assertion (winGraphicsConfig != null) failed");
 562             }
 563         }




 523     void draggedToNewScreen() {
 524         SunToolkit.executeOnEventHandlerThread((Component)target,new Runnable()
 525         {
 526             @Override
 527             public void run() {
 528                 displayChanged();
 529             }
 530         });
 531     }
 532 
 533     public void updateGC() {
 534         int scrn = getScreenImOn();
 535         if (screenLog.isLoggable(PlatformLogger.Level.FINER)) {
 536             log.finer("Screen number: " + scrn);
 537         }
 538 
 539         // get current GD
 540         Win32GraphicsDevice oldDev = winGraphicsConfig.getDevice();
 541 
 542         Win32GraphicsDevice newDev;
 543         GraphicsDevice[] devs = GraphicsEnvironment
 544             .getLocalGraphicsEnvironment()
 545             .getScreenDevices();
 546         // Occasionally during device addition/removal getScreenImOn can return
 547         // a non-existing screen number. Use the default device in this case.
 548         if (scrn >= devs.length) {
 549             newDev = (Win32GraphicsDevice)GraphicsEnvironment
 550                 .getLocalGraphicsEnvironment().getDefaultScreenDevice();
 551         } else {
 552             newDev = (Win32GraphicsDevice)devs[scrn];
 553         }
 554 
 555         // Set winGraphicsConfig to the default GC for the monitor this Window
 556         // is now mostly on.
 557         winGraphicsConfig = (Win32GraphicsConfig)newDev
 558                             .getDefaultConfiguration();
 559         if (screenLog.isLoggable(PlatformLogger.Level.FINE)) {
 560             if (winGraphicsConfig == null) {
 561                 screenLog.fine("Assertion (winGraphicsConfig != null) failed");
 562             }
 563         }


< prev index next >