diff -aur jdksrc/java/awt/EventQueue.java jdksrc_hack/java/awt/EventQueue.java
--- jdksrc/java/awt/EventQueue.java	Tue Jan 29 23:16:02 2002
+++ jdksrc_hack/java/awt/EventQueue.java	Mon Sep 23 14:10:34 2002
@@ -136,6 +136,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();
@@ -322,11 +329,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	Tue Jan 29 23:18:56 2002
+++ jdksrc_hack/javax/swing/JComponent.java	Thu Oct 17 14:31:36 2002
@@ -130,6 +130,10 @@
  */
 public abstract class JComponent extends Container implements Serializable
 {
+    // (\)
+    transient private boolean painted;
+    // (/)
+
     /**
      * @see #getUIClassID
      * @see #writeObject
@@ -780,6 +784,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	Tue Jan 29 23:18:58 2002
+++ jdksrc_hack/javax/swing/JMenu.java	Mon Sep 23 14:08:30 2002
@@ -1230,6 +1230,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	Tue Jan 29 23:18:58 2002
+++ jdksrc_hack/javax/swing/JMenuItem.java	Mon Sep 23 14:08:19 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 78 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