< prev index next >

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

Print this page




 186         }
 187         // re-invalidate all old devices. It's needed because those in the list
 188         // may become "invalid" again - if the current default device is removed,
 189         // for example. Also, they need to be notified about display
 190         // changes as well.
 191         if (oldDevices != null) {
 192             int defScreen = getDefaultScreen();
 193             for (ListIterator<WeakReference<Win32GraphicsDevice>> it =
 194                     oldDevices.listIterator(); it.hasNext();)
 195             {
 196                 Win32GraphicsDevice gd = it.next().get();
 197                 if (gd != null) {
 198                     gd.invalidate(defScreen);
 199                     gd.displayChanged();
 200                 } else {
 201                     // no more references to this device, remove it
 202                     it.remove();
 203                 }
 204             }
 205         }
 206         // Reset the static GC for the (possibly new) default screen
 207         WToolkit.resetGC();
 208 
 209         // notify SunDisplayChanger list (e.g. VolatileSurfaceManagers and
 210         // CachingSurfaceManagers) about the display change event
 211         displayChanger.notifyListeners();
 212         // note: do not call super.displayChanged, we've already done everything
 213     }
 214 
 215 
 216 /*
 217  * ----END DISPLAY CHANGE SUPPORT----
 218  */
 219 
 220     protected GraphicsDevice makeScreenDevice(int screennum) {
 221         GraphicsDevice device = null;
 222         if (WindowsFlags.isD3DEnabled()) {
 223             device = D3DGraphicsDevice.createDevice(screennum);
 224         }
 225         if (device == null) {
 226             device = new Win32GraphicsDevice(screennum);
 227         }
 228         return device;




 186         }
 187         // re-invalidate all old devices. It's needed because those in the list
 188         // may become "invalid" again - if the current default device is removed,
 189         // for example. Also, they need to be notified about display
 190         // changes as well.
 191         if (oldDevices != null) {
 192             int defScreen = getDefaultScreen();
 193             for (ListIterator<WeakReference<Win32GraphicsDevice>> it =
 194                     oldDevices.listIterator(); it.hasNext();)
 195             {
 196                 Win32GraphicsDevice gd = it.next().get();
 197                 if (gd != null) {
 198                     gd.invalidate(defScreen);
 199                     gd.displayChanged();
 200                 } else {
 201                     // no more references to this device, remove it
 202                     it.remove();
 203                 }
 204             }
 205         }



 206         // notify SunDisplayChanger list (e.g. VolatileSurfaceManagers and
 207         // CachingSurfaceManagers) about the display change event
 208         displayChanger.notifyListeners();
 209         // note: do not call super.displayChanged, we've already done everything
 210     }
 211 
 212 
 213 /*
 214  * ----END DISPLAY CHANGE SUPPORT----
 215  */
 216 
 217     protected GraphicsDevice makeScreenDevice(int screennum) {
 218         GraphicsDevice device = null;
 219         if (WindowsFlags.isD3DEnabled()) {
 220             device = D3DGraphicsDevice.createDevice(screennum);
 221         }
 222         if (device == null) {
 223             device = new Win32GraphicsDevice(screennum);
 224         }
 225         return device;


< prev index next >