spin.over
Class CheckingRepaintManager
RepaintManager
spin.over.CheckingRepaintManager
public class CheckingRepaintManager
extends RepaintManager
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).
javax.swing.RepaintManager
void | addDirtyRegion(JComponent component, int x, int y, int w, int h) - Overriden to check EDT rule.
|
void | addInvalidComponent(JComponent component) - Overriden to check EDT rule.
|
protected void | checkEDTRule(Component component) - Check EDT rule on access to the given component.
|
protected void | indicate(EDTRuleViolation violation) - Indicate a violation of the EDT rule.
|
protected boolean | isLiableToEDTRule(StackTraceElement element) - Is the given stackTraceElement liable to the EDT rule.
|
protected boolean | violatesEDTRule(Component component) - Does acces to the given component violate the EDT rule.
|
addDirtyRegion
public void addDirtyRegion(JComponent component,
int x,
int y,
int w,
int h)
Overriden to check EDT rule.
addInvalidComponent
public void addInvalidComponent(JComponent component)
Overriden to check EDT rule.
checkEDTRule
protected void checkEDTRule(Component component)
Check EDT rule on access to the given component.
component
- component to be repainted
indicate
protected void indicate(EDTRuleViolation violation)
throws EDTRuleViolation
Indicate a violation of the EDT rule. This default implementation throws
the given exception, subclasses may want to log the exception instead.
violation
- violation of EDT rule
isLiableToEDTRule
protected boolean isLiableToEDTRule(StackTraceElement element)
throws Exception
Is the given stackTraceElement liable to the EDT rule.
true
if the className of the given element
denotes a subclass of java.awt.Component
violatesEDTRule
protected boolean violatesEDTRule(Component component)
Does acces to the given component violate the EDT rule.
component
- accessed component
true
if EDT rule is violated