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