java.lang.Object | ||
↳ | java.awt.Graphics | |
↳ | javax.swing.DebugGraphics |
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);
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | BUFFERED_OPTION | Show buffered operations in a separate Frame . |
|||||||||
int | FLASH_OPTION | Flash graphics operations. | |||||||||
int | LOG_OPTION | Log graphics operations. | |||||||||
int | NONE_OPTION | Don't debug graphics operations. |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Constructs a new debug graphics context that supports slowed
down drawing.
| |||||||||||
Constructs a debug graphics context from an existing graphics
context that slows down drawing for the specified component.
| |||||||||||
Constructs a debug graphics context from an existing graphics
context that supports slowed down drawing.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Overrides
Graphics.clearRect . | |||||||||||
Overrides
Graphics.clipRect . | |||||||||||
Overrides
Graphics.copyArea . | |||||||||||
Overrides
Graphics.create to return a DebugGraphics object. | |||||||||||
Overrides
Graphics.create to return a DebugGraphics object. | |||||||||||
Overrides
Graphics.dispose . | |||||||||||
Overrides
Graphics.draw3DRect . | |||||||||||
Overrides
Graphics.drawArc . | |||||||||||
Overrides
Graphics.drawBytes . | |||||||||||
Overrides
Graphics.drawChars . | |||||||||||
Overrides
Graphics.drawImage . | |||||||||||
Overrides
Graphics.drawImage . | |||||||||||
Overrides
Graphics.drawImage . | |||||||||||
Overrides
Graphics.drawImage . | |||||||||||
Overrides
Graphics.drawImage . | |||||||||||
Overrides
Graphics.drawImage . | |||||||||||
Overrides
Graphics.drawLine . | |||||||||||
Overrides
Graphics.drawOval . | |||||||||||
Overrides
Graphics.drawPolygon . | |||||||||||
Overrides
Graphics.drawPolyline . | |||||||||||
Overrides
Graphics.drawRect . | |||||||||||
Overrides
Graphics.drawRoundRect . | |||||||||||
Overrides
Graphics.drawString . | |||||||||||
Overrides
Graphics.drawString . | |||||||||||
Overrides
Graphics.fill3DRect . | |||||||||||
Overrides
Graphics.fillArc . | |||||||||||
Overrides
Graphics.fillOval . | |||||||||||
Overrides
Graphics.fillPolygon . | |||||||||||
Overrides
Graphics.fillRect . | |||||||||||
Overrides
Graphics.fillRoundRect . | |||||||||||
Returns the Color used to flash drawing operations.
| |||||||||||
Returns the number of times that drawing operations will flash.
| |||||||||||
Returns the time delay of drawing operation flashing.
| |||||||||||
Overrides
Graphics.getClip . | |||||||||||
Overrides
Graphics.getClipBounds . | |||||||||||
Returns the Color used for text drawing operations.
| |||||||||||
Returns the current debugging options for this DebugGraphics.
| |||||||||||
Returns the Font used for text drawing operations.
| |||||||||||
Overrides
Graphics.getFontMetrics . | |||||||||||
Overrides
Graphics.getFontMetrics . | |||||||||||
Returns the drawingBuffer value.
| |||||||||||
Returns the stream to which the DebugGraphics logs drawing operations.
| |||||||||||
Overrides
Graphics.setClip . | |||||||||||
Overrides
Graphics.setClip . | |||||||||||
Sets the color to be used for drawing and filling lines and shapes.
| |||||||||||
Enables/disables diagnostic information about every graphics
operation.
| |||||||||||
Sets the Color used to flash drawing operations.
| |||||||||||
Sets the number of times that drawing operations will flash.
| |||||||||||
Sets the time delay of drawing operation flashing.
| |||||||||||
Sets the Font used for text drawing operations.
| |||||||||||
Sets the stream to which the DebugGraphics logs drawing operations.
| |||||||||||
Overrides
Graphics.setPaintMode . | |||||||||||
Overrides
Graphics.setXORMode . | |||||||||||
Overrides
Graphics.translate . |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() |
Show buffered operations in a separate Frame
.
Flash graphics operations.
Log graphics operations.
Don't debug graphics operations.
Constructs a new debug graphics context that supports slowed down drawing.
Constructs a debug graphics context from an existing graphics context that slows down drawing for the specified component.
graphics | the Graphics context to slow down |
---|---|
component | the JComponent to draw slowly |
Constructs a debug graphics context from an existing graphics context that supports slowed down drawing.
graphics | the Graphics context to slow down |
---|
Overrides Graphics.clearRect
.
x | the x coordinate of the rectangle to clear. |
---|---|
y | the y coordinate of the rectangle to clear. |
width | the width of the rectangle to clear. |
height | the height of the rectangle to clear. |
Overrides Graphics.clipRect
.
x | the x coordinate of the rectangle to intersect the clip with |
---|---|
y | the y coordinate of the rectangle to intersect the clip with |
width | the width of the rectangle to intersect the clip with |
height | the height of the rectangle to intersect the clip with |
Overrides Graphics.copyArea
.
x | the x coordinate of the source rectangle. |
---|---|
y | the y coordinate of the source rectangle. |
width | the width of the source rectangle. |
height | the height of the source rectangle. |
destX | the horizontal distance to copy the pixels. |
destY | the vertical distance to copy the pixels. |
Overrides Graphics.create
to return a DebugGraphics object.
x | the x coordinate. |
---|---|
y | the y coordinate. |
width | the width of the clipping rectangle. |
height | the height of the clipping rectangle. |
Overrides Graphics.create
to return a DebugGraphics object.
Overrides Graphics.dispose
.
Overrides Graphics.draw3DRect
.
x | the x coordinate of the rectangle to be drawn. |
---|---|
y | the y coordinate of the rectangle to be drawn. |
width | the width of the rectangle to be drawn. |
height | the height of the rectangle to be drawn. |
raised | a boolean that determines whether the rectangle appears to be raised above the surface or sunk into the surface. |
Overrides Graphics.drawArc
.
x | the x coordinate of the upper-left corner of the arc to be drawn. |
---|---|
y | the y coordinate of the upper-left corner of the arc to be drawn. |
width | the width of the arc to be drawn. |
height | the height of the arc to be drawn. |
startAngle | the beginning angle. |
arcAngle | the angular extent of the arc, relative to the start angle. |
Overrides Graphics.drawBytes
.
data | the data to be drawn |
---|---|
offset | the start offset in the data |
length | the number of bytes that are drawn |
x | the x coordinate of the baseline of the text |
y | the y coordinate of the baseline of the text |
Overrides Graphics.drawChars
.
data | the array of characters to be drawn |
---|---|
offset | the start offset in the data |
length | the number of characters to be drawn |
x | the x coordinate of the baseline of the text |
y | the y coordinate of the baseline of the text |
Overrides Graphics.drawImage
.
img | the specified image to be drawn. This method does
nothing if img is null. |
---|---|
x | the x coordinate. |
y | the y coordinate. |
width | the width of the rectangle. |
height | the height of the rectangle. |
bgcolor | the background color to paint under the non-opaque portions of the image. |
observer | object to be notified as more of the image is converted. |
false
if the image pixels are still changing;
true
otherwise.Overrides Graphics.drawImage
.
img | the specified image to be drawn. This method does
nothing if img is null. |
---|---|
dx1 | the x coordinate of the first corner of the destination rectangle. |
dy1 | the y coordinate of the first corner of the destination rectangle. |
dx2 | the x coordinate of the second corner of the destination rectangle. |
dy2 | the y coordinate of the second corner of the destination rectangle. |
sx1 | the x coordinate of the first corner of the source rectangle. |
sy1 | the y coordinate of the first corner of the source rectangle. |
sx2 | the x coordinate of the second corner of the source rectangle. |
sy2 | the y coordinate of the second corner of the source rectangle. |
bgcolor | the background color to paint under the non-opaque portions of the image. |
observer | object to be notified as more of the image is scaled and converted. |
false
if the image pixels are still changing;
true
otherwise.Overrides Graphics.drawImage
.
img | the specified image to be drawn. This method does
nothing if img is null. |
---|---|
x | the x coordinate. |
y | the y coordinate. |
bgcolor | the background color to paint under the non-opaque portions of the image. |
observer | object to be notified as more of the image is converted. |
false
if the image pixels are still changing;
true
otherwise.Overrides Graphics.drawImage
.
img | the specified image to be drawn. This method does
nothing if img is null. |
---|---|
x | the x coordinate. |
y | the y coordinate. |
observer | object to be notified as more of the image is converted. |
false
if the image pixels are still changing;
true
otherwise.Overrides Graphics.drawImage
.
img | the specified image to be drawn. This method does
nothing if img is null. |
---|---|
x | the x coordinate. |
y | the y coordinate. |
width | the width of the rectangle. |
height | the height of the rectangle. |
observer | object to be notified as more of the image is converted. |
false
if the image pixels are still changing;
true
otherwise.Overrides Graphics.drawImage
.
img | the specified image to be drawn. This method does
nothing if img is null. |
---|---|
dx1 | the x coordinate of the first corner of the destination rectangle. |
dy1 | the y coordinate of the first corner of the destination rectangle. |
dx2 | the x coordinate of the second corner of the destination rectangle. |
dy2 | the y coordinate of the second corner of the destination rectangle. |
sx1 | the x coordinate of the first corner of the source rectangle. |
sy1 | the y coordinate of the first corner of the source rectangle. |
sx2 | the x coordinate of the second corner of the source rectangle. |
sy2 | the y coordinate of the second corner of the source rectangle. |
observer | object to be notified as more of the image is scaled and converted. |
false
if the image pixels are still changing;
true
otherwise.Overrides Graphics.drawLine
.
x1 | the first point's x coordinate. |
---|---|
y1 | the first point's y coordinate. |
x2 | the second point's x coordinate. |
y2 | the second point's y coordinate. |
Overrides Graphics.drawOval
.
x | the x coordinate of the upper left corner of the oval to be drawn. |
---|---|
y | the y coordinate of the upper left corner of the oval to be drawn. |
width | the width of the oval to be drawn. |
height | the height of the oval to be drawn. |
Overrides Graphics.drawPolygon
.
xPoints | a an array of x coordinates. |
---|---|
yPoints | a an array of y coordinates. |
nPoints | a the total number of points. |
Overrides Graphics.drawPolyline
.
xPoints | an array of x points |
---|---|
yPoints | an array of y points |
nPoints | the total number of points |
Overrides Graphics.drawRect
.
x | the x coordinate of the rectangle to be drawn. |
---|---|
y | the y coordinate of the rectangle to be drawn. |
width | the width of the rectangle to be drawn. |
height | the height of the rectangle to be drawn. |
Overrides Graphics.drawRoundRect
.
x | the x coordinate of the rectangle to be drawn. |
---|---|
y | the y coordinate of the rectangle to be drawn. |
width | the width of the rectangle to be drawn. |
height | the height of the rectangle to be drawn. |
arcWidth | the horizontal diameter of the arc at the four corners. |
arcHeight | the vertical diameter of the arc at the four corners. |
Overrides Graphics.drawString
.
aString | the string to be drawn. |
---|---|
x | the x coordinate. |
y | the y coordinate. |
Overrides Graphics.drawString
.
iterator | the iterator whose text is to be drawn |
---|---|
x | the x coordinate. |
y | the y coordinate. |
Overrides Graphics.fill3DRect
.
x | the x coordinate of the rectangle to be filled. |
---|---|
y | the y coordinate of the rectangle to be filled. |
width | the width of the rectangle to be filled. |
height | the height of the rectangle to be filled. |
raised | a boolean value that determines whether the rectangle appears to be raised above the surface or etched into the surface. |
Overrides Graphics.fillArc
.
x | the x coordinate of the upper-left corner of the arc to be filled. |
---|---|
y | the y coordinate of the upper-left corner of the arc to be filled. |
width | the width of the arc to be filled. |
height | the height of the arc to be filled. |
startAngle | the beginning angle. |
arcAngle | the angular extent of the arc, relative to the start angle. |
Overrides Graphics.fillOval
.
x | the x coordinate of the upper left corner of the oval to be filled. |
---|---|
y | the y coordinate of the upper left corner of the oval to be filled. |
width | the width of the oval to be filled. |
height | the height of the oval to be filled. |
Overrides Graphics.fillPolygon
.
xPoints | a an array of x coordinates. |
---|---|
yPoints | a an array of y coordinates. |
nPoints | a the total number of points. |
Overrides Graphics.fillRect
.
x | the x coordinate of the rectangle to be filled. |
---|---|
y | the y coordinate of the rectangle to be filled. |
width | the width of the rectangle to be filled. |
height | the height of the rectangle to be filled. |
Overrides Graphics.fillRoundRect
.
x | the x coordinate of the rectangle to be filled. |
---|---|
y | the y coordinate of the rectangle to be filled. |
width | the width of the rectangle to be filled. |
height | the height of the rectangle to be filled. |
arcWidth | the horizontal diameter of the arc at the four corners. |
arcHeight | the vertical diameter of the arc at the four corners. |
Returns the number of times that drawing operations will flash.
Returns the time delay of drawing operation flashing.
Overrides Graphics.getClip
.
Shape
object representing the
current clipping area, or null
if
no clip is set.Overrides Graphics.getClipBounds
.
null
if no clip is set.Returns the Color used for text drawing operations.
Returns the current debugging options for this DebugGraphics.
Returns the Font used for text drawing operations.
Overrides Graphics.getFontMetrics
.
f | the specified font |
---|
Overrides Graphics.getFontMetrics
.
Returns the drawingBuffer value.
Returns the stream to which the DebugGraphics logs drawing operations.
Overrides Graphics.setClip
.
clip | the Shape to use to set the clip |
---|
Overrides Graphics.setClip
.
x | the x coordinate of the new clip rectangle. |
---|---|
y | the y coordinate of the new clip rectangle. |
width | the width of the new clip rectangle. |
height | the height of the new clip rectangle. |
Sets the color to be used for drawing and filling lines and shapes.
aColor | the new rendering color. |
---|
Enables/disables diagnostic information about every graphics operation. The value of options indicates how this information should be displayed. LOG_OPTION causes a text message to be printed. FLASH_OPTION causes the drawing to flash several times. BUFFERED_OPTION creates a new Frame that shows each operation on an offscreen buffer. The value of options is bitwise OR'd into the current value. To disable debugging use NONE_OPTION.
Sets the Color used to flash drawing operations.
Sets the number of times that drawing operations will flash.
Sets the time delay of drawing operation flashing.
Sets the Font used for text drawing operations.
aFont | the font. |
---|
Sets the stream to which the DebugGraphics logs drawing operations.
Overrides Graphics.setPaintMode
.
Overrides Graphics.setXORMode
.
aColor | the XOR alternation color |
---|
Overrides Graphics.translate
.
x | the x coordinate. |
---|---|
y | the y coordinate. |