OSDN Git Service

Merged gcj-eclipse branch to trunk.
[pf3gnuchains/gcc-fork.git] / libjava / classpath / javax / swing / text / DefaultCaret.java
index 84f47f1..c4c2580 100644 (file)
@@ -804,7 +804,7 @@ public class DefaultCaret extends Rectangle
       }
       }
   }
-  
+
   private void handleHighlight()
   {
     Highlighter highlighter = textComponent.getHighlighter();
@@ -946,7 +946,7 @@ public class DefaultCaret extends Rectangle
    *
    * @return all registered event listeners of the specified type
    */
-  public EventListener[] getListeners(Class listenerType)
+  public <T extends EventListener> T[] getListeners(Class<T> listenerType)
   {
     return listenerList.getListeners(listenerType);
   }
@@ -1075,8 +1075,6 @@ public class DefaultCaret extends Rectangle
         handleHighlight();
 
         appear();
-
-        adjustVisibility(this);
       }
   }
 
@@ -1114,8 +1112,6 @@ public class DefaultCaret extends Rectangle
         clearHighlight();
         
         appear();
-        
-        adjustVisibility(this);
       }
   }
   
@@ -1154,7 +1150,12 @@ public class DefaultCaret extends Rectangle
             // e.printStackTrace();
           }
         if (area != null)
-          damage(area);
+          {
+            adjustVisibility(area);
+            if (getMagicCaretPosition() == null)
+              setMagicCaretPosition(new Point(area.x, area.y));
+            damage(area);
+          }
       }
     repaint();
   }