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

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Oracle designates this

@@ -327,11 +327,10 @@
     public boolean isFullScreenSupported() {
         return isFSExclusiveModeAllowed();
     }
 
     @Override
-    @SuppressWarnings("deprecation")
     public synchronized void setFullScreenWindow(Window w) {
         Window old = getFullScreenWindow();
         if (w == old) {
             return;
         }

@@ -351,11 +350,11 @@
                 // the desktop properties dialog, for example), so
                 // we need to record it every time prior to
                 // entering the fullscreen mode.
                 defaultDisplayMode = null;
             }
-            WWindowPeer peer = (WWindowPeer)old.getPeer();
+            WWindowPeer peer = AWTAccessor.getComponentAccessor().getPeer(old);
             if (peer != null) {
                 peer.setFullScreenExclusiveModeState(false);
                 // we used to destroy the buffers on exiting fs mode, this
                 // is no longer needed since fs change will cause a surface
                 // data replacement

@@ -370,11 +369,11 @@
             // always record the default display mode prior to going
             // fullscreen
             defaultDisplayMode = getDisplayMode();
             addFSWindowListener(w);
             // Enter full screen exclusive mode.
-            WWindowPeer peer = (WWindowPeer)w.getPeer();
+            WWindowPeer peer = AWTAccessor.getComponentAccessor().getPeer(w);
             if (peer != null) {
                 synchronized(peer) {
                     enterFullScreenExclusive(screen, peer);
                     // Note: removed replaceSurfaceData() call because
                     // changing the window size or making it visible

@@ -403,11 +402,10 @@
     public boolean isDisplayChangeSupported() {
         return (isFullScreenSupported() && getFullScreenWindow() != null);
     }
 
     @Override
-    @SuppressWarnings("deprecation")
     public synchronized void setDisplayMode(DisplayMode dm) {
         if (!isDisplayChangeSupported()) {
             super.setDisplayMode(dm);
             return;
         }

@@ -417,11 +415,11 @@
         if (getDisplayMode().equals(dm)) {
             return;
         }
         Window w = getFullScreenWindow();
         if (w != null) {
-            WWindowPeer peer = (WWindowPeer)w.getPeer();
+            WWindowPeer peer = AWTAccessor.getComponentAccessor().getPeer(w);
             configDisplayMode(screen, peer, dm.getWidth(), dm.getHeight(),
                 dm.getBitDepth(), dm.getRefreshRate());
             // resize the fullscreen window to the dimensions of the new
             // display mode
             Rectangle screenBounds = getDefaultConfiguration().getBounds();