|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.RepaintManager
edu.umd.cs.piccolox.pswing.PSwingRepaintManager
public class PSwingRepaintManager
This RepaintManager replaces the default Swing implementation, and is used to intercept and repaint dirty regions of PSwing components.
This is an internal class used by Piccolo to support Swing components in Piccolo. This should not be instantiated, though all the public methods of javax.swing.RepaintManager may still be called and perform in the expected manner. PBasicRepaint Manager is an extension of RepaintManager that traps those repaints called by the Swing components that have been added to the PCanvas and passes these repaints to the SwingVisualComponent rather than up the component hierarchy as usually happens. Also traps revalidate calls made by the Swing components added to the PCanvas to reshape the applicable Visual Component. Also keeps a list of PSwings that are painting. This disables repaint until the component has finished painting. This is to address a problem introduced by Swing's CellRendererPane which is itself a work-around. The problem is that JTable's, JTree's, and JList's cell renderers need to be validated before repaint. Since we have to repaint the entire Swing component hierarchy (in the case of a Swing component group used as a Piccolo visual component). This causes an infinite loop. So we introduce the restriction that no repaints can be triggered by a call to paint.
Constructor Summary | |
---|---|
PSwingRepaintManager()
|
Method Summary | |
---|---|
void |
addDirtyRegion(javax.swing.JComponent c,
int x,
int y,
int w,
int h)
This is the method "repaint" now calls in the Swing components. |
void |
addInvalidComponent(javax.swing.JComponent invalidComponent)
This is the method "revalidate" calls in the Swing components. |
boolean |
isPainting(javax.swing.JComponent c)
Returns true if repaint is currently locked for a component and false otherwise |
void |
lockRepaint(javax.swing.JComponent c)
Locks repaint for a particular (Swing) component displayed by PCanvas |
void |
unlockRepaint(javax.swing.JComponent c)
Unlocks repaint for a particular (Swing) component displayed by PCanvas |
Methods inherited from class javax.swing.RepaintManager |
---|
addDirtyRegion, addDirtyRegion, currentManager, currentManager, getDirtyRegion, getDoubleBufferMaximumSize, getOffscreenBuffer, getVolatileOffscreenBuffer, isCompletelyDirty, isDoubleBufferingEnabled, markCompletelyClean, markCompletelyDirty, paintDirtyRegions, removeInvalidComponent, setCurrentManager, setDoubleBufferingEnabled, setDoubleBufferMaximumSize, toString, validateInvalidComponents |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public PSwingRepaintManager()
Method Detail |
---|
public void lockRepaint(javax.swing.JComponent c)
c
- The component for which the repaint is to be lockedpublic void unlockRepaint(javax.swing.JComponent c)
c
- The component for which the repaint is to be unlockedpublic boolean isPainting(javax.swing.JComponent c)
c
- The component for which the repaint status is desired
public void addDirtyRegion(javax.swing.JComponent c, int x, int y, int w, int h)
addDirtyRegion
in class javax.swing.RepaintManager
c
- Component to be repaintedx
- X coordinate of the dirty region in the componenty
- Y coordinate of the dirty region in the componentw
- Width of the dirty region in the componenth
- Height of the dirty region in the componentpublic void addInvalidComponent(javax.swing.JComponent invalidComponent)
addInvalidComponent
in class javax.swing.RepaintManager
invalidComponent
- The Swing component that needs validation
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |