org.fest.swing.edt
Class FailOnThreadViolationRepaintManager

java.lang.Object
  extended by javax.swing.RepaintManager
      extended by org.fest.swing.edt.FailOnThreadViolationRepaintManager

public class FailOnThreadViolationRepaintManager
extends RepaintManager

Fails a test when a Event Dispatch Thread rule violation is detected.
See How to Use Threads for more info

Author:
Alex Ruiz

Constructor Summary
FailOnThreadViolationRepaintManager()
           
FailOnThreadViolationRepaintManager(boolean completeCheck)
           
 
Method Summary
 void addDirtyRegion(JComponent component, int x, int y, int w, int h)
           
 void addInvalidComponent(JComponent component)
           
static FailOnThreadViolationRepaintManager install()
          Creates a new FailOnThreadViolationRepaintManager and sets it as the current repaint manager.
 
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FailOnThreadViolationRepaintManager

public FailOnThreadViolationRepaintManager()

FailOnThreadViolationRepaintManager

public FailOnThreadViolationRepaintManager(boolean completeCheck)
Method Detail

install

public static FailOnThreadViolationRepaintManager install()
Creates a new FailOnThreadViolationRepaintManager and sets it as the current repaint manager.

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:
RepaintManager.setCurrentManager(RepaintManager)

addInvalidComponent

public void addInvalidComponent(JComponent component)
Overrides:
addInvalidComponent in class RepaintManager

addDirtyRegion

public void addDirtyRegion(JComponent component,
                           int x,
                           int y,
                           int w,
                           int h)
Overrides:
addDirtyRegion in class RepaintManager


Copyright © 2007-2011 FEST (Fixtures for Easy Software Testing). All Rights Reserved.