| |||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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 | |
---|---|
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 | |
---|---|
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 | |
---|---|
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 x, int y, Color bgcolor, ImageObserver observer) Overrides Graphics.drawImage .
|
boolean |
drawImage(Image img, int x, int y, ImageObserver observer) Overrides Graphics.drawImage .
|
boolean |
drawImage(Image img, int x, int y, int width, int height, Color bgcolor, ImageObserver observer) Overrides Graphics.drawImage .
|
boolean |
drawImage(Image img, int x, int y, int width, int height, ImageObserver observer) Overrides Graphics.drawImage .
|
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(Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, ImageObserver observer) Overrides Graphics.drawImage .
|
void |
drawLine(int x1, int y1, int x2, int y2) Overrides Graphics.drawLine .
|
void |
drawOval(int x, int y, int width, int height) Overrides Graphics.drawOval .
|
void |
drawPolygon(int[] xPoints, int[] yPoints, int nPoints) Overrides Graphics.drawPolygon .
|
void |
drawPolyline(int[] xPoints, int[] yPoints, int nPoints) Overrides Graphics.drawPolyline .
|
void |
drawRect(int x, int y, int width, int height) Overrides Graphics.drawRect .
|
void |
drawRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight) Overrides Graphics.drawRoundRect .
|
void |
drawString(AttributedCharacterIterator iterator, int x, int y) Overrides Graphics.drawString .
|
void |
drawString(String aString, int x, int y) Overrides Graphics.drawString .
|
void |
fill3DRect(int x, int y, int width, int height, boolean raised) Overrides Graphics.fill3DRect .
|
void |
fillArc(int x, int y, int width, int height, int startAngle, int arcAngle) Overrides Graphics.fillArc .
|
void |
fillOval(int x, int y, int width, int height) Overrides Graphics.fillOval .
|
void |
fillPolygon(int[] xPoints, int[] yPoints, int nPoints) Overrides Graphics.fillPolygon .
|
void |
fillRect(int x, int y, int width, int height) Overrides Graphics.fillRect .
|
void |
fillRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight) Overrides Graphics.fillRoundRect .
|
static Color |
Returns the Color used to flash drawing operations. |
static int |
Returns the number of times that drawing operations will flash. |
static int |
Returns the time delay of drawing operation flashing. |
Shape |
getClip() Overrides Graphics.getClip .
|
Rectangle |
Overrides Graphics.getClipBounds .
|
Color |
getColor() Returns the Color used for text drawing operations. |
int |
Returns the current debugging options for this DebugGraphics. |
Font |
getFont() Returns the Font used for text drawing operations. |
FontMetrics |
Overrides Graphics.getFontMetrics .
|
FontMetrics |
Overrides Graphics.getFontMetrics .
|
boolean |
Returns the drawingBuffer value. |
static PrintStream |
Returns the stream to which the DebugGraphics logs drawing operations. |
void |
setClip(int x, int y, int width, int height) Overrides Graphics.setClip .
|
void |
Overrides Graphics.setClip .
|
void |
Sets the color to be used for drawing and filling lines and shapes. |
void |
setDebugOptions(int options) Enables/disables diagnostic information about every graphics operation. |
static void |
setFlashColor(Color flashColor) Sets the Color used to flash drawing operations. |
static void |
setFlashCount(int flashCount) Sets the number of times that drawing operations will flash. |
static void |
setFlashTime(int flashTime) Sets the time delay of drawing operation flashing. |
void |
Sets the Font used for text drawing operations. |
static void |
setLogStream(PrintStream stream) Sets the stream to which the DebugGraphics logs drawing operations. |
void |
Overrides Graphics.setPaintMode .
|
void |
setXORMode(Color aColor) Overrides Graphics.setXORMode .
|
void |
translate(int x, int y) Overrides Graphics.translate .
|
Methods inherited from class java.awt.Graphics |
---|
clearRect, clipRect, copyArea, create, create, dispose, draw3DRect, drawArc, drawBytes, drawChars, drawImage, drawImage, drawImage, drawImage, drawImage, drawImage, drawLine, drawOval, drawPolygon, drawPolygon, drawPolyline, drawRect, drawRoundRect, drawString, drawString, fill3DRect, fillArc, fillOval, fillPolygon, fillPolygon, fillRect, fillRoundRect, finalize, getClip, getClipBounds, getClipBounds, getClipRect, getColor, getFont, getFontMetrics, getFontMetrics, hitClip, setClip, setClip, setColor, setFont, setPaintMode, setXORMode, toString, translate |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int BUFFERED_OPTION
Frame
.
public static final int FLASH_OPTION
public static final int LOG_OPTION
public static final int NONE_OPTION
Constructor Detail |
---|
public DebugGraphics()
public DebugGraphics(Graphics graphics)
graphics
- the Graphics context to slow downpublic DebugGraphics(Graphics graphics, JComponent component)
graphics
- the Graphics context to slow downcomponent
- the JComponent to draw slowlyMethod Detail |
---|
public void clearRect(int x, int y, int width, int height)
Graphics.clearRect
.
clearRect
in class Graphics
x
y
width
height
public void clipRect(int x, int y, int width, int height)
Graphics.clipRect
.
clipRect
in class Graphics
x
y
width
height
public void copyArea(int x, int y, int width, int height, int destX, int destY)
Graphics.copyArea
.
copyArea
in class Graphics
x
y
width
height
destX
destY
public Graphics create()
Graphics.create
to return a DebugGraphics object.
create
in class Graphics
public Graphics create(int x, int y, int width, int height)
Graphics.create
to return a DebugGraphics object.
create
in class Graphics
x
y
width
height
public void dispose()
Graphics.dispose
.
dispose
in class Graphics
public void draw3DRect(int x, int y, int width, int height, boolean raised)
Graphics.draw3DRect
.
draw3DRect
in class Graphics
x
y
width
height
raised
public void drawArc(int x, int y, int width, int height, int startAngle, int arcAngle)
Graphics.drawArc
.
drawArc
in class Graphics
x
y
width
height
startAngle
arcAngle
public void drawBytes(byte[] data, int offset, int length, int x, int y)
Graphics.drawBytes
.
drawBytes
in class Graphics
data
offset
length
x
y
public void drawChars(char[] data, int offset, int length, int x, int y)
Graphics.drawChars
.
drawChars
in class Graphics
data
offset
length
x
y
public boolean drawImage(Image img, int x, int y, Color bgcolor, ImageObserver observer)
Graphics.drawImage
.
drawImage
in class Graphics
img
x
y
bgcolor
observer
public boolean drawImage(Image img, int x, int y, ImageObserver observer)
Graphics.drawImage
.
drawImage
in class Graphics
img
x
y
observer
public boolean drawImage(Image img, int x, int y, int width, int height, Color bgcolor, ImageObserver observer)
Graphics.drawImage
.
drawImage
in class Graphics
img
x
y
width
height
bgcolor
observer
public boolean drawImage(Image img, int x, int y, int width, int height, ImageObserver observer)
Graphics.drawImage
.
drawImage
in class Graphics
img
x
y
width
height
observer
public boolean drawImage(Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, Color bgcolor, ImageObserver observer)
Graphics.drawImage
.
drawImage
in class Graphics
img
dx1
dy1
dx2
dy2
sx1
sy1
sx2
sy2
bgcolor
observer
public boolean drawImage(Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, ImageObserver observer)
Graphics.drawImage
.
drawImage
in class Graphics
img
dx1
dy1
dx2
dy2
sx1
sy1
sx2
sy2
observer
public void drawLine(int x1, int y1, int x2, int y2)
Graphics.drawLine
.
drawLine
in class Graphics
x1
y1
x2
y2
public void drawOval(int x, int y, int width, int height)
Graphics.drawOval
.
drawOval
in class Graphics
x
y
width
height
public void drawPolygon(int[] xPoints, int[] yPoints, int nPoints)
Graphics.drawPolygon
.
drawPolygon
in class Graphics
xPoints
yPoints
nPoints
public void drawPolyline(int[] xPoints, int[] yPoints, int nPoints)
Graphics.drawPolyline
.
drawPolyline
in class Graphics
xPoints
yPoints
nPoints
public void drawRect(int x, int y, int width, int height)
Graphics.drawRect
.
drawRect
in class Graphics
x
y
width
height
public void drawRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight)
Graphics.drawRoundRect
.
drawRoundRect
in class Graphics
x
y
width
height
arcWidth
arcHeight
public void drawString(AttributedCharacterIterator iterator, int x, int y)
Graphics.drawString
.
drawString
in class Graphics
iterator
x
y
public void drawString(String aString, int x, int y)
Graphics.drawString
.
drawString
in class Graphics
aString
x
y
public void fill3DRect(int x, int y, int width, int height, boolean raised)
Graphics.fill3DRect
.
fill3DRect
in class Graphics
x
y
width
height
raised
public void fillArc(int x, int y, int width, int height, int startAngle, int arcAngle)
Graphics.fillArc
.
fillArc
in class Graphics
x
y
width
height
startAngle
arcAngle
public void fillOval(int x, int y, int width, int height)
Graphics.fillOval
.
fillOval
in class Graphics
x
y
width
height
public void fillPolygon(int[] xPoints, int[] yPoints, int nPoints)
Graphics.fillPolygon
.
fillPolygon
in class Graphics
xPoints
yPoints
nPoints
public void fillRect(int x, int y, int width, int height)
Graphics.fillRect
.
fillRect
in class Graphics
x
y
width
height
public void fillRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight)
Graphics.fillRoundRect
.
fillRoundRect
in class Graphics
x
y
width
height
arcWidth
arcHeight
public static Color flashColor()
public static int flashCount()
public static int flashTime()
public Shape getClip()
Graphics.getClip
.
getClip
in class Graphics
public Rectangle getClipBounds()
Graphics.getClipBounds
.
getClipBounds
in class Graphics
public Color getColor()
getColor
in class Graphics
public int getDebugOptions()
public Font getFont()
getFont
in class Graphics
public FontMetrics getFontMetrics()
Graphics.getFontMetrics
.
getFontMetrics
in class Graphics
public FontMetrics getFontMetrics(Font f)
Graphics.getFontMetrics
.
getFontMetrics
in class Graphics
f
public boolean isDrawingBuffer()
public static PrintStream logStream()
public void setClip(int x, int y, int width, int height)
Graphics.setClip
.
setClip
in class Graphics
x
y
width
height
public void setClip(Shape clip)
Graphics.setClip
.
setClip
in class Graphics
clip
public void setColor(Color aColor)
setColor
in class Graphics
aColor
public void setDebugOptions(int options)
options
public static void setFlashColor(Color flashColor)
flashColor
public static void setFlashCount(int flashCount)
flashCount
public static void setFlashTime(int flashTime)
flashTime
public void setFont(Font aFont)
setFont
in class Graphics
aFont
public static void setLogStream(PrintStream stream)
stream
public void setPaintMode()
Graphics.setPaintMode
.
setPaintMode
in class Graphics
public void setXORMode(Color aColor)
Graphics.setXORMode
.
setXORMode
in class Graphics
aColor
public void translate(int x, int y)
Graphics.translate
.
translate
in class Graphics
x
y
| |||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |