Module java.desktop
Package javax.swing

Class DebugGraphics

java.lang.Object
java.awt.Graphics
javax.swing.DebugGraphics

public class DebugGraphics
extends Graphics
Graphics subclass supporting graphics debugging. Overrides most methods from Graphics. DebugGraphics objects are rarely created by hand. They are most frequently created automatically when a JComponent's debugGraphicsOptions are changed using the setDebugGraphicsOptions() method.

NOTE: You must turn off double buffering to use DebugGraphics: RepaintManager repaintManager = RepaintManager.currentManager(component); repaintManager.setDoubleBufferingEnabled(false);

Since:
1.2
See Also:
JComponent.setDebugGraphicsOptions(int), RepaintManager.currentManager(java.awt.Component), RepaintManager.setDoubleBufferingEnabled(boolean)
  • Field Summary

    Fields 
    Modifier and Type Field Description
    static int BUFFERED_OPTION
    Show buffered operations in a separate Frame.
    static int FLASH_OPTION
    Flash graphics operations.
    static int LOG_OPTION
    Log graphics operations.
    static int NONE_OPTION
    Don't debug graphics operations.
  • Constructor Summary

    Constructors 
    Constructor Description
    DebugGraphics()
    Constructs a new debug graphics context that supports slowed down drawing.
    DebugGraphics​(Graphics graphics)
    Constructs a debug graphics context from an existing graphics context that supports slowed down drawing.
    DebugGraphics​(Graphics graphics, JComponent component)
    Constructs a debug graphics context from an existing graphics context that slows down drawing for the specified component.
  • Method Summary

    Modifier and Type Method Description
    void clearRect​(int x, int y, int width, int height)
    Overrides Graphics.clearRect.
    void clipRect​(int x, int y, int width, int height)
    Overrides Graphics.clipRect.
    void copyArea​(int x, int y, int width, int height, int destX, int destY)
    Overrides Graphics.copyArea.
    Graphics create()
    Overrides Graphics.create to return a DebugGraphics object.
    Graphics create​(int x, int y, int width, int height)
    Overrides Graphics.create to return a DebugGraphics object.
    void dispose()
    Overrides Graphics.dispose.
    void draw3DRect​(int x, int y, int width, int height, boolean raised)
    Overrides Graphics.draw3DRect.
    void drawArc​(int x, int y, int width, int height, int startAngle, int arcAngle)
    Overrides Graphics.drawArc.
    void drawBytes​(byte[] data, int offset, int length, int x, int y)
    Overrides Graphics.drawBytes.
    void drawChars​(char[] data, int offset, int length, int x, int y)
    Overrides Graphics.drawChars.
    boolean drawImage​(Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, Color bgcolor, ImageObserver observer)
    Overrides Graphics.drawImage.
    boolean drawImage​(