Hi,

The DefaultCaret blinking has caused alot of overhead via the repainting
queue: 1st it always repainted the whole textcomponent (imaging repainting
a whole styled text window only for caret blinking), 2nd: it repainted on
a setVisible call even if the actual value did not change. Both are fixed.

2005-10-04  Roman Kennke  <[EMAIL PROTECTED]>

        * javax/swing/text/DefaultCaret.java
        (repaint): Adjust repaint rectangle.
        (setVisible): Only repaint if the visible property actually changed.


/Roman
Index: javax/swing/text/DefaultCaret.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/text/DefaultCaret.java,v
retrieving revision 1.15
diff -u -r1.15 DefaultCaret.java
--- javax/swing/text/DefaultCaret.java	30 Sep 2005 19:54:18 -0000	1.15
+++ javax/swing/text/DefaultCaret.java	4 Oct 2005 15:12:40 -0000
@@ -470,10 +470,7 @@
    */
   protected final void repaint()
   {
-    // FIXME: Is this good? This possibly causes alot of the component
-    // hierarchy to be repainted on every caret blink.
-    if (textComponent != null)
-      textComponent.repaint();
+    textComponent.repaint(this);
   }
 
   /**
@@ -668,8 +665,11 @@
    */  
   public void setVisible(boolean v)
   {
-    visible = v;
-    repaint();
+    if (v != visible)
+      {
+        visible = v;
+        repaint();
+      }
   }
 
   /**
_______________________________________________
Classpath-patches mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/classpath-patches

Reply via email to