Package spin.over
Class CheckingRepaintManager
java.lang.Object
javax.swing.RepaintManager
spin.over.CheckingRepaintManager
A repaintManager that checks bad access - i.e. access from non EDT - to Swing
components. Install with:
RepaintManager.setCurrentManager(new CheckingRepaintManager());Based on an idea by Scott Delap (http://www.clientjava.com).
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDirtyRegion(JComponent component, int x, int y, int w, int h) Overriden to check EDT rule.voidaddInvalidComponent(JComponent component) Overriden to check EDT rule.protected voidcheckEDTRule(Component component) Check EDT rule on access to the given component.protected voidindicate(EDTRuleViolation violation) Indicate a violation of the EDT rule.protected booleanisLiableToEDTRule(StackTraceElement element) Is the given stackTraceElement liable to the EDT rule.protected booleanviolatesEDTRule(Component component) Does acces to the given component violate the EDT rule.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
-
CheckingRepaintManager
public CheckingRepaintManager()
-
-
Method Details
-
addInvalidComponent
Overriden to check EDT rule.- Overrides:
addInvalidComponentin classRepaintManager
-
addDirtyRegion
Overriden to check EDT rule.- Overrides:
addDirtyRegionin classRepaintManager
-
checkEDTRule
Check EDT rule on access to the given component.- Parameters:
component- component to be repainted
-
violatesEDTRule
Does acces to the given component violate the EDT rule.- Parameters:
component- accessed component- Returns:
trueif EDT rule is violated
-
isLiableToEDTRule
Is the given stackTraceElement liable to the EDT rule.- Parameters:
element- element- Returns:
trueif the className of the given element denotes a subclass ofjava.awt.Component- Throws:
Exception- on any problem
-
indicate
Indicate a violation of the EDT rule. This default implementation throws the given exception, subclasses may want to log the exception instead.- Parameters:
violation- violation of EDT rule- Throws:
EDTRuleViolation
-