All Packages  Class Hierarchy  This Package  Previous  Next  Index  

Class java.awt.swing.DebugGraphics

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

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.

See Also:
setDebugGraphicsOptions

Variable Index

 o BUFFERED_OPTION
Show buffered operations in a seperate Frame.
 o FLASH_OPTION
Flash graphics operations.
 o LOG_OPTION
Log graphics operations.
 o NONE_OPTION
Don't debug graphics operations.

Constructor Index

 o DebugGraphics()
 o DebugGraphics(Graphics)
 o DebugGraphics(Graphics, JComponent)
Handle on AWT Graphics

Method Index

 o clearRect(int, int, int, int)
Clears the specified rectangle by filling it with the background color of the current drawing surface.
 o clipRect(int, int, int, int)
Intersects the current clip with the specified rectangle.
 o copyArea(int, int, int, int, int, int)
Copies an area of the component by a distance specified by dx and dy.
 o create()
Creates a new Graphics object that is a copy of this Graphics object.
 o create(int, int, int, int)
Creates a new Graphics object based on this Graphics object, but with a new translation and clip area.
 o dispose()
Disposes of this graphics context and releases any system resources that it is using.
 o draw3DRect(int, int, int, int, boolean)
Draws a 3-D highlighted outline of the specified rectangle.
 o drawArc(int, int, int, int, int, int)
Draws the outline of a circular or elliptical arc covering the specified rectangle.
 o drawBytes(byte[], int, int, int, int)
Draws the text given by the specified byte array, using this graphics context's current font and color.
 o drawChars(char[], int, int, int, int)
Draws the text given by the specified character array, using this graphics context's current font and color.
 o drawImage(Image, int, int, Color, ImageObserver)
Draws as much of the specified image as is currently available.
 o drawImage(Image, int, int, ImageObserver)
Draws as much of the specified image as is currently available.
 o drawImage(Image, int, int, int, int, Color, ImageObserver)
Draws as much of the specified image as has already been scaled to fit inside the specified rectangle.
 o drawImage(Image, int, int, int, int, ImageObserver)
Draws as much of the specified image as has already been scaled to fit inside the specified rectangle.
 o drawImage(Image, int, int, int, int, int, int, int, int, Color, ImageObserver)
Draws as much of the specified area of the specified image as is currently available, scaling it on the fly to fit inside the specified area of the destination drawable surface.
 o drawImage(Image, int, int, int, int, int, int, int, int, ImageObserver)
Draws as much of the specified area of the specified image as is currently available, scaling it on the fly to fit inside the specified area of the destination drawable surface.
 o drawLine(int, int, int, int)
Draws a line, using the current color, between the points (x1, y1) and (x2, y2) in this graphics context's coordinate system.
 o drawOval(int, int, int, int)
Draws the outline of an oval.
 o drawPolygon(int[], int[], int)
Draws a closed polygon defined by arrays of x and y coordinates.
 o drawPolyline(int[], int[], int)
Draws a sequence of connected lines defined by arrays of x and y coordinates.
 o drawRect(int, int, int, int)
Draws the outline of the specified rectangle.
 o drawRoundRect(int, int, int, int, int, int)
Draws an outlined round-cornered rectangle using this graphics context's current color.
 o drawString(String, int, int)
Draws the text given by the specified string, using this graphics context's current font and color.
 o fill3DRect(int, int, int, int, boolean)
Paints a 3-D highlighted rectangle filled with the current color.
 o fillArc(int, int, int, int, int, int)
Fills a circular or elliptical arc covering the specified rectangle.
 o fillOval(int, int, int, int)
Fills an oval bounded by the specified rectangle with the current color.
 o fillPolygon(int[], int[], int)
Fills a closed polygon defined by arrays of x and y coordinates.
 o fillRect(int, int, int, int)
Fills the specified rectangle.
 o fillRoundRect(int, int, int, int, int, int)
Fills the specified rounded corner rectangle with the current color.
 o flashColor()
Returns the Color used to flash drawing operations.
 o flashCount()
Returns the number of times that drawing operations will flash.
 o flashTime()
Returns the time delay of drawing operation flashing.
 o getClip()
Gets the current clipping area.
 o getClipBounds()
Returns the bounding rectangle of the current clipping area.
 o getColor()
Returns the Color used for text drawing operations.
 o getDebugOptions()
Returns the current debugging options for this DebugGraphics.
 o getFont()
Returns the Font used for text drawing operations.
 o getFontMetrics()
Gets the font metrics of the current font.
 o getFontMetrics(Font)
Gets the font metrics for the specified font.
 o isDrawingBuffer()
 o logStream()
Returns the stream to which the DebugGraphics logs drawing operations.
 o setClip(int, int, int, int)
Sets the current clip to the rectangle specified by the given coordinates.
 o setClip(Shape)
Sets the current clipping area to an arbitrary clip shape.
 o setColor(Color)
Sets the color to be used for drawing and filling lines and shapes.
 o setDebugOptions(int)
Enables/disables diagnostic information about every graphics operation.
 o setFlashColor(Color)
Sets the Color used to flash drawing operations.
 o setFlashCount(int)
Sets the number of times that drawing operations will flash.
 o setFlashTime(int)
Sets the time delay of drawing operation flashing.
 o setFont(Font)
Sets the Font used for text drawing operations.
 o setLogStream(PrintStream)
Sets the stream to which the DebugGraphics logs drawing operations.
 o setPaintMode()
Sets the paint mode of this graphics context to overwrite the destination with this graphics context's current color.
 o setXORMode(Color)
Sets the paint mode of this graphics context to alternate between this graphics context's current color and the new specified color.
 o translate(int, int)
Translates the origin of the graphics context to the point (xy) in the current coordinate system.

Variables

 o LOG_OPTION
public static final int LOG_OPTION
Log graphics operations.

 o FLASH_OPTION
public static final int FLASH_OPTION
Flash graphics operations.

 o BUFFERED_OPTION
public static final int BUFFERED_OPTION
Show buffered operations in a seperate Frame.

 o NONE_OPTION
public static final int NONE_OPTION
Don't debug graphics operations.

Constructors

 o DebugGraphics
public DebugGraphics()
 o DebugGraphics
public DebugGraphics(Graphics graphics,
                     JComponent component)
Handle on AWT Graphics

 o DebugGraphics
public DebugGraphics(Graphics graphics)

Methods

 o create
public Graphics create()
Creates a new Graphics object that is a copy of this Graphics object.

Overrides:
create in class Graphics
 o create
public Graphics create(int x,
                       int y,
                       int width,
                       int height)
Creates a new Graphics object based on this Graphics object, but with a new translation and clip area.

Overrides:
create in class Graphics
 o setFlashColor
public static void setFlashColor(Color flashColor)
Sets the Color used to flash drawing operations.

 o flashColor
public static Color flashColor()
Returns the Color used to flash drawing operations.

See Also:
setFlashColor
 o setFlashTime
public static void setFlashTime(int flashTime)
Sets the time delay of drawing operation flashing.

 o flashTime
public static int flashTime()
Returns the time delay of drawing operation flashing.

See Also:
setFlashTime
 o setFlashCount
public static void setFlashCount(int flashCount)
Sets the number of times that drawing operations will flash.

 o flashCount
public static int flashCount()
Returns the number of times that drawing operations will flash.

See Also:
setFlashCount
 o setLogStream
public static void setLogStream(PrintStream stream)
Sets the stream to which the DebugGraphics logs drawing operations.

 o logStream
public static PrintStream logStream()
Returns the stream to which the DebugGraphics logs drawing operations.

See Also:
setLogStream
 o setFont
public void setFont(Font aFont)
Sets the Font used for text drawing operations.

Overrides:
setFont in class Graphics
 o getFont
public Font getFont()
Returns the Font used for text drawing operations.

Overrides:
getFont in class Graphics
See Also:
setFont
 o setColor
public void setColor(Color aColor)
Sets the color to be used for drawing and filling lines and shapes.

Overrides:
setColor in class Graphics
 o getColor
public Color getColor()
Returns the Color used for text drawing operations.

Overrides:
getColor in class Graphics
See Also:
setColor
 o getFontMetrics
public FontMetrics getFontMetrics()
Gets the font metrics of the current font.

Overrides:
getFontMetrics in class Graphics
 o getFontMetrics
public FontMetrics getFontMetrics(Font f)
Gets the font metrics for the specified font.

Overrides:
getFontMetrics in class Graphics
 o translate
public void translate(int x,
                      int y)
Translates the origin of the graphics context to the point (xy) in the current coordinate system.

Overrides:
translate in class Graphics
 o setPaintMode
public void setPaintMode()
Sets the paint mode of this graphics context to overwrite the destination with this graphics context's current color.

Overrides:
setPaintMode in class Graphics
 o setXORMode
public void setXORMode(Color aColor)
Sets the paint mode of this graphics context to alternate between this graphics context's current color and the new specified color.

Overrides:
setXORMode in class Graphics
 o getClipBounds
public Rectangle getClipBounds()
Returns the bounding rectangle of the current clipping area.

Overrides:
getClipBounds in class Graphics
 o clipRect
public void clipRect(int x,
                     int y,
                     int width,
                     int height)
Intersects the current clip with the specified rectangle.

Overrides:
clipRect in class Graphics
 o setClip
public void setClip(int x,
                    int y,
                    int width,
                    int height)
Sets the current clip to the rectangle specified by the given coordinates.

Overrides:
setClip in class Graphics
 o getClip
public Shape getClip()
Gets the current clipping area.

Overrides:
getClip in class Graphics
 o setClip
public void setClip(Shape clip)
Sets the current clipping area to an arbitrary clip shape.

Overrides:
setClip in class Graphics
 o drawRect
public void drawRect(int x,
                     int y,
                     int width,
                     int height)
Draws the outline of the specified rectangle.

Overrides:
drawRect in class Graphics
 o fillRect
public void fillRect(int x,
                     int y,
                     int width,
                     int height)
Fills the specified rectangle.

Overrides:
fillRect in class Graphics
 o clearRect
public void clearRect(int x,
                      int y,
                      int width,
                      int height)
Clears the specified rectangle by filling it with the background color of the current drawing surface.

Overrides:
clearRect in class Graphics
 o drawRoundRect
public void drawRoundRect(int x,
                          int y,
                          int width,
                          int height,
                          int arcWidth,
                          int arcHeight)
Draws an outlined round-cornered rectangle using this graphics context's current color.

Overrides:
drawRoundRect in class Graphics
 o fillRoundRect
public void fillRoundRect(int x,
                          int y,
                          int width,
                          int height,
                          int arcWidth,
                          int arcHeight)
Fills the specified rounded corner rectangle with the current color.

Overrides:
fillRoundRect in class Graphics
 o drawLine
public void drawLine(int x1,
                     int y1,
                     int x2,
                     int y2)
Draws a line, using the current color, between the points (x1, y1) and (x2, y2) in this graphics context's coordinate system.

Overrides:
drawLine in class Graphics
 o draw3DRect
public void draw3DRect(int x,
                       int y,
                       int width,
                       int height,
                       boolean raised)
Draws a 3-D highlighted outline of the specified rectangle.

Overrides:
draw3DRect in class Graphics
 o fill3DRect
public void fill3DRect(int x,
                       int y,
                       int width,
                       int height,
                       boolean raised)
Paints a 3-D highlighted rectangle filled with the current color.

Overrides:
fill3DRect in class Graphics
 o drawOval
public void drawOval(int x,
                     int y,
                     int width,
                     int height)
Draws the outline of an oval.

Overrides:
drawOval in class Graphics
 o fillOval
public void fillOval(int x,
                     int y,
                     int width,
                     int height)
Fills an oval bounded by the specified rectangle with the current color.

Overrides:
fillOval in class Graphics
 o drawArc
public void drawArc(int x,
                    int y,
                    int width,
                    int height,
                    int startAngle,
                    int arcAngle)
Draws the outline of a circular or elliptical arc covering the specified rectangle.

Overrides:
drawArc in class Graphics
 o fillArc
public void fillArc(int x,
                    int y,
                    int width,
                    int height,
                    int startAngle,
                    int arcAngle)
Fills a circular or elliptical arc covering the specified rectangle.

Overrides:
fillArc in class Graphics
 o drawPolyline
public void drawPolyline(int[] xPoints,
                         int[] yPoints,
                         int nPoints)
Draws a sequence of connected lines defined by arrays of x and y coordinates.

Overrides:
drawPolyline in class Graphics
 o drawPolygon
public void drawPolygon(int[] xPoints,
                        int[] yPoints,
                        int nPoints)
Draws a closed polygon defined by arrays of x and y coordinates.

Overrides:
drawPolygon in class Graphics
 o fillPolygon
public void fillPolygon(int[] xPoints,
                        int[] yPoints,
                        int nPoints)
Fills a closed polygon defined by arrays of x and y coordinates.

Overrides:
fillPolygon in class Graphics
 o drawString
public void drawString(String aString,
                       int x,
                       int y)
Draws the text given by the specified string, using this graphics context's current font and color.

Overrides:
drawString in class Graphics
 o drawBytes
public void drawBytes(byte[] data,
                      int offset,
                      int length,
                      int x,
                      int y)
Draws the text given by the specified byte array, using this graphics context's current font and color.

Overrides:
drawBytes in class Graphics
 o drawChars
public void drawChars(char[] data,
                      int offset,
                      int length,
                      int x,
                      int y)
Draws the text given by the specified character array, using this graphics context's current font and color.

Overrides:
drawChars in class Graphics
 o drawImage
public boolean drawImage(Image img,
                         int x,
                         int y,
                         ImageObserver observer)
Draws as much of the specified image as is currently available.

Overrides:
drawImage in class Graphics
 o drawImage
public boolean drawImage(Image img,
                         int x,
                         int y,
                         int width,
                         int height,
                         ImageObserver observer)
Draws as much of the specified image as has already been scaled to fit inside the specified rectangle.

Overrides:
drawImage in class Graphics
 o drawImage
public boolean drawImage(Image img,
                         int x,
                         int y,
                         Color bgcolor,
                         ImageObserver observer)
Draws as much of the specified image as is currently available.

Overrides:
drawImage in class Graphics
 o drawImage
public boolean drawImage(Image img,
                         int x,
                         int y,
                         int width,
                         int height,
                         Color bgcolor,
                         ImageObserver observer)
Draws as much of the specified image as has already been scaled to fit inside the specified rectangle.

Overrides:
drawImage in class Graphics
 o drawImage
public boolean drawImage(Image img,
                         int dx1,
                         int dy1,
                         int dx2,
                         int dy2,
                         int sx1,
                         int sy1,
                         int sx2,
                         int sy2,
                         ImageObserver observer)
Draws as much of the specified area of the specified image as is currently available, scaling it on the fly to fit inside the specified area of the destination drawable surface.

Overrides:
drawImage in class Graphics
 o 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)
Draws as much of the specified area of the specified image as is currently available, scaling it on the fly to fit inside the specified area of the destination drawable surface.

Overrides:
drawImage in class Graphics
 o copyArea
public void copyArea(int x,
                     int y,
                     int width,
                     int height,
                     int destX,
                     int destY)
Copies an area of the component by a distance specified by dx and dy.

Overrides:
copyArea in class Graphics
 o dispose
public void dispose()
Disposes of this graphics context and releases any system resources that it is using.

Overrides:
dispose in class Graphics
 o isDrawingBuffer
public boolean isDrawingBuffer()
 o 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.

 o getDebugOptions
public int getDebugOptions()
Returns the current debugging options for this DebugGraphics.

See Also:
setDebugOptions

All Packages  Class Hierarchy  This Package  Previous  Next  Index  

Submit a bug or feature