summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLillian Angel <langel@redhat.com>2006-05-30 16:38:10 +0000
committerLillian Angel <langel@redhat.com>2006-05-30 16:38:10 +0000
commit505b46d56f46d23590e6f7e3693efad390cf73c3 (patch)
tree393b31d90c40702186221e5df1fafa4035d943fc
parent33b5f699c5e4e31f1cd01965b1ddc775e8f8bf82 (diff)
downloadclasspath-505b46d56f46d23590e6f7e3693efad390cf73c3.tar.gz
2006-05-30 Lillian Angel <langel@redhat.com>
PR 27785 * java/awt/Component.java: (translateEvent): Added handling to translate WindowEvents * java/awt/Window.java: Removed unneeded imports.
-rw-r--r--ChangeLog8
-rw-r--r--java/awt/Component.java32
-rw-r--r--java/awt/Window.java3
3 files changed, 39 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 7c4bf8e6e..2c3dbbf89 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2006-05-30 Lillian Angel <langel@redhat.com>
+
+ PR 27785
+ * java/awt/Component.java:
+ (translateEvent): Added handling to translate WindowEvents
+ * java/awt/Window.java:
+ Removed unneeded imports.
+
2006-05-30 Mark Wielaard <mark@klomp.org>
* native/jni/gtk-peer/Makefile.am (libgtkpeer_la_SOURCES): Add
diff --git a/java/awt/Component.java b/java/awt/Component.java
index e19a85f36..4f6d50aae 100644
--- a/java/awt/Component.java
+++ b/java/awt/Component.java
@@ -4810,8 +4810,38 @@ p * <li>the set of backward traversal keys
{
Object target = e.getSource ();
Event translated = null;
+
+ if (e instanceof WindowEvent)
+ {
+ WindowEvent we = (WindowEvent) e;
+ int id = we.id;
+ int newId = 0;
+
+ switch (id)
+ {
+ case WindowEvent.WINDOW_DEICONIFIED:
+ newId = Event.WINDOW_DEICONIFY;
+ break;
+ case WindowEvent.WINDOW_CLOSED:
+ case WindowEvent.WINDOW_CLOSING:
+ newId = Event.WINDOW_DESTROY;
+ break;
+ case WindowEvent.WINDOW_ICONIFIED:
+ newId = Event.WINDOW_ICONIFY;
+ break;
+ case WindowEvent.WINDOW_GAINED_FOCUS:
+ newId = Event.GOT_FOCUS;
+ break;
+ case WindowEvent.WINDOW_LOST_FOCUS:
+ newId = Event.LOST_FOCUS;
+ break;
+ default:
+ return null;
+ }
- if (e instanceof InputEvent)
+ translated = new Event(target, 0, newId, 0, 0, 0, 0);
+ }
+ else if (e instanceof InputEvent)
{
InputEvent ie = (InputEvent) e;
long when = ie.getWhen ();
diff --git a/java/awt/Window.java b/java/awt/Window.java
index 779bb28b5..8bc4715ae 100644
--- a/java/awt/Window.java
+++ b/java/awt/Window.java
@@ -38,11 +38,8 @@ exception statement from your version. */
package java.awt;
-import gnu.classpath.NotImplementedException;
-
import java.awt.event.ComponentEvent;
import java.awt.event.FocusEvent;
-import java.awt.event.FocusListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.awt.event.WindowFocusListener;