< prev index next >

src/java.desktop/share/classes/javax/swing/RepaintManager.java

Print this page




 384         if (delegate != null) {
 385             delegate.removeInvalidComponent(component);
 386             return;
 387         }
 388         if(invalidComponents != null) {
 389             int index = invalidComponents.indexOf(component);
 390             if(index != -1) {
 391                 invalidComponents.remove(index);
 392             }
 393         }
 394     }
 395 
 396 
 397     /**
 398      * Add a component in the list of components that should be refreshed.
 399      * If <i>c</i> already has a dirty region, the rectangle <i>(x,y,w,h)</i>
 400      * will be unioned with the region that should be redrawn.
 401      *
 402      * @see JComponent#repaint
 403      */

 404     private void addDirtyRegion0(Container c, int x, int y, int w, int h) {
 405         /* Special cases we don't have to bother with.
 406          */
 407         if ((w <= 0) || (h <= 0) || (c == null)) {
 408             return;
 409         }
 410 
 411         if ((c.getWidth() <= 0) || (c.getHeight() <= 0)) {
 412             return;
 413         }
 414 
 415         if (extendDirtyRegion(c, x, y, w, h)) {
 416             // Component was already marked as dirty, region has been
 417             // extended, no need to continue.
 418             return;
 419         }
 420 
 421         /* Make sure that c and all it ancestors (up to an Applet or
 422          * Window) are visible.  This loop has the same effect as
 423          * checking c.isShowing() (and note that it's still possible




 384         if (delegate != null) {
 385             delegate.removeInvalidComponent(component);
 386             return;
 387         }
 388         if(invalidComponents != null) {
 389             int index = invalidComponents.indexOf(component);
 390             if(index != -1) {
 391                 invalidComponents.remove(index);
 392             }
 393         }
 394     }
 395 
 396 
 397     /**
 398      * Add a component in the list of components that should be refreshed.
 399      * If <i>c</i> already has a dirty region, the rectangle <i>(x,y,w,h)</i>
 400      * will be unioned with the region that should be redrawn.
 401      *
 402      * @see JComponent#repaint
 403      */
 404     @SuppressWarnings("deprecation")
 405     private void addDirtyRegion0(Container c, int x, int y, int w, int h) {
 406         /* Special cases we don't have to bother with.
 407          */
 408         if ((w <= 0) || (h <= 0) || (c == null)) {
 409             return;
 410         }
 411 
 412         if ((c.getWidth() <= 0) || (c.getHeight() <= 0)) {
 413             return;
 414         }
 415 
 416         if (extendDirtyRegion(c, x, y, w, h)) {
 417             // Component was already marked as dirty, region has been
 418             // extended, no need to continue.
 419             return;
 420         }
 421 
 422         /* Make sure that c and all it ancestors (up to an Applet or
 423          * Window) are visible.  This loop has the same effect as
 424          * checking c.isShowing() (and note that it's still possible


< prev index next >