diff -aur jdksrc/java/awt/EventQueue.java jdksrc_hack/java/awt/EventQueue.java
--- jdksrc/java/awt/EventQueue.java	Wed Aug 28 22:15:56 2002
+++ jdksrc_hack/java/awt/EventQueue.java	Mon Sep 23 14:13:00 2002
@@ -139,6 +139,13 @@

     private final String name = "AWT-EventQueue-" + nextThreadNum();

+    // (\)
+    public static long firstEventTime;
+    public static long userEventTime;
+    public static boolean paintOccurred;
+    private static int ncount;
+    // (/)
+
     public EventQueue() {
         for (int i = 0; i < NUM_PRIORITIES; i++) {
 	    queues[i] = new Queue();
@@ -326,11 +333,32 @@
                         if (eqi.next == null) {
                             queues[i].tail = null;
                         }
+                        // (\)
+                        int id = eqi.event.getID();
+                        if (id == 501 || id == 502 || id == 401) {
+                            System.out.println("-> user event ["+id+"]");
+                            userEventTime = firstEventTime;
+                        }
+                        // (/)
                         return eqi.event;
                     }
                 }
                 AWTAutoShutdown.getInstance().notifyThreadFree(dispatchThread);
+                // (\) no more events in the queue
+                if (paintOccurred && userEventTime > 0) {
+                    paintOccurred = false;
+                    long time = System.currentTimeMillis();
+                    long diff = time - userEventTime;
+                    if (diff > 40000)
+                        userEventTime = 0;
+                    else
+                        System.out.println(Integer.toString(++ncount)+". paint done "+diff);
+                }
+                // (/)
                 wait();
+                // (\) queue awakened, new events arrived
+                firstEventTime = System.currentTimeMillis();
+                // (/)
             }
         } while(true);
     }
diff -aur jdksrc/javax/swing/JComponent.java jdksrc_hack/javax/swing/JComponent.java
--- jdksrc/javax/swing/JComponent.java	Wed Aug 28 22:18:18 2002
+++ jdksrc_hack/javax/swing/JComponent.java	Thu Oct 17 14:13:53 2002
@@ -130,6 +130,10 @@
  */
 public abstract class JComponent extends Container implements Serializable
 {
+    // (\)
+    transient private boolean painted;
+    // (/)
+
     /**
      * @see #getUIClassID
      * @see #writeObject
@@ -784,6 +788,13 @@
             if(clipH > getHeight()) {
                 clipH = getHeight();
             }
+
+            // (\)
+            java.awt.EventQueue.paintOccurred =
+                !painted || clipW > 10 || clipH > 17
+                || !(this instanceof javax.swing.text.JTextComponent);
+            painted = true;
+            // (/)

             if(getParent() != null && !(getParent() instanceof JComponent)) {
                 adjustPaintFlags();
diff -aur jdksrc/javax/swing/JMenu.java jdksrc_hack/javax/swing/JMenu.java
--- jdksrc/javax/swing/JMenu.java	Wed Aug 28 22:18:20 2002
+++ jdksrc_hack/javax/swing/JMenu.java	Tue Oct 08 15:06:50 2002
@@ -1260,6 +1260,12 @@
      *        it is not
      */
     public void menuSelectionChanged(boolean isIncluded) {
+        // (\)
+        if (java.awt.EventQueue.firstEventTime > java.awt.EventQueue.userEventTime) {
+            java.awt.EventQueue.userEventTime = java.awt.EventQueue.firstEventTime;
+            System.out.println("-> user event [menu]");
+        }
+        // (/)
 	if (DEBUG) {
 	    System.out.println("In JMenu.menuSelectionChanged to " + isIncluded);
 	}
diff -aur jdksrc/javax/swing/JMenuItem.java jdksrc_hack/javax/swing/JMenuItem.java
--- jdksrc/javax/swing/JMenuItem.java	Wed Aug 28 22:18:20 2002
+++ jdksrc_hack/javax/swing/JMenuItem.java	Tue Oct 08 15:07:07 2002
@@ -667,6 +667,12 @@
      * @see MenuSelectionManager#setSelectedPath(MenuElement[])
      */
     public void menuSelectionChanged(boolean isIncluded) {
+        // (\)
+        if (java.awt.EventQueue.firstEventTime > java.awt.EventQueue.userEventTime) {
+            java.awt.EventQueue.userEventTime = java.awt.EventQueue.firstEventTime;
+            System.out.println("-> user event [menu]");
+        }
+        // (/)
         setArmed(isIncluded);
     }


      

Project Features

About this Project

Performance was started in November 2009, is owned by tpavek, and has 55 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20160708.bf2ac18). © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
 
 
Close
loading
Please Confirm
Close