src/share/classes/javax/swing/text/DefaultCaret.java

Print this page




 220         return updatePolicy;
 221     }
 222 
 223     /**
 224      * Gets the text editor component that this caret is
 225      * is bound to.
 226      *
 227      * @return the component
 228      */
 229     protected final JTextComponent getComponent() {
 230         return component;
 231     }
 232 
 233     /**
 234      * Cause the caret to be painted.  The repaint
 235      * area is the bounding box of the caret (i.e.
 236      * the caret rectangle or <em>this</em>).
 237      * <p>
 238      * This method is thread safe, although most Swing methods
 239      * are not. Please see
 240      * <A HREF="http://download.oracle.com/javase/tutorial/uiswing/concurrency/index.html">Concurrency
 241      * in Swing</A> for more information.
 242      */
 243     protected final synchronized void repaint() {
 244         if (component != null) {
 245             component.repaint(x, y, width, height);
 246         }
 247     }
 248 
 249     /**
 250      * Damages the area surrounding the caret to cause
 251      * it to be repainted in a new location.  If paint()
 252      * is reimplemented, this method should also be
 253      * reimplemented.  This method should update the
 254      * caret bounds (x, y, width, and height).
 255      *
 256      * @param r  the current location of the caret
 257      * @see #paint
 258      */
 259     protected synchronized void damage(Rectangle r) {
 260         if (r != null) {




 220         return updatePolicy;
 221     }
 222 
 223     /**
 224      * Gets the text editor component that this caret is
 225      * is bound to.
 226      *
 227      * @return the component
 228      */
 229     protected final JTextComponent getComponent() {
 230         return component;
 231     }
 232 
 233     /**
 234      * Cause the caret to be painted.  The repaint
 235      * area is the bounding box of the caret (i.e.
 236      * the caret rectangle or <em>this</em>).
 237      * <p>
 238      * This method is thread safe, although most Swing methods
 239      * are not. Please see
 240      * <A HREF="http://docs.oracle.com/javase/tutorial/uiswing/concurrency/index.html">Concurrency
 241      * in Swing</A> for more information.
 242      */
 243     protected final synchronized void repaint() {
 244         if (component != null) {
 245             component.repaint(x, y, width, height);
 246         }
 247     }
 248 
 249     /**
 250      * Damages the area surrounding the caret to cause
 251      * it to be repainted in a new location.  If paint()
 252      * is reimplemented, this method should also be
 253      * reimplemented.  This method should update the
 254      * caret bounds (x, y, width, and height).
 255      *
 256      * @param r  the current location of the caret
 257      * @see #paint
 258      */
 259     protected synchronized void damage(Rectangle r) {
 260         if (r != null) {