diff options
author | Michael Koch <mkoch@gcc.gnu.org> | 2005-04-25 20:58:13 +0000 |
---|---|---|
committer | Michael Koch <mkoch@gcc.gnu.org> | 2005-04-25 20:58:13 +0000 |
commit | 84e0bcb8c5ba97ea0b2c07559f5c2957069de7e5 (patch) | |
tree | 47bf146f4f42a0c5e1d493a32e405cf8e3712fcd /libjava/java/awt/GraphicsDevice.java | |
parent | 4b30c6bda06ac549212f96617c4c3e171e56876a (diff) | |
download | gcc-84e0bcb8c5ba97ea0b2c07559f5c2957069de7e5.zip gcc-84e0bcb8c5ba97ea0b2c07559f5c2957069de7e5.tar.gz gcc-84e0bcb8c5ba97ea0b2c07559f5c2957069de7e5.tar.bz2 |
[multiple changes]
2005-04-25 Jeroen Frijters <jeroen@frijters.net>
* java/awt/GraphicsEnvironment.java
(localGraphicsEnvironment): New field.
(getLocalGraphicsEnvironment): Added support for java.awt.graphicsenv
property.
(isHeadless): Added support for java.awt.headless property.
(isHeadlessInstance): Call headless().
2005-04-25 Roman Kennke <roman@kennke.org>
* gnu/java/awt/peer/gtk/GdkScreenGraphicsDevice.java
(getDisplayMode): Added. Returns the current display mode.
(isFullScreenSupported): Added.
* java/awt/GraphicsDevice.java
(setFullScreenWindow): Implemented a primitive fullscreen mode.
This resizes and relocates the fullscreen window so that it uses
the whole screen. This is not a fully accelerated fullscreen
exclusive mode.
From-SVN: r98740
Diffstat (limited to 'libjava/java/awt/GraphicsDevice.java')
-rw-r--r-- | libjava/java/awt/GraphicsDevice.java | 33 |
1 files changed, 26 insertions, 7 deletions
diff --git a/libjava/java/awt/GraphicsDevice.java b/libjava/java/awt/GraphicsDevice.java index c017233..55a80f2 100644 --- a/libjava/java/awt/GraphicsDevice.java +++ b/libjava/java/awt/GraphicsDevice.java @@ -64,6 +64,12 @@ public abstract class GraphicsDevice /** The current full-screen window, or null if there is none. */ private Window full_screen; + /** + * The bounds of the fullscreen window before it has been switched to full + * screen. + */ + private Rectangle fullScreenOldBounds; + /** The current display mode, or null if unknown. */ private DisplayMode mode; @@ -151,9 +157,9 @@ public abstract class GraphicsDevice * </ul><br> * If <code>isFullScreenSupported()</code> returns false, full-screen * exclusive mode is simulated by resizing the window to the size of the - * screen and positioning it at (0,0). - * - * XXX Not yet implemented in Classpath. + * screen and positioning it at (0,0). This is also what this method does. + * If a device supports real fullscreen mode then it should override this + * method as well as #isFullScreenSupported and #getFullScreenWindow. * * @param w the window to toggle * @see #isFullScreenSupported() @@ -164,11 +170,24 @@ public abstract class GraphicsDevice */ public synchronized void setFullScreenWindow(Window w) { + // Restore the previous window to normal mode and release the reference. if (full_screen != null) - ; // XXX Restore the previous window to normal mode. - full_screen = w; - // XXX If w != null, make it full-screen. - throw new Error("not implemented"); + { + full_screen.setBounds(fullScreenOldBounds); + } + + full_screen = null; + + // If w != null, make it full-screen. + if (w != null) + { + fullScreenOldBounds = w.getBounds(); + full_screen = w; + DisplayMode dMode = getDisplayMode(); + full_screen.setBounds(0, 0, dMode.getWidth(), dMode.getHeight()); + full_screen.requestFocus(); + full_screen.setLocationRelativeTo(null); + } } /** |