Package org.jdesktop.swingx
Class ForwardingRepaintManager
- java.lang.Object
-
- javax.swing.RepaintManager
-
- org.jdesktop.swingx.ForwardingRepaintManager
-
- Direct Known Subclasses:
RepaintManagerX
public class ForwardingRepaintManager extends javax.swing.RepaintManager
ARepaintManager
that is designed to forward all calls to a contained delegate. This class is designed for extension, such that subclasses should override method as appropriate and allow the original repaint manager to handle the rest of the work.Install a forwarding repaint manager:
RepaintManager manager = RepaintManager.currentManager(this); RepaintManager frm = new ForwardingRepaintManager(manager); RepaintManager.setCurrentManager(frm);
- Author:
- Karl George Schaefer, pietblok (original facade/delegate idea)
-
-
Constructor Summary
Constructors Constructor Description ForwardingRepaintManager(javax.swing.RepaintManager delegate)
Creates a new forwarding manager that forwards all calls to the delegate.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addDirtyRegion(java.applet.Applet applet, int x, int y, int w, int h)
void
addDirtyRegion(java.awt.Window window, int x, int y, int w, int h)
void
addDirtyRegion(javax.swing.JComponent c, int x, int y, int w, int h)
void
addInvalidComponent(javax.swing.JComponent invalidComponent)
javax.swing.RepaintManager
getDelegateManager()
Gets the delegate repaint manager backing this forwarding repaint manager.java.awt.Rectangle
getDirtyRegion(javax.swing.JComponent component)
java.awt.Dimension
getDoubleBufferMaximumSize()
java.awt.Image
getOffscreenBuffer(java.awt.Component c, int proposedWidth, int proposedHeight)
java.awt.Image
getVolatileOffscreenBuffer(java.awt.Component c, int proposedWidth, int proposedHeight)
boolean
isCompletelyDirty(javax.swing.JComponent component)
boolean
isDoubleBufferingEnabled()
void
markCompletelyClean(javax.swing.JComponent component)
void
markCompletelyDirty(javax.swing.JComponent component)
void
paintDirtyRegions()
void
removeInvalidComponent(javax.swing.JComponent component)
void
setDoubleBufferingEnabled(boolean flag)
void
setDoubleBufferMaximumSize(java.awt.Dimension d)
java.lang.String
toString()
void
validateInvalidComponents()
-
-
-
Constructor Detail
-
ForwardingRepaintManager
public ForwardingRepaintManager(javax.swing.RepaintManager delegate)
Creates a new forwarding manager that forwards all calls to the delegate.- Parameters:
delegate
- the manager backing thisForwardingRepaintManager
- Throws:
java.lang.NullPointerException
- ifdelegate
isnull
-
-
Method Detail
-
addDirtyRegion
public void addDirtyRegion(java.applet.Applet applet, int x, int y, int w, int h)
- Overrides:
addDirtyRegion
in classjavax.swing.RepaintManager
-
addDirtyRegion
public void addDirtyRegion(javax.swing.JComponent c, int x, int y, int w, int h)
- Overrides:
addDirtyRegion
in classjavax.swing.RepaintManager
-
addDirtyRegion
public void addDirtyRegion(java.awt.Window window, int x, int y, int w, int h)
- Overrides:
addDirtyRegion
in classjavax.swing.RepaintManager
-
addInvalidComponent
public void addInvalidComponent(javax.swing.JComponent invalidComponent)
- Overrides:
addInvalidComponent
in classjavax.swing.RepaintManager
-
getDirtyRegion
public java.awt.Rectangle getDirtyRegion(javax.swing.JComponent component)
- Overrides:
getDirtyRegion
in classjavax.swing.RepaintManager
-
getDoubleBufferMaximumSize
public java.awt.Dimension getDoubleBufferMaximumSize()
- Overrides:
getDoubleBufferMaximumSize
in classjavax.swing.RepaintManager
-
getOffscreenBuffer
public java.awt.Image getOffscreenBuffer(java.awt.Component c, int proposedWidth, int proposedHeight)
- Overrides:
getOffscreenBuffer
in classjavax.swing.RepaintManager
-
getVolatileOffscreenBuffer
public java.awt.Image getVolatileOffscreenBuffer(java.awt.Component c, int proposedWidth, int proposedHeight)
- Overrides:
getVolatileOffscreenBuffer
in classjavax.swing.RepaintManager
-
isCompletelyDirty
public boolean isCompletelyDirty(javax.swing.JComponent component)
- Overrides:
isCompletelyDirty
in classjavax.swing.RepaintManager
-
isDoubleBufferingEnabled
public boolean isDoubleBufferingEnabled()
- Overrides:
isDoubleBufferingEnabled
in classjavax.swing.RepaintManager
-
markCompletelyClean
public void markCompletelyClean(javax.swing.JComponent component)
- Overrides:
markCompletelyClean
in classjavax.swing.RepaintManager
-
markCompletelyDirty
public void markCompletelyDirty(javax.swing.JComponent component)
- Overrides:
markCompletelyDirty
in classjavax.swing.RepaintManager
-
paintDirtyRegions
public void paintDirtyRegions()
- Overrides:
paintDirtyRegions
in classjavax.swing.RepaintManager
-
removeInvalidComponent
public void removeInvalidComponent(javax.swing.JComponent component)
- Overrides:
removeInvalidComponent
in classjavax.swing.RepaintManager
-
setDoubleBufferingEnabled
public void setDoubleBufferingEnabled(boolean flag)
- Overrides:
setDoubleBufferingEnabled
in classjavax.swing.RepaintManager
-
setDoubleBufferMaximumSize
public void setDoubleBufferMaximumSize(java.awt.Dimension d)
- Overrides:
setDoubleBufferMaximumSize
in classjavax.swing.RepaintManager
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjavax.swing.RepaintManager
-
validateInvalidComponents
public void validateInvalidComponents()
- Overrides:
validateInvalidComponents
in classjavax.swing.RepaintManager
-
getDelegateManager
public final javax.swing.RepaintManager getDelegateManager()
Gets the delegate repaint manager backing this forwarding repaint manager.- Returns:
- the delegate for this forwarding manager
-
-