changeset 553:d635c9a971c9

6693974: Unify EventQueue$EventQueueItem and SunToolkit.$EventQueueItem classes Reviewed-by: volk, art
author dav
date Mon, 07 Jul 2008 16:09:39 +0400
parents fae7c1f5ba78
children 9a1b30777d9d
files src/share/classes/java/awt/Component.java src/share/classes/java/awt/EventQueue.java src/share/classes/sun/awt/SunToolkit.java
diffstat 3 files changed, 5 insertions(+), 24 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/java/awt/Component.java	Thu Jun 19 16:09:22 2008 +0400
+++ b/src/share/classes/java/awt/Component.java	Mon Jul 07 16:09:39 2008 +0400
@@ -5737,7 +5737,7 @@
         }
     }
 
-    transient EventQueueItem[] eventCache;
+    transient sun.awt.EventQueueItem[] eventCache;
 
     /**
      * @see #isCoalescingEnabled
--- a/src/share/classes/java/awt/EventQueue.java	Thu Jun 19 16:09:22 2008 +0400
+++ b/src/share/classes/java/awt/EventQueue.java	Mon Jul 07 16:09:39 2008 +0400
@@ -42,6 +42,7 @@
 import sun.awt.AWTAutoShutdown;
 import sun.awt.PeerEvent;
 import sun.awt.SunToolkit;
+import sun.awt.EventQueueItem;
 
 /**
  * <code>EventQueue</code> is a platform-independent class
@@ -359,7 +360,7 @@
             entry != null; entry = entry.next)
         {
             // Give Component.coalesceEvents a chance
-            if (entry.event.getSource() == source && entry.id == id) {
+            if (entry.event.getSource() == source && entry.event.getID() == id) {
                 AWTEvent coalescedEvent = source.coalesceEvents(
                     entry.event, e);
                 if (coalescedEvent != null) {
@@ -499,7 +500,7 @@
                     for (EventQueueItem entry = queues[i].head, prev = null;
                          entry != null; prev = entry, entry = entry.next)
                     {
-                        if (entry.id == id) {
+                        if (entry.event.getID() == id) {
                             if (prev == null) {
                                 queues[i].head = entry.next;
                             } else {
@@ -545,7 +546,7 @@
         for (int i = NUM_PRIORITIES - 1; i >= 0; i--) {
             EventQueueItem q = queues[i].head;
             for (; q != null; q = q.next) {
-                if (q.id == id) {
+                if (q.event.getID() == id) {
                     return q.event;
                 }
             }
@@ -1051,14 +1052,3 @@
     EventQueueItem head;
     EventQueueItem tail;
 }
-
-class EventQueueItem {
-    AWTEvent event;
-    int      id;
-    EventQueueItem next;
-
-    EventQueueItem(AWTEvent evt) {
-        event = evt;
-        id = evt.getID();
-    }
-}
--- a/src/share/classes/sun/awt/SunToolkit.java	Thu Jun 19 16:09:22 2008 +0400
+++ b/src/share/classes/sun/awt/SunToolkit.java	Mon Jul 07 16:09:39 2008 +0400
@@ -2039,12 +2039,3 @@
         SunToolkit.wakeupEventQueue(eventQueue, event.getSource() == AWTAutoShutdown.getInstance());
     }
 } // class PostEventQueue
-
-class EventQueueItem {
-    AWTEvent event;
-    EventQueueItem next;
-
-    EventQueueItem(AWTEvent evt) {
-        event = evt;
-    }
-} // class EventQueueItem