Package com.tech.app.functions
Class CheckThreadViolationRepaintManager
- java.lang.Object
-
- javax.swing.RepaintManager
-
- com.tech.app.functions.CheckThreadViolationRepaintManager
-
public class CheckThreadViolationRepaintManager extends javax.swing.RepaintManagerThis class is used to detect Event Dispatch Thread rule violations
See How to Use Threads for more infoThis is a modification of original idea of Scott Delap
Initial version of ThreadCheckingRepaintManager can be found here
Easily Find Swing Threading Mistakes- Author:
- Scott Delap, Alexander Potochkin https://swinghelper.dev.java.net/
-
-
Field Summary
Fields Modifier and Type Field Description private booleancompleteCheckprivate java.lang.ref.WeakReference<javax.swing.JComponent>lastComponentprivate static javax.swing.JButtontest
-
Constructor Summary
Constructors Constructor Description CheckThreadViolationRepaintManager()CheckThreadViolationRepaintManager(boolean completeCheck)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddDirtyRegion(javax.swing.JComponent component, int x, int y, int w, int h)voidaddInvalidComponent(javax.swing.JComponent component)private voidcheckThreadViolations(javax.swing.JComponent c)(package private) static voidimageUpdateTest()booleanisCompleteCheck()static voidmain(java.lang.String[] args)(package private) static voidrepaintTest()voidsetCompleteCheck(boolean completeCheck)(package private) static voidtest()protected voidviolationFound(javax.swing.JComponent c, java.lang.StackTraceElement[] stackTrace)-
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
-
-
-
-
Method Detail
-
isCompleteCheck
public boolean isCompleteCheck()
-
setCompleteCheck
public void setCompleteCheck(boolean completeCheck)
-
addInvalidComponent
public void addInvalidComponent(javax.swing.JComponent component)
- Overrides:
addInvalidComponentin classjavax.swing.RepaintManager
-
addDirtyRegion
public void addDirtyRegion(javax.swing.JComponent component, int x, int y, int w, int h)- Overrides:
addDirtyRegionin classjavax.swing.RepaintManager
-
checkThreadViolations
private void checkThreadViolations(javax.swing.JComponent c)
-
violationFound
protected void violationFound(javax.swing.JComponent c, java.lang.StackTraceElement[] stackTrace)
-
main
public static void main(java.lang.String[] args) throws java.lang.Exception- Throws:
java.lang.Exception
-
test
static void test()
-
imageUpdateTest
static void imageUpdateTest()
-
repaintTest
static void repaintTest()
-
-