< prev index next >

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

Print this page




 319         // poses a problem we'll need a more sophisticated detection algorithm,
 320         // or API.
 321         this(BUFFER_STRATEGY_SPECIFIED_OFF);
 322     }
 323 
 324     private RepaintManager(short bufferStrategyType) {
 325         // If native doublebuffering is being used, do NOT use
 326         // Swing doublebuffering.
 327         doubleBufferingEnabled = !nativeDoubleBuffering;
 328         synchronized(this) {
 329             dirtyComponents = new IdentityHashMap<Component,Rectangle>();
 330             tmpDirtyComponents = new IdentityHashMap<Component,Rectangle>();
 331             this.bufferStrategyType = bufferStrategyType;
 332             hwDirtyComponents = new IdentityHashMap<Container,Rectangle>();
 333         }
 334         processingRunnable = new ProcessingRunnable();
 335     }
 336 
 337     private void displayChanged() {
 338         clearImages();




 339     }
 340 
 341     /**
 342      * Mark the component as in need of layout and queue a runnable
 343      * for the event dispatching thread that will validate the components
 344      * first isValidateRoot() ancestor.
 345      *
 346      * @param invalidComponent a component
 347      * @see JComponent#isValidateRoot
 348      * @see #removeInvalidComponent
 349      */
 350     public synchronized void addInvalidComponent(JComponent invalidComponent)
 351     {
 352         RepaintManager delegate = getDelegate(invalidComponent);
 353         if (delegate != null) {
 354             delegate.addInvalidComponent(invalidComponent);
 355             return;
 356         }
 357         Component validateRoot =
 358             SwingUtilities.getValidateRoot(invalidComponent, true);




 319         // poses a problem we'll need a more sophisticated detection algorithm,
 320         // or API.
 321         this(BUFFER_STRATEGY_SPECIFIED_OFF);
 322     }
 323 
 324     private RepaintManager(short bufferStrategyType) {
 325         // If native doublebuffering is being used, do NOT use
 326         // Swing doublebuffering.
 327         doubleBufferingEnabled = !nativeDoubleBuffering;
 328         synchronized(this) {
 329             dirtyComponents = new IdentityHashMap<Component,Rectangle>();
 330             tmpDirtyComponents = new IdentityHashMap<Component,Rectangle>();
 331             this.bufferStrategyType = bufferStrategyType;
 332             hwDirtyComponents = new IdentityHashMap<Container,Rectangle>();
 333         }
 334         processingRunnable = new ProcessingRunnable();
 335     }
 336 
 337     private void displayChanged() {
 338         clearImages();
 339 
 340         // Reset buffer maximum size to get valid size from updated graphics
 341         // environment in getDoubleBufferMaximumSize()
 342         setDoubleBufferMaximumSize(null);
 343     }
 344 
 345     /**
 346      * Mark the component as in need of layout and queue a runnable
 347      * for the event dispatching thread that will validate the components
 348      * first isValidateRoot() ancestor.
 349      *
 350      * @param invalidComponent a component
 351      * @see JComponent#isValidateRoot
 352      * @see #removeInvalidComponent
 353      */
 354     public synchronized void addInvalidComponent(JComponent invalidComponent)
 355     {
 356         RepaintManager delegate = getDelegate(invalidComponent);
 357         if (delegate != null) {
 358             delegate.addInvalidComponent(invalidComponent);
 359             return;
 360         }
 361         Component validateRoot =
 362             SwingUtilities.getValidateRoot(invalidComponent, true);


< prev index next >