src/share/classes/java/awt/GraphicsDevice.java

Print this page




 324             windowedModeBounds = fullScreenWindow.getBounds();
 325             // Note that we use the graphics configuration of the device,
 326             // not the window's, because we're setting the fs window for
 327             // this device.
 328             final GraphicsConfiguration gc = getDefaultConfiguration();
 329             final Rectangle screenBounds = gc.getBounds();
 330             if (SunToolkit.isDispatchThreadForAppContext(fullScreenWindow)) {
 331                 // Update graphics configuration here directly and do not wait
 332                 // asynchronous notification from the peer. Note that
 333                 // setBounds() will reset a GC, if it was set incorrectly.
 334                 fullScreenWindow.setGraphicsConfiguration(gc);
 335             }
 336             fullScreenWindow.setBounds(screenBounds.x, screenBounds.y,
 337                                        screenBounds.width, screenBounds.height);
 338             fullScreenWindow.setVisible(true);
 339             fullScreenWindow.toFront();
 340         }
 341     }
 342 
 343     /**
 344      * Returns the {@code Window} object representing the
 345      * full-screen window if the device is in full-screen mode.
 346      *
 347      * @return the full-screen window, or {@code null} if the device is
 348      * not in full-screen mode. The {@code Window} object can differ
 349      * from the object previously set by {@code setFullScreenWindow}.
 350      * @see #setFullScreenWindow(Window)
 351      * @since 1.4
 352      */
 353     public Window getFullScreenWindow() {
 354         Window returnWindow = null;
 355         synchronized (fsAppContextLock) {
 356             // Only return a handle to the current fs window if we are in the
 357             // same AppContext that set the fs window
 358             if (fullScreenAppContext == AppContext.getAppContext()) {
 359                 returnWindow = fullScreenWindow;
 360             }
 361         }
 362         return returnWindow;
 363     }
 364 
 365     /**
 366      * Returns <code>true</code> if this <code>GraphicsDevice</code>
 367      * supports low-level display changes.
 368      * On some platforms low-level display changes may only be allowed in
 369      * full-screen exclusive mode (i.e., if {@link #isFullScreenSupported()}




 324             windowedModeBounds = fullScreenWindow.getBounds();
 325             // Note that we use the graphics configuration of the device,
 326             // not the window's, because we're setting the fs window for
 327             // this device.
 328             final GraphicsConfiguration gc = getDefaultConfiguration();
 329             final Rectangle screenBounds = gc.getBounds();
 330             if (SunToolkit.isDispatchThreadForAppContext(fullScreenWindow)) {
 331                 // Update graphics configuration here directly and do not wait
 332                 // asynchronous notification from the peer. Note that
 333                 // setBounds() will reset a GC, if it was set incorrectly.
 334                 fullScreenWindow.setGraphicsConfiguration(gc);
 335             }
 336             fullScreenWindow.setBounds(screenBounds.x, screenBounds.y,
 337                                        screenBounds.width, screenBounds.height);
 338             fullScreenWindow.setVisible(true);
 339             fullScreenWindow.toFront();
 340         }
 341     }
 342 
 343     /**
 344      * Returns the <code>Window</code> object representing the
 345      * full-screen window if the device is in full-screen mode.
 346      *
 347      * @return the full-screen window, or <code>null</code> if the device is
 348      * not in full-screen mode.

 349      * @see #setFullScreenWindow(Window)
 350      * @since 1.4
 351      */
 352     public Window getFullScreenWindow() {
 353         Window returnWindow = null;
 354         synchronized (fsAppContextLock) {
 355             // Only return a handle to the current fs window if we are in the
 356             // same AppContext that set the fs window
 357             if (fullScreenAppContext == AppContext.getAppContext()) {
 358                 returnWindow = fullScreenWindow;
 359             }
 360         }
 361         return returnWindow;
 362     }
 363 
 364     /**
 365      * Returns <code>true</code> if this <code>GraphicsDevice</code>
 366      * supports low-level display changes.
 367      * On some platforms low-level display changes may only be allowed in
 368      * full-screen exclusive mode (i.e., if {@link #isFullScreenSupported()}