diff -aur src/java/awt/EventQueue.java src_hack/java/awt/EventQueue.java
--- src/java/awt/EventQueue.java	Fri Jun 20 09:10:15 2003
+++ src_hack/java/awt/EventQueue.java	Fri Oct 17 09:26:57 2003
@@ -145,6 +145,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();
@@ -332,11 +339,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 src/javax/swing/JComponent.java src_hack/javax/swing/JComponent.java
--- src/javax/swing/JComponent.java	Fri Jun 20 09:11:41 2003
+++ src_hack/javax/swing/JComponent.java	Fri Oct 17 09:26:57 2003
@@ -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 src/javax/swing/JMenu.java src_hack/javax/swing/JMenu.java
--- src/javax/swing/JMenu.java	Fri Jun 20 09:11:42 2003
+++ src_hack/javax/swing/JMenu.java	Fri Oct 17 09:26:57 2003
@@ -1251,6 +1251,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 src/javax/swing/JMenuItem.java src_hack/javax/swing/JMenuItem.java
--- src/javax/swing/JMenuItem.java	Fri Jun 20 09:11:42 2003
+++ src_hack/javax/swing/JMenuItem.java	Fri Oct 17 09:26:57 2003
@@ -669,6 +669,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 81 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