JIDE 3.5.15

com.jidesoft.utils
Class ThreadCheckingRepaintManager

java.lang.Object
  extended by javax.swing.RepaintManager
      extended by com.jidesoft.utils.ThreadCheckingRepaintManager

public class ThreadCheckingRepaintManager
extends RepaintManager

For usage of this class, please refer to http://weblogs.java.net/blog/alexfromsun/archive/2006/02/debugging_swing.html

To use it, call RepaintManager.setCurrentManager(new ThreadCheckingRepaintManager()) then watch the print out from the console of all threading violations.


Constructor Summary
ThreadCheckingRepaintManager()
          Creates ThreadCheckingRepaintManager.
ThreadCheckingRepaintManager(boolean checkIsShowing)
          Creates ThreadCheckingRepaintManager.
 
Method Summary
 void addDirtyRegion(JComponent jComponent, int i, int i1, int i2, int i3)
           
 void addInvalidComponent(JComponent jComponent)
           
 boolean isCompleteCheck()
          Initially there was a rule that it is safe to create and use Swing components until they are realized but this rule is not valid any more, and now it is recommended to interact with Swing from EDT only.
 void setCompleteCheck(boolean completeCheck)
           
 
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

ThreadCheckingRepaintManager

public ThreadCheckingRepaintManager()
Creates ThreadCheckingRepaintManager. You can create one and set it using RepaintManager.setCurrentManager(new ThreadCheckingRepaintManager()).


ThreadCheckingRepaintManager

public ThreadCheckingRepaintManager(boolean checkIsShowing)
Creates ThreadCheckingRepaintManager. You can create one and set it using RepaintManager.setCurrentManager(new ThreadCheckingRepaintManager()).

Parameters:
checkIsShowing - true to only check showing components.
Method Detail

isCompleteCheck

public boolean isCompleteCheck()
Initially there was a rule that it is safe to create and use Swing components until they are realized but this rule is not valid any more, and now it is recommended to interact with Swing from EDT only.

That's why completeCheck flag is used - if you test the old program switch it to false, but new applications should be tested with completeCheck set to true*

Returns:
true or false. By default, it is false.

setCompleteCheck

public void setCompleteCheck(boolean completeCheck)
Parameters:
completeCheck - true or false.
See Also:
isCompleteCheck()

addInvalidComponent

public void addInvalidComponent(JComponent jComponent)
Overrides:
addInvalidComponent in class RepaintManager

addDirtyRegion

public void addDirtyRegion(JComponent jComponent,
                           int i,
                           int i1,
                           int i2,
                           int i3)
Overrides:
addDirtyRegion in class RepaintManager

JIDE 3.5.15