|
|||||||||
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 wrapMethod Detail |
---|
public void setColor(Color color)
setColor
in class Graphics
color
- The colorpublic Graphics create()
Graphics.create
to create a
DebugGraphics
object.
create
in class Graphics
DebugGraphics
object.public Graphics create(int x, int y, int width, int height)
Graphics.create
to create a
DebugGraphics
object.
create
in class Graphics
x
- 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 Graphics
public void setFont(Font font)
setFont
in class Graphics
font
- The font to use for drawing textpublic Color getColor()
getColor
in class Graphics
public FontMetrics getFontMetrics()
getFontMetrics
in class Graphics
FontMetrics
objectpublic FontMetrics getFontMetrics(Font font)
getFontMetrics
in class Graphics
font
- the font to get the metrics for
FontMetrics
objectpublic void translate(int x, int y)
translate
in class Graphics
x
- the x coordinatey
- the y coordinatepublic void setPaintMode()
setPaintMode
in class Graphics
public void setXORMode(Color color)
setXORMode
in class Graphics
color
- the colorpublic Rectangle getClipBounds()
getClipBounds
in class Graphics
public void clipRect(int x, int y, int width, int height)
clipRect
in class Graphics
x
- The x-position of the regiony
- The y-position of the regionwidth
- The width of the regionheight
- The height of the regionpublic void setClip(int x, int y, int width, int height)
setClip
in class Graphics
x
- 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 Graphics
public void setClip(Shape shape)
setClip
in class Graphics
shape
- The clippin regionpublic void drawRect(int x, int y, int width, int height)
drawRect
in class Graphics
x
- The x-position of the rectangley
- The y-position of the rectanglewidth
- The width of the rectangleheight
- The height of the rectanglepublic void fillRect(int x, int y, int width, int height)
fillRect
in class Graphics
x
- The x-position of the rectangley
- The y-position of the rectanglewidth
- The width of the rectangleheight
- The height of the rectanglepublic void clearRect(int x, int y, int width, int height)
clearRect
in class Graphics
x
- The x-position of the rectangley
- The y-position of the rectanglewidth
- The width of the rectangleheight
- The height of the rectanglepublic void drawRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight)
drawRoundRect
in class Graphics
x
- The x-position of the rectangley
- The y-position of the rectanglewidth
- The width of the rectangleheight
- The height of the rectanglearcWidth
- TODOarcHeight
- TODOpublic void fillRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight)
fillRoundRect
in class Graphics
x
- The x-position of the rectangley
- The y-position of the rectanglewidth
- The width of the rectangleheight
- The height of the rectanglearcWidth
- TODOarcHeight
- TODOpublic void drawLine(int x1, int y1, int x2, int y2)
drawLine
in class Graphics
x1
- The x-position of the starty1
- The y-position of the startx2
- The x-position of the endy2
- The y-position of the endpublic void draw3DRect(int x, int y, int width, int height, boolean raised)
draw3DRect
in class Graphics
x
- The x-position of the rectangley
- The y-position of the rectanglewidth
- The width of the rectangleheight
- The height of the rectangleraised
- TODOpublic void fill3DRect(int x, int y, int width, int height, boolean raised)
fill3DRect
in class Graphics
x
- The x-position of the rectangley
- The y-position of the rectanglewidth
- The width of the rectangleheight
- The height of the rectangleraised
- TODOpublic void drawOval(int x, int y, int width, int height)
drawOval
in class Graphics
x
- the x coordinatey
- the y coordiantewidth
- the widthheight
- the heightpublic void fillOval(int x, int y, int width, int height)
fillOval
in class Graphics
x
- the x coordinatey
- the y coordinatewidth
- the widthheight
- the heightpublic void drawArc(int x, int y, int width, int height, int startAngle, int arcAngle)
drawArc
in class Graphics
x
- the x coordinatey
- the y coordinatewidth
- the widthheight
- the heightstartAngle
- TODOarcAngle
- TODOpublic void fillArc(int x, int y, int width, int height, int startAngle, int arcAngle)
fillArc
in class Graphics
x
- the coordinatey
- the y coordinatewidth
- the widthheight
- the heightstartAngle
- TODOarcAngle
- TODOpublic void drawPolyline(int[] xpoints, int[] ypoints, int npoints)
drawPolyline
in class Graphics
xpoints
- TODOypoints
- TODOnpoints
- TODOpublic void drawPolygon(int[] xpoints, int[] ypoints, int npoints)
drawPolygon
in class Graphics
xpoints
- TODOypoints
- TODOnpoints
- TODOpublic void fillPolygon(int[] xpoints, int[] ypoints, int npoints)
fillPolygon
in class Graphics
xpoints
- TODOypoints
- TODOnpoints
- TODOpublic void drawString(String string, int x, int y)
drawString
in class Graphics
string
- the stringx
- the x coordinatey
- the y coordinatepublic void drawString(AttributedCharacterIterator iterator, int x, int y)
drawString
in class Graphics
iterator
- TODOx
- the x coordinatey
- the y coordinatepublic void drawBytes(byte[] data, int offset, int length, int x, int y)
drawBytes
in class Graphics
data
- TODOoffset
- TODOlength
- TODOx
- the x coordinatey
- the y coordinatepublic void drawChars(char[] data, int offset, int length, int x, int y)
drawChars
in class Graphics
data
- array of characters to drawoffset
- offset in arraylength
- number of characters in array to drawx
- x-positiony
- y-positionpublic boolean drawImage(Image image, int x, int y, ImageObserver observer)
drawImage
in class Graphics
image
- 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 Graphics
image
- 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 Graphics
image
- 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 Graphics
image
- 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 Graphics
image
- 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 Graphics
image
- 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 Graphics
x
- 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 Graphics
public 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 |