| java.lang.Object java.awt.Graphics javax.swing.DebugGraphics
DebugGraphics | public class DebugGraphics extends Graphics (Code) | | 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);
See Also: JComponent.setDebugGraphicsOptions See Also: RepaintManager.currentManager See Also: RepaintManager.setDoubleBufferingEnabled version: 1.33 05/05/07 author: Dave Karlton |
Constructor Summary | |
public | DebugGraphics() Constructs a new debug graphics context that supports slowed
down drawing. | public | DebugGraphics(Graphics graphics, JComponent component) Constructs a debug graphics context from an existing graphics
context that slows down drawing for the specified component. | public | DebugGraphics(Graphics graphics) Constructs a debug graphics context from an existing graphics
context that supports slowed down drawing. |
Method Summary | |
public void | clearRect(int x, int y, int width, int height) Overrides Graphics.clearRect . | public void | clipRect(int x, int y, int width, int height) Overrides Graphics.clipRect . | public void | copyArea(int x, int y, int width, int height, int destX, int destY) Overrides Graphics.copyArea . | public Graphics | create() Overrides Graphics.create to return a DebugGraphics object. | public Graphics | create(int x, int y, int width, int height) Overrides Graphics.create to return a DebugGraphics object. | boolean | debugBuffered() | static int | debugComponentCount() Returns the number of JComponents that have debugging options turned
on. | boolean | debugFlash() | boolean | debugLog() | public void | dispose() Overrides Graphics.dispose . | public void | draw3DRect(int x, int y, int width, int height, boolean raised) Overrides Graphics.draw3DRect . | public void | drawArc(int x, int y, int width, int height, int startAngle, int arcAngle) Overrides Graphics.drawArc . | public void | drawBytes(byte data, int offset, int length, int x, int y) Overrides Graphics.drawBytes . | public void | drawChars(char data, int offset, int length, int x, int y) Overrides Graphics.drawChars . | public boolean | drawImage(Image img, int x, int y, ImageObserver observer) Overrides Graphics.drawImage . | public boolean | drawImage(Image img, int x, int y, int width, int height, ImageObserver observer) Overrides Graphics.drawImage . | public boolean | drawImage(Image img, int x, int y, Color bgcolor, ImageObserver observer) Overrides Graphics.drawImage . | public boolean | drawImage(Image img, int x, int y, int width, int height, Color bgcolor, ImageObserver observer) Overrides 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) Overrides 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) Overrides Graphics.drawImage . | public void | drawLine(int x1, int y1, int x2, int y2) Overrides Graphics.drawLine . | public void | drawOval(int x, int y, int width, int height) Overrides Graphics.drawOval . | public void | drawPolygon(int xPoints, int yPoints, int nPoints) Overrides Graphics.drawPolygon . | public void | drawPolyline(int xPoints, int yPoints, int nPoints) Overrides Graphics.drawPolyline . | public void | drawRect(int x, int y, int width, int height) Overrides Graphics.drawRect . | public void | drawRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight) Overrides Graphics.drawRoundRect . | public void | drawString(String aString, int x, int y) Overrides Graphics.drawString . | public void | drawString(AttributedCharacterIterator iterator, int x, int y) Overrides Graphics.drawString . | public void | fill3DRect(int x, int y, int width, int height, boolean raised) Overrides Graphics.fill3DRect . | public void | fillArc(int x, int y, int width, int height, int startAngle, int arcAngle) Overrides Graphics.fillArc . | public void | fillOval(int x, int y, int width, int height) Overrides Graphics.fillOval . | public void | fillPolygon(int xPoints, int yPoints, int nPoints) Overrides Graphics.fillPolygon . | public void | fillRect(int x, int y, int width, int height) Overrides Graphics.fillRect . | public void | fillRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight) Overrides Graphics.fillRoundRect . | public static Color | flashColor() Returns the Color used to flash drawing operations. | public static int | flashCount() Returns the number of times that drawing operations will flash. | public static int | flashTime() Returns the time delay of drawing operation flashing. | public Shape | getClip() Overrides Graphics.getClip . | public Rectangle | getClipBounds() Overrides Graphics.getClipBounds . | public Color | getColor() Returns the Color used for text drawing operations. | public int | getDebugOptions() Returns the current debugging options for this DebugGraphics. | static int | getDebugOptions(JComponent component) Static wrapper method for DebugGraphicsInfo.getDebugOptions(). | public Font | getFont() Returns the Font used for text drawing operations. | public FontMetrics | getFontMetrics() Overrides Graphics.getFontMetrics . | public FontMetrics | getFontMetrics(Font f) Overrides Graphics.getFontMetrics . | static DebugGraphicsInfo | info() Returns DebugGraphicsInfo, or creates one if none exists. | public boolean | isDrawingBuffer() Returns the drawingBuffer value. | static void | loadImage(Image img) | public static java.io.PrintStream | logStream() Returns the stream to which the DebugGraphics logs drawing operations. | String | pointToString(int x, int y) | public void | setClip(int x, int y, int width, int height) Overrides Graphics.setClip . | public void | setClip(Shape clip) Overrides Graphics.setClip . | public void | setColor(Color aColor) Sets the color to be used for drawing and filling lines and shapes. | public void | setDebugOptions(int options) Enables/disables diagnostic information about every graphics
operation. | static void | setDebugOptions(JComponent component, int options) Static wrapper method for DebugGraphicsInfo.setDebugOptions(). | public static void | setFlashColor(Color flashColor) Sets the Color used to flash drawing operations. | public static void | setFlashCount(int flashCount) Sets the number of times that drawing operations will flash. | public static void | setFlashTime(int flashTime) Sets the time delay of drawing operation flashing. | public void | setFont(Font aFont) Sets the Font used for text drawing operations. | public static void | setLogStream(java.io.PrintStream stream) Sets the stream to which the DebugGraphics logs drawing operations. | public void | setPaintMode() Overrides Graphics.setPaintMode . | public void | setXORMode(Color aColor) Overrides Graphics.setXORMode . | static int | shouldComponentDebug(JComponent component) Returns non-zero if component should display with DebugGraphics,
zero otherwise. | final void | sleep(int mSecs) | String | toShortString() | public void | translate(int x, int y) Overrides Graphics.translate . |
BUFFERED_OPTION | final public static int BUFFERED_OPTION(Code) | | Show buffered operations in a separate Frame .
|
FLASH_OPTION | final public static int FLASH_OPTION(Code) | | Flash graphics operations.
|
LOG_OPTION | final public static int LOG_OPTION(Code) | | Log graphics operations.
|
NONE_OPTION | final public static int NONE_OPTION(Code) | | Don't debug graphics operations.
|
debugOptions | int debugOptions(Code) | | |
graphicsID | int graphicsID(Code) | | |
xOffsetyOffset | int xOffsetyOffset(Code) | | |
DebugGraphics | public DebugGraphics()(Code) | | Constructs a new debug graphics context that supports slowed
down drawing.
|
DebugGraphics | public DebugGraphics(Graphics graphics, JComponent component)(Code) | | Constructs a debug graphics context from an existing graphics
context that slows down drawing for the specified component.
Parameters: graphics - the Graphics context to slow down Parameters: component - the JComponent to draw slowly |
DebugGraphics | public DebugGraphics(Graphics graphics)(Code) | | Constructs a debug graphics context from an existing graphics
context that supports slowed down drawing.
Parameters: graphics - the Graphics context to slow down |
clearRect | public void clearRect(int x, int y, int width, int height)(Code) | | Overrides Graphics.clearRect .
|
clipRect | public void clipRect(int x, int y, int width, int height)(Code) | | Overrides Graphics.clipRect .
|
copyArea | public void copyArea(int x, int y, int width, int height, int destX, int destY)(Code) | | Overrides Graphics.copyArea .
|
create | public Graphics create()(Code) | | Overrides Graphics.create to return a DebugGraphics object.
|
create | public Graphics create(int x, int y, int width, int height)(Code) | | Overrides Graphics.create to return a DebugGraphics object.
|
debugBuffered | boolean debugBuffered()(Code) | | |
debugComponentCount | static int debugComponentCount()(Code) | | Returns the number of JComponents that have debugging options turned
on.
|
debugFlash | boolean debugFlash()(Code) | | |
debugLog | boolean debugLog()(Code) | | |
dispose | public void dispose()(Code) | | Overrides Graphics.dispose .
|
draw3DRect | public void draw3DRect(int x, int y, int width, int height, boolean raised)(Code) | | Overrides Graphics.draw3DRect .
|
drawArc | public void drawArc(int x, int y, int width, int height, int startAngle, int arcAngle)(Code) | | Overrides Graphics.drawArc .
|
drawBytes | public void drawBytes(byte data, int offset, int length, int x, int y)(Code) | | Overrides Graphics.drawBytes .
|
drawChars | public void drawChars(char data, int offset, int length, int x, int y)(Code) | | Overrides Graphics.drawChars .
|
drawImage | public boolean drawImage(Image img, int x, int y, int width, int height, ImageObserver observer)(Code) | | Overrides Graphics.drawImage .
|
drawImage | public boolean drawImage(Image img, int x, int y, int width, int height, Color bgcolor, ImageObserver observer)(Code) | | Overrides Graphics.drawImage .
|
drawImage | public boolean drawImage(Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, ImageObserver observer)(Code) | | Overrides Graphics.drawImage .
|
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)(Code) | | Overrides Graphics.drawImage .
|
drawLine | public void drawLine(int x1, int y1, int x2, int y2)(Code) | | Overrides Graphics.drawLine .
|
drawOval | public void drawOval(int x, int y, int width, int height)(Code) | | Overrides Graphics.drawOval .
|
drawPolygon | public void drawPolygon(int xPoints, int yPoints, int nPoints)(Code) | | Overrides Graphics.drawPolygon .
|
drawPolyline | public void drawPolyline(int xPoints, int yPoints, int nPoints)(Code) | | Overrides Graphics.drawPolyline .
|
drawRect | public void drawRect(int x, int y, int width, int height)(Code) | | Overrides Graphics.drawRect .
|
drawRoundRect | public void drawRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight)(Code) | | Overrides Graphics.drawRoundRect .
|
drawString | public void drawString(String aString, int x, int y)(Code) | | Overrides Graphics.drawString .
|
fill3DRect | public void fill3DRect(int x, int y, int width, int height, boolean raised)(Code) | | Overrides Graphics.fill3DRect .
|
fillArc | public void fillArc(int x, int y, int width, int height, int startAngle, int arcAngle)(Code) | | Overrides Graphics.fillArc .
|
fillOval | public void fillOval(int x, int y, int width, int height)(Code) | | Overrides Graphics.fillOval .
|
fillPolygon | public void fillPolygon(int xPoints, int yPoints, int nPoints)(Code) | | Overrides Graphics.fillPolygon .
|
fillRect | public void fillRect(int x, int y, int width, int height)(Code) | | Overrides Graphics.fillRect .
|
fillRoundRect | public void fillRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight)(Code) | | Overrides Graphics.fillRoundRect .
|
getClip | public Shape getClip()(Code) | | Overrides Graphics.getClip .
|
getClipBounds | public Rectangle getClipBounds()(Code) | | Overrides Graphics.getClipBounds .
|
getDebugOptions | static int getDebugOptions(JComponent component)(Code) | | Static wrapper method for DebugGraphicsInfo.getDebugOptions().
|
getFontMetrics | public FontMetrics getFontMetrics()(Code) | | Overrides Graphics.getFontMetrics .
|
isDrawingBuffer | public boolean isDrawingBuffer()(Code) | | Returns the drawingBuffer value.
true if this object is drawing from a Buffer |
setClip | public void setClip(int x, int y, int width, int height)(Code) | | Overrides Graphics.setClip .
|
setClip | public void setClip(Shape clip)(Code) | | Overrides Graphics.setClip .
|
setColor | public void setColor(Color aColor)(Code) | | Sets the color to be used for drawing and filling lines and shapes.
|
setDebugOptions | public void setDebugOptions(int options)(Code) | | 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.
|
setDebugOptions | static void setDebugOptions(JComponent component, int options)(Code) | | Static wrapper method for DebugGraphicsInfo.setDebugOptions(). Stores
options on a per component basis.
|
setFlashColor | public static void setFlashColor(Color flashColor)(Code) | | Sets the Color used to flash drawing operations.
|
setFlashCount | public static void setFlashCount(int flashCount)(Code) | | Sets the number of times that drawing operations will flash.
|
setFlashTime | public static void setFlashTime(int flashTime)(Code) | | Sets the time delay of drawing operation flashing.
|
setFont | public void setFont(Font aFont)(Code) | | Sets the Font used for text drawing operations.
|
setLogStream | public static void setLogStream(java.io.PrintStream stream)(Code) | | Sets the stream to which the DebugGraphics logs drawing operations.
|
setPaintMode | public void setPaintMode()(Code) | | Overrides Graphics.setPaintMode .
|
setXORMode | public void setXORMode(Color aColor)(Code) | | Overrides Graphics.setXORMode .
|
shouldComponentDebug | static int shouldComponentDebug(JComponent component)(Code) | | Returns non-zero if component should display with DebugGraphics,
zero otherwise. Walks the JComponent's parent tree to determine if
any debugging options have been set.
|
sleep | final void sleep(int mSecs)(Code) | | |
translate | public void translate(int x, int y)(Code) | | Overrides Graphics.translate .
|
Methods inherited from java.awt.Graphics | abstract public void clearRect(int x, int y, int width, int height)(Code)(Java Doc) abstract public void clipRect(int x, int y, int width, int height)(Code)(Java Doc) abstract public void copyArea(int x, int y, int width, int height, int dx, int dy)(Code)(Java Doc) abstract public Graphics create()(Code)(Java Doc) public Graphics create(int x, int y, int width, int height)(Code)(Java Doc) abstract public void dispose()(Code)(Java Doc) public void draw3DRect(int x, int y, int width, int height, boolean raised)(Code)(Java Doc) abstract public void drawArc(int x, int y, int width, int height, int startAngle, int arcAngle)(Code)(Java Doc) public void drawBytes(byte data, int offset, int length, int x, int y)(Code)(Java Doc) public void drawChars(char data, int offset, int length, int x, int y)(Code)(Java Doc) abstract public boolean drawImage(Image img, int x, int y, ImageObserver observer)(Code)(Java Doc) abstract public boolean drawImage(Image img, int x, int y, int width, int height, ImageObserver observer)(Code)(Java Doc) abstract public boolean drawImage(Image img, int x, int y, Color bgcolor, ImageObserver observer)(Code)(Java Doc) abstract public boolean drawImage(Image img, int x, int y, int width, int height, Color bgcolor, ImageObserver observer)(Code)(Java Doc) abstract public boolean drawImage(Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, ImageObserver observer)(Code)(Java Doc) abstract 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)(Code)(Java Doc) abstract public void drawLine(int x1, int y1, int x2, int y2)(Code)(Java Doc) abstract public void drawOval(int x, int y, int width, int height)(Code)(Java Doc) abstract public void drawPolygon(int xPoints, int yPoints, int nPoints)(Code)(Java Doc) public void drawPolygon(Polygon p)(Code)(Java Doc) abstract public void drawPolyline(int xPoints, int yPoints, int nPoints)(Code)(Java Doc) public void drawRect(int x, int y, int width, int height)(Code)(Java Doc) abstract public void drawRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight)(Code)(Java Doc) abstract public void drawString(String str, int x, int y)(Code)(Java Doc) abstract public void drawString(AttributedCharacterIterator iterator, int x, int y)(Code)(Java Doc) public void fill3DRect(int x, int y, int width, int height, boolean raised)(Code)(Java Doc) abstract public void fillArc(int x, int y, int width, int height, int startAngle, int arcAngle)(Code)(Java Doc) abstract public void fillOval(int x, int y, int width, int height)(Code)(Java Doc) abstract public void fillPolygon(int xPoints, int yPoints, int nPoints)(Code)(Java Doc) public void fillPolygon(Polygon p)(Code)(Java Doc) abstract public void fillRect(int x, int y, int width, int height)(Code)(Java Doc) abstract public void fillRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight)(Code)(Java Doc) public void finalize()(Code)(Java Doc) abstract public Shape getClip()(Code)(Java Doc) abstract public Rectangle getClipBounds()(Code)(Java Doc) public Rectangle getClipBounds(Rectangle r)(Code)(Java Doc) public Rectangle getClipRect()(Code)(Java Doc) abstract public Color getColor()(Code)(Java Doc) abstract public Font getFont()(Code)(Java Doc) public FontMetrics getFontMetrics()(Code)(Java Doc) abstract public FontMetrics getFontMetrics(Font f)(Code)(Java Doc) public boolean hitClip(int x, int y, int width, int height)(Code)(Java Doc) abstract public void setClip(int x, int y, int width, int height)(Code)(Java Doc) abstract public void setClip(Shape clip)(Code)(Java Doc) abstract public void setColor(Color c)(Code)(Java Doc) abstract public void setFont(Font font)(Code)(Java Doc) abstract public void setPaintMode()(Code)(Java Doc) abstract public void setXORMode(Color c1)(Code)(Java Doc) public String toString()(Code)(Java Doc) abstract public void translate(int x, int y)(Code)(Java Doc)
|
|
|