org.jdesktop.swingx
Class ForwardingRepaintManager

java.lang.Object
  extended by javax.swing.RepaintManager
      extended by org.jdesktop.swingx.ForwardingRepaintManager
Direct Known Subclasses:
RepaintManagerX

public class ForwardingRepaintManager
extends javax.swing.RepaintManager

A RepaintManager 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
ForwardingRepaintManager(javax.swing.RepaintManager delegate)
          Creates a new forwarding manager that forwards all calls to the delegate.
 
Method Summary
 void addDirtyRegion(java.applet.Applet applet, int x, int y, int w, int h)
          
 void addDirtyRegion(javax.swing.JComponent c, int x, int y, int w, int h)
          
 void addDirtyRegion(java.awt.Window window, 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()
          
 
Methods inherited from class javax.swing.RepaintManager
currentManager, currentManager, setCurrentManager
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

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 this ForwardingRepaintManager
Throws:
java.lang.NullPointerException - if delegate is null
Method Detail

addDirtyRegion

public void addDirtyRegion(java.applet.Applet applet,
                           int x,
                           int y,
                           int w,
                           int h)

Overrides:
addDirtyRegion in class javax.swing.RepaintManager

addDirtyRegion

public void addDirtyRegion(javax.swing.JComponent c,
                           int x,
                           int y,
                           int w,
                           int h)

Overrides:
addDirtyRegion in class javax.swing.RepaintManager

addDirtyRegion

public void addDirtyRegion(java.awt.Window window,
                           int x,
                           int y,
                           int w,
                           int h)

Overrides:
addDirtyRegion in class javax.swing.RepaintManager

addInvalidComponent

public void addInvalidComponent(javax.swing.JComponent invalidComponent)

Overrides:
addInvalidComponent in class javax.swing.RepaintManager

getDirtyRegion

public java.awt.Rectangle getDirtyRegion(javax.swing.JComponent component)

Overrides:
getDirtyRegion in class javax.swing.RepaintManager

getDoubleBufferMaximumSize

public java.awt.Dimension getDoubleBufferMaximumSize()

Overrides:
getDoubleBufferMaximumSize in class javax.swing.RepaintManager

getOffscreenBuffer

public java.awt.Image getOffscreenBuffer(java.awt.Component c,
                                         int proposedWidth,
                                         int proposedHeight)

Overrides:
getOffscreenBuffer in class javax.swing.RepaintManager

getVolatileOffscreenBuffer

public java.awt.Image getVolatileOffscreenBuffer(java.awt.Component c,
                                                 int proposedWidth,
                                                 int proposedHeight)

Overrides:
getVolatileOffscreenBuffer in class javax.swing.RepaintManager

isCompletelyDirty

public boolean isCompletelyDirty(javax.swing.JComponent component)

Overrides:
isCompletelyDirty in class javax.swing.RepaintManager

isDoubleBufferingEnabled

public boolean isDoubleBufferingEnabled()

Overrides:
isDoubleBufferingEnabled in class javax.swing.RepaintManager

markCompletelyClean

public void markCompletelyClean(javax.swing.JComponent component)

Overrides:
markCompletelyClean in class javax.swing.RepaintManager

markCompletelyDirty

public void markCompletelyDirty(javax.swing.JComponent component)

Overrides:
markCompletelyDirty in class javax.swing.RepaintManager

paintDirtyRegions

public void paintDirtyRegions()

Overrides:
paintDirtyRegions in class javax.swing.RepaintManager

removeInvalidComponent

public void removeInvalidComponent(javax.swing.JComponent component)

Overrides:
removeInvalidComponent in class javax.swing.RepaintManager

setDoubleBufferingEnabled

public void setDoubleBufferingEnabled(boolean flag)

Overrides:
setDoubleBufferingEnabled in class javax.swing.RepaintManager

setDoubleBufferMaximumSize

public void setDoubleBufferMaximumSize(java.awt.Dimension d)

Overrides:
setDoubleBufferMaximumSize in class javax.swing.RepaintManager

toString

public java.lang.String toString()

Overrides:
toString in class javax.swing.RepaintManager

validateInvalidComponents

public void validateInvalidComponents()

Overrides:
validateInvalidComponents in class javax.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


Copyright © 2010. All Rights Reserved.