nl.lxtreme.ols.util.swing
Class ThreadViolationDetectionRepaintManager

java.lang.Object
  extended by javax.swing.RepaintManager
      extended by nl.lxtreme.ols.util.swing.ThreadViolationDetectionRepaintManager

public final class ThreadViolationDetectionRepaintManager
extends RepaintManager

ThreadViolationDetectionRepaintManager provides a custom repaint manager that can be used to determine whether all Swing components are correctly created on the EDT.

Code originates from the SwingHelper project, for more information see: "https://swinghelper.dev.java.net/".


Constructor Summary
ThreadViolationDetectionRepaintManager()
          Creates a new ThreadViolationDetectionRepaintManager instance.
ThreadViolationDetectionRepaintManager(boolean aCompleteCheck)
          Creates a new ThreadViolationDetectionRepaintManager instance.
 
Method Summary
 void addDirtyRegion(JComponent aComponent, int aX, int aY, int aWidth, int aHeight)
           
 void addInvalidComponent(JComponent aComponent)
           
static ThreadViolationDetectionRepaintManager install()
          Creates a new ThreadViolationDetectionRepaintManager 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

ThreadViolationDetectionRepaintManager

public ThreadViolationDetectionRepaintManager()
Creates a new ThreadViolationDetectionRepaintManager instance.


ThreadViolationDetectionRepaintManager

public ThreadViolationDetectionRepaintManager(boolean aCompleteCheck)
Creates a new ThreadViolationDetectionRepaintManager instance.

Parameters:
aCompleteCheck - true to perform a full check on all stack frames, false to only at the first few.
Method Detail

install

public static ThreadViolationDetectionRepaintManager install()
Creates a new ThreadViolationDetectionRepaintManager 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)

addDirtyRegion

public void addDirtyRegion(JComponent aComponent,
                           int aX,
                           int aY,
                           int aWidth,
                           int aHeight)
Overrides:
addDirtyRegion in class RepaintManager
See Also:
RepaintManager.addDirtyRegion(javax.swing.JComponent, int, int, int, int)

addInvalidComponent

public void addInvalidComponent(JComponent aComponent)
Overrides:
addInvalidComponent in class RepaintManager
See Also:
RepaintManager.addInvalidComponent(javax.swing.JComponent)


Copyright © 2012 L'Xtreme IT consultancy. All Rights Reserved.