Package com.tech.app.functions
Class CheckThreadViolationRepaintManager
- java.lang.Object
-
- javax.swing.RepaintManager
-
- com.tech.app.functions.CheckThreadViolationRepaintManager
-
public class CheckThreadViolationRepaintManager extends javax.swing.RepaintManager
This 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 boolean
completeCheck
private java.lang.ref.WeakReference<javax.swing.JComponent>
lastComponent
private static javax.swing.JButton
test
-
Constructor Summary
Constructors Constructor Description CheckThreadViolationRepaintManager()
CheckThreadViolationRepaintManager(boolean completeCheck)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addDirtyRegion(javax.swing.JComponent component, int x, int y, int w, int h)
void
addInvalidComponent(javax.swing.JComponent component)
private void
checkThreadViolations(javax.swing.JComponent c)
(package private) static void
imageUpdateTest()
boolean
isCompleteCheck()
static void
main(java.lang.String[] args)
(package private) static void
repaintTest()
void
setCompleteCheck(boolean completeCheck)
(package private) static void
test()
protected void
violationFound(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:
addInvalidComponent
in classjavax.swing.RepaintManager
-
addDirtyRegion
public void addDirtyRegion(javax.swing.JComponent component, int x, int y, int w, int h)
- Overrides:
addDirtyRegion
in 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()
-
-