|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.awt.Graphics
javax.swing.DebugGraphics
public class DebugGraphics
An extension of Graphics that can be used for debugging
custom Swing widgets. DebugGraphics has the ability to
draw slowly and can log drawing actions.
| Field Summary | |
|---|---|
static int |
BUFFERED_OPTION
BUFFERED_OPTION |
static int |
FLASH_OPTION
FLASH_OPTION |
static int |
LOG_OPTION
LOG_OPTION |
static int |
NONE_OPTION
NONE_OPTION |
| Constructor Summary | |
|---|---|
DebugGraphics()
Creates a DebugGraphics object. |
|
DebugGraphics(Graphics graphics)
Creates a DebugGraphics object. |
|
DebugGraphics(Graphics graphics,
JComponent component)
Creates a DebugGraphics object. |
|
| Method Summary | |
|---|---|
void |
clearRect(int x,
int y,
int width,
int height)
clearRect |
void |
clipRect(int x,
int y,
int width,
int height)
Intersects the current clip region with the given region. |
void |
copyArea(int x,
int y,
int width,
int height,
int destx,
int desty)
copyArea |
Graphics |
create()
Creates a overrides Graphics.create to create a
DebugGraphics object. |
Graphics |
create(int x,
int y,
int width,
int height)
Creates a overrides Graphics.create to create a
DebugGraphics object. |
void |
dispose()
Releases all system resources that this Graphics is using. |
void |
draw3DRect(int x,
int y,
int width,
int height,
boolean raised)
draw3DRect |
void |
drawArc(int x,
int y,
int width,
int height,
int startAngle,
int arcAngle)
drawArc |
void |
drawBytes(byte[] data,
int offset,
int length,
int x,
int y)
drawBytes |
void |
drawChars(char[] data,
int offset,
int length,
int x,
int y)
drawChars |
boolean |
drawImage(Image image,
int x,
int y,
Color background,
ImageObserver observer)
drawImage |
boolean |
drawImage(Image image,
int x,
int y,
ImageObserver observer)
drawImage |
boolean |
drawImage(Image image,
int x,
int y,
int width,
int height,
Color background,
ImageObserver observer)
drawImage |
boolean |
drawImage(Image image,
int x,
int y,
int width,
int height,
ImageObserver observer)
drawImage |
boolean |
drawImage(Image image,
int dx1,
int dy1,
int dx2,
int dy2,
int sx1,
int sy1,
int sx2,
int sy2,
Color background,
ImageObserver observer)
drawImage |
boolean |
drawImage(Image image,
int dx1,
int dy1,
int dx2,
int dy2,
int sx1,
int sy1,
int sx2,
int sy2,
ImageObserver observer)
drawImage |
void |
drawLine(int x1,
int y1,
int x2,
int y2)
drawLine |
void |
drawOval(int x,
int y,
int width,
int height)
drawOval |
void |
drawPolygon(int[] xpoints,
int[] ypoints,
int npoints)
drawPolygon |
void |
drawPolyline(int[] xpoints,
int[] ypoints,
int npoints)
drawPolyline |
void |
drawRect(int x,
int y,
int width,
int height)
Draws a rectangle. |
void |
drawRoundRect(int x,
int y,
int width,
int height,
int arcWidth,
int arcHeight)
drawRoundRect |
void |
drawString(AttributedCharacterIterator iterator,
int x,
int y)
drawString |
void |
drawString(String string,
int x,
int y)
drawString |
void |
fill3DRect(int x,
int y,
int width,
int height,
boolean raised)
fill3DRect |
void |
fillArc(int x,
int y,
int width,
int height,
int startAngle,
int arcAngle)
fillArc |
void |
fillOval(int x,
int y,
int width,
int height)
fillOval |
void |
fillPolygon(int[] xpoints,
int[] ypoints,
int npoints)
fillPolygon |
void |
fillRect(int x,
int y,
int width,
int height)
Draws a filled rectangle. |
void |
fillRoundRect(int x,
int y,
int width,
int height,
int arcWidth,
int arcHeight)
fillRoundRect |
static Color |
flashColor()
flashColor |
static int |
flashCount()
flashCount |
static int |
flashTime()
flashTime |
Shape |
getClip()
Returns the current clipping region. |
Rectangle |
getClipBounds()
getClipBounds |
Color |
getColor()
Returns the color used for drawing. |
int |
getDebugOptions()
getDebugOptions |
Font |
getFont()
getFont |
FontMetrics |
getFontMetrics()
Returns the font metrics of the current font. |
FontMetrics |
getFontMetrics(Font font)
Returns the font metrics for a given font. |
boolean |
isDrawingBuffer()
isDrawingBuffer |
static PrintStream |
logStream()
logStream |
void |
setClip(int x,
int y,
int width,
int height)
Sets the clipping region. |
void |
setClip(Shape shape)
Sets the current clipping region |
void |
setColor(Color color)
Sets the color to draw stuff with. |
void |
setDebugOptions(int options)
setDebugOptions |
static void |
setFlashColor(Color color)
setFlashColor |
static void |
setFlashCount(int count)
setFlashCount |
static void |
setFlashTime(int time)
setFlashTime |
void |
setFont(Font font)
setFont |
static void |
setLogStream(PrintStream stream)
setLogStream |
void |
setPaintMode()
setPaintMode |
void |
setXORMode(Color color)
setXORMode |
void |
translate(int x,
int y)
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()
DebugGraphics object.
public DebugGraphics(Graphics graphics,
JComponent component)
DebugGraphics object.
graphics - The Graphics object to wrapcomponent - TODOpublic DebugGraphics(Graphics graphics)
DebugGraphics object.
graphics - The Graphics object to wrap| Method Detail |
|---|
public void setColor(Color color)
setColor in class Graphicscolor - The colorpublic Graphics create()
Graphics.create to create a
DebugGraphics object.
create in class GraphicsDebugGraphics object.
public Graphics create(int x,
int y,
int width,
int height)
Graphics.create to create a
DebugGraphics object.
create in class Graphicsx - the x coordinatey - the y coordinatewidth - the widthheight - the height
DebugGraphics object.public static Color flashColor()
public static void setFlashColor(Color color)
color - the color to use for flashingpublic static int flashTime()
public static void setFlashTime(int time)
time - The time in millisecondspublic static int flashCount()
public static void setFlashCount(int count)
count - The number of flashespublic static PrintStream logStream()
PrintStream to write logging messages topublic static void setLogStream(PrintStream stream)
stream - The currently set PrintStream.public Font getFont()
getFont in class Graphicspublic void setFont(Font font)
setFont in class Graphicsfont - The font to use for drawing textpublic Color getColor()
getColor in class Graphicspublic FontMetrics getFontMetrics()
getFontMetrics in class GraphicsFontMetrics objectpublic FontMetrics getFontMetrics(Font font)
getFontMetrics in class Graphicsfont - the font to get the metrics for
FontMetrics object
public void translate(int x,
int y)
translate in class Graphicsx - the x coordinatey - the y coordinatepublic void setPaintMode()
setPaintMode in class Graphicspublic void setXORMode(Color color)
setXORMode in class Graphicscolor - the colorpublic Rectangle getClipBounds()
getClipBounds in class Graphics
public void clipRect(int x,
int y,
int width,
int height)
clipRect in class Graphicsx - The x-position of the regiony - The y-position of the regionwidth - The width of the regionheight - The height of the region
public void setClip(int x,
int y,
int width,
int height)
setClip in class Graphicsx - The x-position of the regiony - The y-position of the regionwidth - The width of the regionheight - The height of the regionpublic Shape getClip()
getClip in class Graphicspublic void setClip(Shape shape)
setClip in class Graphicsshape - The clippin region
public void drawRect(int x,
int y,
int width,
int height)
drawRect in class Graphicsx - The x-position of the rectangley - The y-position of the rectanglewidth - The width of the rectangleheight - The height of the rectangle
public void fillRect(int x,
int y,
int width,
int height)
fillRect in class Graphicsx - The x-position of the rectangley - The y-position of the rectanglewidth - The width of the rectangleheight - The height of the rectangle
public void clearRect(int x,
int y,
int width,
int height)
clearRect in class Graphicsx - The x-position of the rectangley - The y-position of the rectanglewidth - The width of the rectangleheight - The height of the rectangle
public void drawRoundRect(int x,
int y,
int width,
int height,
int arcWidth,
int arcHeight)
drawRoundRect in class Graphicsx - The x-position of the rectangley - The y-position of the rectanglewidth - The width of the rectangleheight - The height of the rectanglearcWidth - TODOarcHeight - TODO
public void fillRoundRect(int x,
int y,
int width,
int height,
int arcWidth,
int arcHeight)
fillRoundRect in class Graphicsx - The x-position of the rectangley - The y-position of the rectanglewidth - The width of the rectangleheight - The height of the rectanglearcWidth - TODOarcHeight - TODO
public void drawLine(int x1,
int y1,
int x2,
int y2)
drawLine in class Graphicsx1 - The x-position of the starty1 - The y-position of the startx2 - The x-position of the endy2 - The y-position of the end
public void draw3DRect(int x,
int y,
int width,
int height,
boolean raised)
draw3DRect in class Graphicsx - The x-position of the rectangley - The y-position of the rectanglewidth - The width of the rectangleheight - The height of the rectangleraised - TODO
public void fill3DRect(int x,
int y,
int width,
int height,
boolean raised)
fill3DRect in class Graphicsx - The x-position of the rectangley - The y-position of the rectanglewidth - The width of the rectangleheight - The height of the rectangleraised - TODO
public void drawOval(int x,
int y,
int width,
int height)
drawOval in class Graphicsx - the x coordinatey - the y coordiantewidth - the widthheight - the height
public void fillOval(int x,
int y,
int width,
int height)
fillOval in class Graphicsx - the x coordinatey - the y coordinatewidth - the widthheight - the height
public void drawArc(int x,
int y,
int width,
int height,
int startAngle,
int arcAngle)
drawArc in class Graphicsx - the x coordinatey - the y coordinatewidth - the widthheight - the heightstartAngle - TODOarcAngle - TODO
public void fillArc(int x,
int y,
int width,
int height,
int startAngle,
int arcAngle)
fillArc in class Graphicsx - the coordinatey - the y coordinatewidth - the widthheight - the heightstartAngle - TODOarcAngle - TODO
public void drawPolyline(int[] xpoints,
int[] ypoints,
int npoints)
drawPolyline in class Graphicsxpoints - TODOypoints - TODOnpoints - TODO
public void drawPolygon(int[] xpoints,
int[] ypoints,
int npoints)
drawPolygon in class Graphicsxpoints - TODOypoints - TODOnpoints - TODO
public void fillPolygon(int[] xpoints,
int[] ypoints,
int npoints)
fillPolygon in class Graphicsxpoints - TODOypoints - TODOnpoints - TODO
public void drawString(String string,
int x,
int y)
drawString in class Graphicsstring - the stringx - the x coordinatey - the y coordinate
public void drawString(AttributedCharacterIterator iterator,
int x,
int y)
drawString in class Graphicsiterator - TODOx - the x coordinatey - the y coordinate
public void drawBytes(byte[] data,
int offset,
int length,
int x,
int y)
drawBytes in class Graphicsdata - TODOoffset - TODOlength - TODOx - the x coordinatey - the y coordinate
public void drawChars(char[] data,
int offset,
int length,
int x,
int y)
drawChars in class Graphicsdata - array of characters to drawoffset - offset in arraylength - number of characters in array to drawx - x-positiony - y-position
public boolean drawImage(Image image,
int x,
int y,
ImageObserver observer)
drawImage in class Graphicsimage - The image to drawx - The x positiony - The y positionobserver - The image observer
public boolean drawImage(Image image,
int x,
int y,
int width,
int height,
ImageObserver observer)
drawImage in class Graphicsimage - The image to drawx - The x positiony - The y positionwidth - The width of the area to draw the imageheight - The height of the area to draw the imageobserver - The image observer
public boolean drawImage(Image image,
int x,
int y,
Color background,
ImageObserver observer)
drawImage in class Graphicsimage - The image to drawx - The x positiony - The y positionbackground - The color for the background in the opaque regions
of the imageobserver - The image observer
public boolean drawImage(Image image,
int x,
int y,
int width,
int height,
Color background,
ImageObserver observer)
drawImage in class Graphicsimage - The image to drawx - The x positiony - The y positionwidth - The width of the area to draw the imageheight - The height of the area to draw the imagebackground - The color for the background in the opaque regions
of the imageobserver - The image observer
public boolean drawImage(Image image,
int dx1,
int dy1,
int dx2,
int dy2,
int sx1,
int sy1,
int sx2,
int sy2,
ImageObserver observer)
drawImage in class Graphicsimage - The image to drawdx1 - TODOdy1 - TODOdx2 - TODOdy2 - TODOsx1 - TODOsy1 - TODOsx2 - TODOsy2 - TODOobserver - The image observer
public boolean drawImage(Image image,
int dx1,
int dy1,
int dx2,
int dy2,
int sx1,
int sy1,
int sx2,
int sy2,
Color background,
ImageObserver observer)
drawImage in class Graphicsimage - The image to drawdx1 - TODOdy1 - TODOdx2 - TODOdy2 - TODOsx1 - TODOsy1 - TODOsx2 - TODOsy2 - TODObackground - The color for the background in the opaque regions
of the imageobserver - The image observer
public void copyArea(int x,
int y,
int width,
int height,
int destx,
int desty)
copyArea in class Graphicsx - The x position of the source areay - The y position of the source areawidth - The width of the areaheight - The height of the areadestx - The x position of the destination areadesty - The y posiiton of the destination areapublic void dispose()
Graphics is using.
dispose in class Graphicspublic boolean isDrawingBuffer()
public void setDebugOptions(int options)
options - the debug optionspublic int getDebugOptions()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||