Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Swing 1.1
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## javax.swing
Class DebugGraphics

    java.lang.Object
      |
      +--java.awt.Graphics
            |
            +--javax.swing.DebugGraphics

public class DebugGraphics
extends java.awt.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);

See Also:
  `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(java.awt.Graphics graphics)` Constructs a debug graphics context from an existing graphics context that supports slowed down drawing.
`DebugGraphics(java.awt.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`.
`java.awt.Graphics` | `create()` Overrides `Graphics.create` to return a DebugGraphics object.
`java.awt.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(java.awt.Image img, int x, int y, java.awt.Color bgcolor, java.awt.image.ImageObserver observer)` Overrides `Graphics.drawImage`.
`boolean` | `drawImage(java.awt.Image img, int x, int y, java.awt.image.ImageObserver observer)` Overrides `Graphics.drawImage`.
`boolean` | `drawImage(java.awt.Image img, int x, int y, int width, int height, java.awt.Color bgcolor, java.awt.image.ImageObserver observer)` Overrides `Graphics.drawImage`.
`boolean` | `drawImage(java.awt.Image img, int x, int y, int width, int height, java.awt.image.ImageObserver observer)` Overrides `Graphics.drawImage`.
`boolean` | `drawImage(java.awt.Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, java.awt.Color bgcolor, java.awt.image.ImageObserver observer)` Overrides `Graphics.drawImage`.
`boolean` | `drawImage(java.awt.Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, java.awt.image.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(java.lang.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 java.awt.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.
`java.awt.Shape` | `getClip()` Overrides `Graphics.getClip`.
`java.awt.Rectangle` | `getClipBounds()` Overrides `Graphics.getClipBounds`.
`java.awt.Color` | `getColor()` Returns the Color used for text drawing operations.
`int` | `getDebugOptions()` Returns the current debugging options for this DebugGraphics.
`java.awt.Font` | `getFont()` Returns the Font used for text drawing operations.
`java.awt.FontMetrics` | `getFontMetrics()` Overrides `Graphics.getFontMetrics`.
`java.awt.FontMetrics` | `getFontMetrics(java.awt.Font f)` Overrides `Graphics.getFontMetrics`.
`boolean` | `isDrawingBuffer()` Returns the drawingBuffer value.
`static java.io.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(java.awt.Shape clip)` Overrides `Graphics.setClip`.
`void` | `setColor(java.awt.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(java.awt.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(java.awt.Font aFont)` Sets the Font used for text drawing operations.
`static void` | `setLogStream(java.io.PrintStream stream)` Sets the stream to which the DebugGraphics logs drawing operations.
`void` | `setPaintMode()` Overrides `Graphics.setPaintMode`.
`void` | `setXORMode(java.awt.Color aColor)` Overrides `Graphics.setXORMode`.
`void` | `translate(int x, int y)` Overrides `Graphics.translate`.

Methods inherited from class java.awt.Graphics
`drawPolygon, fillPolygon, finalize, getClipRect, toString`

Methods inherited from class java.lang.Object
`clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### LOG_OPTION

    public static final int LOG_OPTION

  Log graphics operations.

### FLASH_OPTION

    public static final int FLASH_OPTION

  Flash graphics operations.

### BUFFERED_OPTION

    public static final int BUFFERED_OPTION

  Show buffered operations in a seperate Frame.

### NONE_OPTION

    public static final int NONE_OPTION

  Don't debug graphics operations.

Constructor Detail

### DebugGraphics

    public DebugGraphics()

  Constructs a new debug graphics context that supports slowed down drawing.

### DebugGraphics

    public DebugGraphics(java.awt.Graphics graphics,
                         JComponent component)

  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
    `component` - the JComponent to draw slowly

### DebugGraphics

    public DebugGraphics(java.awt.Graphics graphics)

  Constructs a debug graphics context from an existing graphics context that supports slowed down drawing.
  Parameters:
    `graphics` - the Graphics context to slow down

Method Detail

### create

    public java.awt.Graphics create()

  Overrides `Graphics.create` to return a DebugGraphics object.
  Overrides:
    create in class java.awt.Graphics

### create

    public java.awt.Graphics create(int x,
                                    int y,
                                    int width,
                                    int height)

  Overrides `Graphics.create` to return a DebugGraphics object.
  Overrides:
    create in class java.awt.Graphics

### setFlashColor

    public static void setFlashColor(java.awt.Color flashColor)

  Sets the Color used to flash drawing operations.

### flashColor

    public static java.awt.Color flashColor()

  Returns the Color used to flash drawing operations.
  See Also:
    `setFlashColor(java.awt.Color)`

### setFlashTime

    public static void setFlashTime(int flashTime)

  Sets the time delay of drawing operation flashing.

### flashTime

    public static int flashTime()

  Returns the time delay of drawing operation flashing.
  See Also:
    `setFlashTime(int)`

### setFlashCount

    public static void setFlashCount(int flashCount)

  Sets the number of times that drawing operations will flash.

### flashCount

    public static int flashCount()

  Returns the number of times that drawing operations will flash.
  See Also:
    `setFlashCount(int)`

### setLogStream

    public static void setLogStream(java.io.PrintStream stream)

  Sets the stream to which the DebugGraphics logs drawing operations.

### logStream

    public static java.io.PrintStream logStream()

  Returns the stream to which the DebugGraphics logs drawing operations.
  See Also:
    `setLogStream(java.io.PrintStream)`

### setFont

    public void setFont(java.awt.Font aFont)

  Sets the Font used for text drawing operations.
  Overrides:
    setFont in class java.awt.Graphics

### getFont

    public java.awt.Font getFont()

  Returns the Font used for text drawing operations.
  Overrides:
    getFont in class java.awt.Graphics
  See Also:
    `setFont(java.awt.Font)`

### setColor

    public void setColor(java.awt.Color aColor)

  Sets the color to be used for drawing and filling lines and shapes.
  Overrides:
    setColor in class java.awt.Graphics

### getColor

    public java.awt.Color getColor()

  Returns the Color used for text drawing operations.
  Overrides:
    getColor in class java.awt.Graphics
  See Also:
    `setColor(java.awt.Color)`

### getFontMetrics

    public java.awt.FontMetrics getFontMetrics()

  Overrides `Graphics.getFontMetrics`.
  Overrides:
    getFontMetrics in class java.awt.Graphics

### getFontMetrics

    public java.awt.FontMetrics getFontMetrics(java.awt.Font f)

  Overrides `Graphics.getFontMetrics`.
  Overrides:
    getFontMetrics in class java.awt.Graphics

### translate

    public void translate(int x,
                          int y)

  Overrides `Graphics.translate`.
  Overrides:
    translate in class java.awt.Graphics

### setPaintMode

    public void setPaintMode()

  Overrides `Graphics.setPaintMode`.
  Overrides:
    setPaintMode in class java.awt.Graphics

### setXORMode

    public void setXORMode(java.awt.Color aColor)

  Overrides `Graphics.setXORMode`.
  Overrides:
    setXORMode in class java.awt.Graphics

### getClipBounds

    public java.awt.Rectangle getClipBounds()

  Overrides `Graphics.getClipBounds`.
  Overrides:
    getClipBounds in class java.awt.Graphics

### clipRect

    public void clipRect(int x,
                         int y,
                         int width,
                         int height)

  Overrides `Graphics.clipRect`.
  Overrides:
    clipRect in class java.awt.Graphics

### setClip

    public void setClip(int x,
                        int y,
                        int width,
                        int height)

  Overrides `Graphics.setClip`.
  Overrides:
    setClip in class java.awt.Graphics

### getClip

    public java.awt.Shape getClip()

  Overrides `Graphics.getClip`.
  Overrides:
    getClip in class java.awt.Graphics

### setClip

    public void setClip(java.awt.Shape clip)

  Overrides `Graphics.setClip`.
  Overrides:
    setClip in class java.awt.Graphics

### drawRect

    public void drawRect(int x,
                         int y,
                         int width,
                         int height)

  Overrides `Graphics.drawRect`.
  Overrides:
    drawRect in class java.awt.Graphics

### fillRect

    public void fillRect(int x,
                         int y,
                         int width,
                         int height)

  Overrides `Graphics.fillRect`.
  Overrides:
    fillRect in class java.awt.Graphics

### clearRect

    public void clearRect(int x,
                          int y,
                          int width,
                          int height)

  Overrides `Graphics.clearRect`.
  Overrides:
    clearRect in class java.awt.Graphics

### drawRoundRect

    public void drawRoundRect(int x,
                              int y,
                              int width,
                              int height,
                              int arcWidth,
                              int arcHeight)

  Overrides `Graphics.drawRoundRect`.
  Overrides:
    drawRoundRect in class java.awt.Graphics

### fillRoundRect

    public void fillRoundRect(int x,
                              int y,
                              int width,
                              int height,
                              int arcWidth,
                              int arcHeight)

  Overrides `Graphics.fillRoundRect`.
  Overrides:
    fillRoundRect in class java.awt.Graphics

### drawLine

    public void drawLine(int x1,
                         int y1,
                         int x2,
                         int y2)

  Overrides `Graphics.drawLine`.
  Overrides:
    drawLine in class java.awt.Graphics

### draw3DRect

    public void draw3DRect(int x,
                           int y,
                           int width,
                           int height,
                           boolean raised)

  Overrides `Graphics.draw3DRect`.
  Overrides:
    draw3DRect in class java.awt.Graphics

### fill3DRect

    public void fill3DRect(int x,
                           int y,
                           int width,
                           int height,
                           boolean raised)

  Overrides `Graphics.fill3DRect`.
  Overrides:
    fill3DRect in class java.awt.Graphics

### drawOval

    public void drawOval(int x,
                         int y,
                         int width,
                         int height)

  Overrides `Graphics.drawOval`.
  Overrides:
    drawOval in class java.awt.Graphics

### fillOval

    public void fillOval(int x,
                         int y,
                         int width,
                         int height)

  Overrides `Graphics.fillOval`.
  Overrides:
    fillOval in class java.awt.Graphics

### drawArc

    public void drawArc(int x,
                        int y,
                        int width,
                        int height,
                        int startAngle,
                        int arcAngle)

  Overrides `Graphics.drawArc`.
  Overrides:
    drawArc in class java.awt.Graphics

### fillArc

    public void fillArc(int x,
                        int y,
                        int width,
                        int height,
                        int startAngle,
                        int arcAngle)

  Overrides `Graphics.fillArc`.
  Overrides:
    fillArc in class java.awt.Graphics

### drawPolyline

    public void drawPolyline(int[] xPoints,
                             int[] yPoints,
                             int nPoints)

  Overrides `Graphics.drawPolyline`.
  Overrides:
    drawPolyline in class java.awt.Graphics

### drawPolygon

    public void drawPolygon(int[] xPoints,
                            int[] yPoints,
                            int nPoints)

  Overrides `Graphics.drawPolygon`.
  Overrides:
    drawPolygon in class java.awt.Graphics

### fillPolygon

    public void fillPolygon(int[] xPoints,
                            int[] yPoints,
                            int nPoints)

  Overrides `Graphics.fillPolygon`.
  Overrides:
    fillPolygon in class java.awt.Graphics

### drawString

    public void drawString(java.lang.String aString,
                           int x,
                           int y)

  Overrides `Graphics.drawString`.
  Overrides:
    drawString in class java.awt.Graphics

### drawBytes

    public void drawBytes(byte[] data,
                          int offset,
                          int length,
                          int x,
                          int y)

  Overrides `Graphics.drawBytes`.
  Overrides:
    drawBytes in class java.awt.Graphics

### drawChars

    public void drawChars(char[] data,
                          int offset,
                          int length,
                          int x,
                          int y)

  Overrides `Graphics.drawChars`.
  Overrides:
    drawChars in class java.awt.Graphics

### drawImage

    public boolean drawImage(java.awt.Image img,
                             int x,
                             int y,
                             java.awt.image.ImageObserver observer)

  Overrides `Graphics.drawImage`.
  Overrides:
    drawImage in class java.awt.Graphics

### drawImage

    public boolean drawImage(java.awt.Image img,
                             int x,
                             int y,
                             int width,
                             int height,
                             java.awt.image.ImageObserver observer)

  Overrides `Graphics.drawImage`.
  Overrides:
    drawImage in class java.awt.Graphics

### drawImage

    public boolean drawImage(java.awt.Image img,
                             int x,
                             int y,
                             java.awt.Color bgcolor,
                             java.awt.image.ImageObserver observer)

  Overrides `Graphics.drawImage`.
  Overrides:
    drawImage in class java.awt.Graphics

### drawImage

    public boolean drawImage(java.awt.Image img,
                             int x,
                             int y,
                             int width,
                             int height,
                             java.awt.Color bgcolor,
                             java.awt.image.ImageObserver observer)

  Overrides `Graphics.drawImage`.
  Overrides:
    drawImage in class java.awt.Graphics

### drawImage

    public boolean drawImage(java.awt.Image img,
                             int dx1,
                             int dy1,
                             int dx2,
                             int dy2,
                             int sx1,
                             int sy1,
                             int sx2,
                             int sy2,
                             java.awt.image.ImageObserver observer)

  Overrides `Graphics.drawImage`.
  Overrides:
    drawImage in class java.awt.Graphics

### drawImage

    public boolean drawImage(java.awt.Image img,
                             int dx1,
                             int dy1,
                             int dx2,
                             int dy2,
                             int sx1,
                             int sy1,
                             int sx2,
                             int sy2,
                             java.awt.Color bgcolor,
                             java.awt.image.ImageObserver observer)

  Overrides `Graphics.drawImage`.
  Overrides:
    drawImage in class java.awt.Graphics

### copyArea

    public void copyArea(int x,
                         int y,
                         int width,
                         int height,
                         int destX,
                         int destY)

  Overrides `Graphics.copyArea`.
  Overrides:
    copyArea in class java.awt.Graphics

### dispose

    public void dispose()

  Overrides `Graphics.dispose`.
  Overrides:
    dispose in class java.awt.Graphics

### isDrawingBuffer

    public boolean isDrawingBuffer()

  Returns the drawingBuffer value.
  Returns:
    true if this object is drawing from a Buffer

### setDebugOptions

    public void setDebugOptions(int options)

  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.

### getDebugOptions

    public int getDebugOptions()

  Returns the current debugging options for this DebugGraphics.
  See Also:
    `setDebugOptions(int)`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Swing 1.1
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Submit a bug or feature
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-1998 Sun Microsystems, Inc. 901 San Antonio Road,
Palo Alto, California, 94303, U.S.A. All Rights Reserved.