[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[cp-patches] [patch] remove EmbeddedWindowSupport
From: |
Thomas Fitzsimmons |
Subject: |
[cp-patches] [patch] remove EmbeddedWindowSupport |
Date: |
Mon, 04 Jul 2005 18:34:23 -0400 |
Hi,
This patch eliminates the need for EmbeddedWindowSupport by moving the
createEmbeddedWindow method to ClasspathToolkit. I committed this.
Tom
2005-07-04 Thomas Fitzsimmons <address@hidden>
* gnu/java/awt/ClasspathToolkit.java (createEmbeddedWindow): New
method.
* gnu/java/awt/EmbeddedWindow.java (addNotify): Assume we're using
ClasspathToolkit.
* gnu/java/awt/EmbeddedWindowSupport.java: Remove file.
* gnu/java/awt/peer/gtk/GtkToolkit.java: Remove references to
EmbeddedWindowSupport.
Index: gnu/java/awt/ClasspathToolkit.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/java/awt/ClasspathToolkit.java,v
retrieving revision 1.11
diff -u -r1.11 ClasspathToolkit.java
--- gnu/java/awt/ClasspathToolkit.java 2 Jul 2005 20:32:10 -0000 1.11
+++ gnu/java/awt/ClasspathToolkit.java 4 Jul 2005 22:28:08 -0000
@@ -38,7 +38,9 @@
package gnu.java.awt;
+import gnu.java.awt.EmbeddedWindow;
import gnu.java.awt.peer.ClasspathFontPeer;
+import gnu.java.awt.peer.EmbeddedWindowPeer;
import gnu.java.awt.peer.ClasspathTextLayoutPeer;
import java.awt.AWTException;
@@ -355,6 +357,14 @@
public abstract RobotPeer createRobot (GraphicsDevice screen)
throws AWTException;
+ /**
+ * Creates an embedded window peer, and associates it with an
+ * EmbeddedWindow object.
+ *
+ * @param w The embedded window with which to associate a peer.
+ */
+ public abstract EmbeddedWindowPeer createEmbeddedWindow (EmbeddedWindow w);
+
/**
* Used to register ImageIO SPIs provided by the toolkit.
*/
Index: gnu/java/awt/EmbeddedWindow.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/java/awt/EmbeddedWindow.java,v
retrieving revision 1.6
diff -u -r1.6 EmbeddedWindow.java
--- gnu/java/awt/EmbeddedWindow.java 2 Jul 2005 20:32:10 -0000 1.6
+++ gnu/java/awt/EmbeddedWindow.java 4 Jul 2005 22:28:08 -0000
@@ -85,12 +85,8 @@
*/
public void addNotify()
{
- Toolkit tk = getToolkit();
-
- if (! (tk instanceof EmbeddedWindowSupport))
- throw new UnsupportedOperationException
- ("Embedded windows are not supported by the current peers: "
- + tk.getClass());
+ // Assume we're using ClasspathToolkit
+ ClasspathToolkit tk = (ClasspathToolkit) getToolkit();
// Circumvent the package-privateness of the AWT internal
// java.awt.Component.peer member variable.
@@ -98,7 +94,7 @@
{
Field peerField = Component.class.getDeclaredField("peer");
AccessController.doPrivileged(new SetAccessibleAction(peerField));
- peerField.set(this, ((EmbeddedWindowSupport) tk).createEmbeddedWindow
(this));
+ peerField.set(this, tk.createEmbeddedWindow (this));
}
catch (IllegalAccessException e)
{
Index: gnu/java/awt/EmbeddedWindowSupport.java
===================================================================
RCS file: gnu/java/awt/EmbeddedWindowSupport.java
diff -N gnu/java/awt/EmbeddedWindowSupport.java
--- gnu/java/awt/EmbeddedWindowSupport.java 2 Mar 2005 17:29:07 -0000
1.2
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,65 +0,0 @@
-/* EmbeddedWindowSupport.java --
- Copyright (C) 2003 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-02111-1307 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-
-package gnu.java.awt;
-
-import gnu.java.awt.peer.EmbeddedWindowPeer;
-
-/**
- * Declares a method for creating native embedded window peers.
- *
- * All classes inherited from java.awt.Toolkit that implement this
- * interface are assumed to support the creation of embedded window
- * peers. To create an embedded window, use
- * gnu.java.awt.EmbeddedWindow.
- *
- * @see gnu.java.awt.EmbeddedWindow
- * @see java.awt.Toolkit
- *
- * @author Michael Koch (address@hidden)
- */
-public interface EmbeddedWindowSupport
-{
- /**
- * Creates an embedded window peer, and associates it with an
- * EmbeddedWindow object.
- *
- * @param w The embedded window with which to associate a peer.
- */
- EmbeddedWindowPeer createEmbeddedWindow (EmbeddedWindow w);
-}
Index: gnu/java/awt/peer/gtk/GtkToolkit.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/java/awt/peer/gtk/GtkToolkit.java,v
retrieving revision 1.70
diff -u -r1.70 GtkToolkit.java
--- gnu/java/awt/peer/gtk/GtkToolkit.java 2 Jul 2005 20:32:12 -0000
1.70
+++ gnu/java/awt/peer/gtk/GtkToolkit.java 4 Jul 2005 22:28:08 -0000
@@ -40,7 +40,6 @@
import gnu.classpath.Configuration;
import gnu.java.awt.EmbeddedWindow;
-import gnu.java.awt.EmbeddedWindowSupport;
import gnu.java.awt.peer.ClasspathFontPeer;
import gnu.java.awt.peer.ClasspathTextLayoutPeer;
import gnu.java.awt.peer.EmbeddedWindowPeer;
@@ -86,7 +85,6 @@
* object to be used.
*/
public class GtkToolkit extends gnu.java.awt.ClasspathToolkit
- implements EmbeddedWindowSupport
{
Hashtable containers = new Hashtable();
static EventQueue q;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [cp-patches] [patch] remove EmbeddedWindowSupport,
Thomas Fitzsimmons <=