RepaintManager (Java SE 15 & JDK 15) (original) (raw)


public class RepaintManager extends Object

This class manages repaint requests, allowing the number of repaints to be minimized, for example by collapsing multiple requests into a single repaint for members of a component tree.

As of 1.6 RepaintManager handles repaint requests for Swing's top level components (JApplet,JWindow, JFrame and JDialog). Any calls to repaint on one of these will call into the appropriate addDirtyRegion method.

Since:

1.2

Constructors

Constructor Description
RepaintManager() Create a new RepaintManager instance.
Modifier and Type Method Description
void addDirtyRegion​(Applet applet, int x, int y, int w, int h) Deprecated.
void addDirtyRegion​(Window window, int x, int y, int w, int h) Adds window to the list of Components that need to be repainted.
void addDirtyRegion​(JComponent c, int x, int y, int w, int h) Add a component in the list of components that should be refreshed.
void addInvalidComponent​(JComponent invalidComponent) Mark the component as in need of layout and queue a runnable for the event dispatching thread that will validate the components first isValidateRoot() ancestor.
static RepaintManager currentManager​(Component c) Return the RepaintManager for the calling thread given a Component.
static RepaintManager currentManager​(JComponent c) Return the RepaintManager for the calling thread given a JComponent.
Rectangle getDirtyRegion​(JComponent aComponent) Return the current dirty region for a component.
Dimension getDoubleBufferMaximumSize() Returns the maximum double buffer size.
Image getOffscreenBuffer​(Component c, int proposedWidth, int proposedHeight) Return the offscreen buffer that should be used as a double buffer with the component c.
Image getVolatileOffscreenBuffer​(Component c, int proposedWidth, int proposedHeight) Return a volatile offscreen buffer that should be used as a double buffer with the specified component c.
boolean isCompletelyDirty​(JComponent aComponent) Convenience method that returns true if aComponent will be completely painted during the next paintDirtyRegions().
boolean isDoubleBufferingEnabled() Returns true if this RepaintManager is double buffered.
void markCompletelyClean​(JComponent aComponent) Mark a component completely clean.
void markCompletelyDirty​(JComponent aComponent) Mark a component completely dirty.
void paintDirtyRegions() Paint all of the components that have been marked dirty.
void removeInvalidComponent​(JComponent component) Remove a component from the list of invalid components.
static void setCurrentManager​(RepaintManager aRepaintManager) Set the RepaintManager that should be used for the calling thread.
void setDoubleBufferingEnabled​(boolean aFlag) Enables or disables double buffering in this RepaintManager.
void setDoubleBufferMaximumSize​(Dimension d) Set the maximum double buffer size.
String toString() Returns a string that displays and identifies this object's properties.
void validateInvalidComponents() Validate all of the components that have been marked invalid.