|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.RepaintManager
org.jdesktop.swingx.ForwardingRepaintManager
public class ForwardingRepaintManager
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);
Constructor Summary | |
---|---|
ForwardingRepaintManager(RepaintManager delegate)
Creates a new forwarding manager that forwards all calls to the delegate. |
Method Summary | |
---|---|
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. |
RepaintManager |
getDelegateManager()
Gets the delegate repaint manager backing this forwarding repaint manager. |
Rectangle |
getDirtyRegion(JComponent component)
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 component)
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 component)
Mark a component completely clean. |
void |
markCompletelyDirty(JComponent component)
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. |
void |
setDoubleBufferingEnabled(boolean flag)
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. |
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 |
---|
public ForwardingRepaintManager(RepaintManager delegate)
delegate
- the manager backing this ForwardingRepaintManager
NullPointerException
- if delegate
is null
Method Detail |
---|
public void addDirtyRegion(JComponent c, int x, int y, int w, int h)
addDirtyRegion
in class RepaintManager
JComponent.repaint(long, int, int, int, int)
public void addInvalidComponent(JComponent invalidComponent)
addInvalidComponent
in class RepaintManager
JComponent.isValidateRoot()
,
RepaintManager.removeInvalidComponent(javax.swing.JComponent)
public Rectangle getDirtyRegion(JComponent component)
getDirtyRegion
in class RepaintManager
public Dimension getDoubleBufferMaximumSize()
getDoubleBufferMaximumSize
in class RepaintManager
public Image getOffscreenBuffer(Component c, int proposedWidth, int proposedHeight)
c
.
By default there is a double buffer per RepaintManager.
The buffer might be smaller than (proposedWidth,proposedHeight)
This happens when the maximum double buffer size as been set for the receiving
repaint manager.
getOffscreenBuffer
in class RepaintManager
public Image getVolatileOffscreenBuffer(Component c, int proposedWidth, int proposedHeight)
c
.
The image returned will be an instance of VolatileImage, or null
if a VolatileImage object could not be instantiated.
This buffer might be smaller than (proposedWidth,proposedHeight)
.
This happens when the maximum double buffer size has been set for this
repaint manager.
getVolatileOffscreenBuffer
in class RepaintManager
VolatileImage
public boolean isCompletelyDirty(JComponent component)
isCompletelyDirty
in class RepaintManager
public boolean isDoubleBufferingEnabled()
false
to avoid unnecessary buffering in Swing.
On platforms where native double buffering is not supported,
the default value will be true
.
isDoubleBufferingEnabled
in class RepaintManager
public void markCompletelyClean(JComponent component)
markCompletelyClean
in class RepaintManager
public void markCompletelyDirty(JComponent component)
markCompletelyDirty
in class RepaintManager
public void paintDirtyRegions()
paintDirtyRegions
in class RepaintManager
RepaintManager.addDirtyRegion(javax.swing.JComponent, int, int, int, int)
public void removeInvalidComponent(JComponent component)
removeInvalidComponent
in class RepaintManager
RepaintManager.addInvalidComponent(javax.swing.JComponent)
public void setDoubleBufferingEnabled(boolean flag)
setDoubleBufferingEnabled
in class RepaintManager
flag
- true to activate double bufferingRepaintManager.isDoubleBufferingEnabled()
public void setDoubleBufferMaximumSize(Dimension d)
setDoubleBufferMaximumSize
in class RepaintManager
public String toString()
toString
in class RepaintManager
public void validateInvalidComponents()
validateInvalidComponents
in class RepaintManager
RepaintManager.addInvalidComponent(javax.swing.JComponent)
public final RepaintManager getDelegateManager()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |