Package org.fest.swing.edt
Class FailOnThreadViolationRepaintManager
java.lang.Object
javax.swing.RepaintManager
org.fest.swing.edt.CheckThreadViolationRepaintManager
org.fest.swing.edt.FailOnThreadViolationRepaintManager
Fails a test when a Event Dispatch Thread rule violation is detected.
See How to Use Threads for more info
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static Object
install()
Creates a new
and sets it as the current repaint manager.FailOnThreadViolationRepaintManager
private static FailOnThreadViolationRepaintManager
(package private) void
violationFound
(JComponent c, StackTraceElement[] stackTraceElements) Throws a
when a EDT access violation is found.EdtViolationException
Methods inherited from class org.fest.swing.edt.CheckThreadViolationRepaintManager
addDirtyRegion, addInvalidComponent
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
-
Constructor Details
-
FailOnThreadViolationRepaintManager
public FailOnThreadViolationRepaintManager() -
FailOnThreadViolationRepaintManager
public FailOnThreadViolationRepaintManager(boolean completeCheck)
-
-
Method Details
-
install
Creates a new
and sets it as the current repaint manager.FailOnThreadViolationRepaintManager
On Sun JVMs, this method will install the new repaint manager the first time only. Once installed, subsequent calls to this method will not install new repaint managers. This optimization may not work on non-Sun JVMs, since we use reflection to check if a
CheckThreadViolationRepaintManager
is already installed.- Returns:
- the created (and installed) repaint manager.
- See Also:
-
currentRepaintManager
-
installNew
-
violationFound
Throws a
when a EDT access violation is found.EdtViolationException
- Specified by:
violationFound
in classCheckThreadViolationRepaintManager
- Parameters:
c
- the component involved in the EDT violation.stackTraceElements
- stack trace elements to be set to the thrown exception.- Throws:
EdtViolationException
- when a EDT access violation is found.
-