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);
-
Field Summary
Fields Modifier and Type Field Description static int
BUFFERED_OPTION
Show buffered operations in a separateFrame
.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)
OverridesGraphics.clearRect
.void
clipRect(int x, int y, int width, int height)
OverridesGraphics.clipRect
.void
copyArea(int x, int y, int width, int height, int destX, int destY)
OverridesGraphics.copyArea
.Graphics
create()
OverridesGraphics.create
to return a DebugGraphics object.Graphics
create(int x, int y, int width, int height)
OverridesGraphics.create
to return a DebugGraphics object.void
dispose()
OverridesGraphics.dispose
.void
draw3DRect(int x, int y, int width, int height, boolean raised)
OverridesGraphics.draw3DRect
.void
drawArc(int x, int y, int width, int height, int startAngle, int arcAngle)
OverridesGraphics.drawArc
.void
drawBytes(byte[] data, int offset, int length, int x, int y)
OverridesGraphics.drawBytes
.void
drawChars(char[] data, int offset, int length, int x, int y)
OverridesGraphics.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)
OverridesGraphics.drawImage
.boolean
drawImage(