public class DebugGraphics extends Graphics
注意:你必须关闭双缓冲使用debuggraphics:repaintmanager repaintmanager = repaintmanager。currentmanager(组件);repaintmanager setdoublebufferingenabled(假);
Modifier and Type | Field and Description |
---|---|
static int |
BUFFERED_OPTION
显示缓冲操作在一个单独的
Frame 。
|
static int |
FLASH_OPTION
闪存图形操作。
|
static int |
LOG_OPTION
日志图形操作。
|
static int |
NONE_OPTION
不要调试图形操作。
|
Constructor and Description |
---|
DebugGraphics()
构造一个支持减缓绘制的新的调试图形上下文。
|
DebugGraphics(Graphics graphics)
从支持的图形上下文中构造一个调试图形上下文的调试图形上下文。
|
DebugGraphics(Graphics graphics, JComponent component)
从现有的图形上下文中构造一个调试图形上下文,以减缓指定组件的绘制速度。
|
Modifier and Type | Method and Description |
---|---|
void |
clearRect(int x, int y, int width, int height)
覆盖
Graphics.clearRect 。
|
void |
clipRect(int x, int y, int width, int height)
覆盖
Graphics.clipRect 。
|
void |
copyArea(int x, int y, int width, int height, int destX, int destY)
覆盖
Graphics.copyArea 。
|
Graphics |
create()
覆盖
Graphics.create 返回debuggraphics对象。
|
Graphics |
create(int x, int y, int width, int height)
覆盖
Graphics.create 返回debuggraphics对象。
|
void |
dispose()
覆盖
Graphics.dispose 。
|
void |
draw3DRect(int x, int y, int width, int height, boolean raised)
覆盖
Graphics.draw3DRect 。
|
void |
drawArc(int x, int y, int width, int height, int startAngle, int arcAngle)
覆盖
Graphics.drawArc 。
|
void |
drawBytes(byte[] data, int offset, int length, int x, int y)
覆盖
Graphics.drawBytes 。
|
void |
drawChars(char[] data, int offset, int length, int x, int y)
覆盖
Graphics.drawChars 。
|
boolean |
drawImage(Image img, int x, int y, Color bgcolor, ImageObserver observer)
覆盖
Graphics.drawImage 。
|
boolean |
drawImage(Image img, int x, int y, ImageObserver observer)
覆盖
Graphics.drawImage 。
|
boolean |
drawImage(Image img, int x, int y, int width, int height, Color bgcolor, ImageObserver observer)
覆盖
Graphics.drawImage 。
|
boolean |
drawImage(Image img, int x, int y, int width, int height, ImageObserver observer)
覆盖
Graphics.drawImage 。
|
boolean |
drawImage(Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, Color bgcolor, ImageObserver observer)
覆盖
Graphics.drawImage 。
|
boolean |
drawImage(Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, ImageObserver observer)
覆盖
Graphics.drawImage 。
|
void |
drawLine(int x1, int y1, int x2, int y2)
覆盖
Graphics.drawLine 。
|
void |
drawOval(int x, int y, int width, int height)
覆盖
Graphics.drawOval 。
|
void |
drawPolygon(int[] xPoints, int[] yPoints, int nPoints)
覆盖
Graphics.drawPolygon 。
|
void |
drawPolyline(int[] xPoints, int[] yPoints, int nPoints)
覆盖
Graphics.drawPolyline 。
|
void |
drawRect(int x, int y, int width, int height)
覆盖
Graphics.drawRect 。
|
void |
drawRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight)
覆盖
Graphics.drawRoundRect 。
|
void |
drawString(AttributedCharacterIterator iterator, int x, int y)
覆盖
Graphics.drawString 。
|
void |
drawString(String aString, int x, int y)
覆盖
Graphics.drawString 。
|
void |
fill3DRect(int x, int y, int width, int height, boolean raised)
覆盖
Graphics.fill3DRect 。
|
void |
fillArc(int x, int y, int width, int height, int startAngle, int arcAngle)
覆盖
Graphics.fillArc 。
|
void |
fillOval(int x, int y, int width, int height)
覆盖
Graphics.fillOval 。
|
void |
fillPolygon(int[] xPoints, int[] yPoints, int nPoints)
覆盖
Graphics.fillPolygon 。
|
void |
fillRect(int x, int y, int width, int height)
覆盖
Graphics.fillRect 。
|
void |
fillRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight)
覆盖
Graphics.fillRoundRect 。
|
static Color |
flashColor()
返回用于绘制操作的颜色。
|
static int |
flashCount()
返回绘图操作将闪烁的次数。
|
static int |
flashTime()
返回绘图操作闪烁的时间延迟。
|
Shape |
getClip()
覆盖
Graphics.getClip 。
|
Rectangle |
getClipBounds()
覆盖
Graphics.getClipBounds 。
|
Color |
getColor()
返回用于文本绘制操作的颜色。
|
int |
getDebugOptions()
返回当前的调试选项,这debuggraphics。
|
Font |
getFont()
返回用于文本绘制操作的字体。
|
FontMetrics |
getFontMetrics()
覆盖
Graphics.getFontMetrics 。
|
FontMetrics |
getFontMetrics(Font f)
覆盖
Graphics.getFontMetrics 。
|
boolean |
isDrawingBuffer()
返回drawingbuffer价值。
|
static PrintStream |
logStream()
返回流的debuggraphics测井绘图操作。
|
void |
setClip(int x, int y, int width, int height)
覆盖
Graphics.setClip 。
|
void |
setClip(Shape clip)
覆盖
Graphics.setClip 。
|
void |
setColor(Color aColor)
设置用于绘制和填充线条和形状的颜色。
|
void |
setDebugOptions(int options)
启用/禁用关于每一个图形操作的诊断信息。
|
static void |
setFlashColor(Color flashColor)
设置用于绘制绘制操作的颜色。
|
static void |
setFlashCount(int flashCount)
设置绘图操作将闪烁的次数。
|
static void |
setFlashTime(int flashTime)
设置绘图操作闪烁的时间延迟。
|
void |
setFont(Font aFont)
设置用于文本绘制操作的字体。
|
static void |
setLogStream(PrintStream stream)
设置流的debuggraphics测井绘图操作。
|
void |
setPaintMode()
覆盖
Graphics.setPaintMode 。
|
void |
setXORMode(Color aColor)
覆盖
Graphics.setXORMode 。
|
void |
translate(int x, int y)
覆盖
Graphics.translate 。
|
drawPolygon, fillPolygon, finalize, getClipBounds, getClipRect, hitClip, toString
public static final int LOG_OPTION
public static final int FLASH_OPTION
public static final int BUFFERED_OPTION
Frame
。
public static final int NONE_OPTION
public DebugGraphics()
public DebugGraphics(Graphics graphics, JComponent component)
graphics
-图文慢下来
component
- JComponent的画慢慢
public DebugGraphics(Graphics graphics)
graphics
-图文慢下来
public Graphics create()
Graphics.create
返回debuggraphics对象。
public Graphics create(int x, int y, int width, int height)
Graphics.create
返回debuggraphics对象。
create
方法重写,继承类
Graphics
x
的X坐标。
y
的Y坐标。
width
-裁剪矩形的宽度。
height
-裁剪矩形的高度。
Graphics.translate(int, int)
,
Graphics.clipRect(int, int, int, int)
public static void setFlashColor(Color flashColor)
public static Color flashColor()
public static void setFlashTime(int flashTime)
public static int flashTime()
setFlashTime(int)
public static void setFlashCount(int flashCount)
public static int flashCount()
setFlashCount(int)
public static void setLogStream(PrintStream stream)
public static PrintStream logStream()
public void setFont(Font aFont)
setFont
方法重写,继承类
Graphics
aFont
-字体。
Graphics.getFont()
,
Graphics.drawString(java.lang.String, int, int)
,
Graphics.drawBytes(byte[], int, int, int, int)
,
Graphics.drawChars(char[], int, int, int, int)
public Font getFont()
getFont
方法重写,继承类
Graphics
setFont(java.awt.Font)
public void setColor(Color aColor)
setColor
方法重写,继承类
Graphics
aColor
-新的渲染色彩。
Color
,
Graphics.getColor()
public Color getColor()
getColor
方法重写,继承类
Graphics
setColor(java.awt.Color)
public FontMetrics getFontMetrics()
Graphics.getFontMetrics
。
getFontMetrics
方法重写,继承类
Graphics
Graphics.getFont()
,
FontMetrics
,
Graphics.getFontMetrics(Font)
public FontMetrics getFontMetrics(Font f)
Graphics.getFontMetrics
。
getFontMetrics
方法重写,继承类
Graphics
f
-指定的字体
Graphics.getFont()
,
FontMetrics
,
Graphics.getFontMetrics()
public void translate(int x, int y)
Graphics.translate
。
public void setPaintMode()
Graphics.setPaintMode
。
setPaintMode
方法重写,继承类
Graphics
public void setXORMode(Color aColor)
Graphics.setXORMode
。
setXORMode
方法重写,继承类
Graphics
aColor
-异或变换颜色
public Rectangle getClipBounds()
Graphics.getClipBounds
。
getClipBounds
方法重写,继承类
Graphics
null
如果没有夹套。
Graphics.getClip()
,
Graphics.clipRect(int, int, int, int)
,
Graphics.setClip(int, int, int, int)
,
Graphics.setClip(Shape)
public void clipRect(int x, int y, int width, int height)
Graphics.clipRect
。
clipRect
方法重写,继承类
Graphics
x
的x坐标的矩形相交的夹
y
-矩形相交的剪辑与Y坐标
width
-矩形相交的夹的宽度
height
-矩形相交的剪辑与高度
Graphics.setClip(int, int, int, int)
,
Graphics.setClip(Shape)
public void setClip(int x, int y, int width, int height)
Graphics.setClip
。
setClip
方法重写,继承类
Graphics
x
-新的剪辑矩形的x坐标。
y
-新的剪辑矩形坐标。
width
-新的剪辑矩形的宽度。
height
-新的剪辑矩形的高度。
Graphics.clipRect(int, int, int, int)
,
Graphics.setClip(Shape)
,
Graphics.getClip()
public Shape getClip()
Graphics.getClip
。
getClip
方法重写,继承类
Graphics
Shape
对象,或
null
如果没有夹套。
Graphics.getClipBounds()
,
Graphics.clipRect(int, int, int, int)
,
Graphics.setClip(int, int, int, int)
,
Graphics.setClip(Shape)
public void setClip(Shape clip)
Graphics.setClip
。
setClip
方法重写,继承类
Graphics
clip
-
Shape
使用设置夹
Graphics.getClip()
,
Graphics.clipRect(int, int, int, int)
,
Graphics.setClip(int, int, int, int)
public void drawRect(int x, int y, int width, int height)
Graphics.drawRect
。
drawRect
方法重写,继承类
Graphics
x
的x坐标的矩形来绘制。
y
-矩形来绘制坐标。
width
-矩形来绘制宽度。
height
-矩形被拉高。
Graphics.fillRect(int, int, int, int)
,
Graphics.clearRect(int, int, int, int)
public void fillRect(int x, int y, int width, int height)
Graphics.fillRect
。
fillRect
方法重写,继承类
Graphics
x
的x坐标的矩形填充。
y
-矩形要填充的Y坐标。
width
-矩形要填充的宽度。
height
-矩形填充高度。
Graphics.clearRect(int, int, int, int)
,
Graphics.drawRect(int, int, int, int)
public void clearRect(int x, int y, int width, int height)
Graphics.clearRect
。
clearRect
方法重写,继承类
Graphics
x
的x坐标的矩形清除。
y
-矩形清除Y坐标。
width
-矩形清除宽度。
height
-矩形的高度清晰。
Graphics.fillRect(int, int, int, int)
,
Graphics.drawRect(int, int, int, int)
,
Graphics.setColor(java.awt.Color)
,
Graphics.setPaintMode()
,
Graphics.setXORMode(java.awt.Color)
public void drawRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight)
Graphics.drawRoundRect
。
drawRoundRect
方法重写,继承类
Graphics
x
的x坐标的矩形来绘制。
y
-矩形来绘制坐标。
width
-矩形来绘制宽度。
height
-矩形被拉高。
arcWidth
-在四角圆弧的横径。
arcHeight
-在四角圆弧垂直直径。
Graphics.fillRoundRect(int, int, int, int, int, int)
public void fillRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight)
Graphics.fillRoundRect
。
fillRoundRect
方法重写,继承类
Graphics
x
的x坐标的矩形填充。
y
-矩形要填充的Y坐标。
width
-矩形要填充的宽度。
height
-矩形填充高度。
arcWidth
-在四角圆弧的横径。
arcHeight
-在四角圆弧垂直直径。
Graphics.drawRoundRect(int, int, int, int, int, int)
public void drawLine(int x1, int y1, int x2, int y2)
Graphics.drawLine
。
public void draw3DRect(int x, int y, int width, int height, boolean raised)
Graphics.draw3DRect
。
draw3DRect
方法重写,继承类
Graphics
x
的x坐标的矩形来绘制。
y
-矩形来绘制坐标。
width
-矩形来绘制宽度。
height
-矩形被拉高。
raised
-一个布尔值,确定矩形似乎是凸起的表面或渗入表面。
Graphics.fill3DRect(int, int, int, int, boolean)
public void fill3DRect(int x, int y, int width, int height, boolean raised)
Graphics.fill3DRect
。
fill3DRect
方法重写,继承类
Graphics
x
的x坐标的矩形填充。
y
-矩形要填充的Y坐标。
width
-矩形要填充的宽度。
height
-矩形填充高度。
raised
-一个布尔值,确定矩形似乎是凸起的表面或蚀刻的表面。
Graphics.draw3DRect(int, int, int, int, boolean)
public void drawOval(int x, int y, int width, int height)
Graphics.drawOval
。
drawOval
方法重写,继承类
Graphics
x
的x坐标的椭圆形的左上角可以得出。
y
-椭圆的左上角可以得出Y坐标。
width
-椭圆来绘制宽度。
height
-椭圆来绘制的高度。
Graphics.fillOval(int, int, int, int)
public void fillOval(int x, int y, int width, int height)
Graphics.fillOval
。
fillOval
方法重写,继承类
Graphics
x
的x坐标的椭圆形的左上角填写。
y
-椭圆的左上角要填充的Y坐标。
width
-椭圆要填充的宽度。
height
-椭圆形充满高度。
Graphics.drawOval(int, int, int, int)
public void drawArc(int x, int y, int width, int height, int startAngle, int arcAngle)
Graphics.drawArc
。
drawArc
方法重写,继承类
Graphics
x
的x坐标的圆弧的左上角可以得出。
y
-电弧的左上角可以得出Y坐标。
width
-电弧被吸引的宽度。
height
-电弧被吸引的高度。
startAngle
开始-角。
arcAngle
-弧角的程度,相对于起始角。
Graphics.fillArc(int, int, int, int, int, int)
public void fillArc(int x, int y, int width, int height, int startAngle, int arcAngle)
Graphics.fillArc
。
fillArc
方法重写,继承类
Graphics
x
的x坐标的圆弧的左上角填写。
y
-电弧的左上角要填充的Y坐标。
width
-弧要填充的宽度。
height
-电弧被填充的高度。
startAngle
开始-角。
arcAngle
-弧角的程度,相对于起始角。
Graphics.drawArc(int, int, int, int, int, int)
public void drawPolyline(int[] xPoints, int[] yPoints, int nPoints)
Graphics.drawPolyline
。
drawPolyline
方法重写,继承类
Graphics
xPoints
x点的数组
yPoints
- Y点数组
nPoints
-点总数
Graphics.drawPolygon(int[], int[], int)
public void drawPolygon(int[] xPoints, int[] yPoints, int nPoints)
Graphics.drawPolygon
。
drawPolygon
方法重写,继承类
Graphics
xPoints
-一系列的
x
坐标。
yPoints
-一系列的
y
坐标。
nPoints
-总点数。
Graphics.drawPolyline(int[], int[], int)
public void fillPolygon(int[] xPoints, int[] yPoints, int nPoints)
Graphics.fillPolygon
。
fillPolygon
方法重写,继承类
Graphics
xPoints
-一系列的
x
坐标。
yPoints
-一系列的
y
坐标。
nPoints
-总点数。
Graphics.drawPolygon(int[], int[], int)
public void drawString(String aString, int x, int y)
Graphics.drawString
。
drawString
方法重写,继承类
Graphics
aString
-要绘制的字符串。
x
的X坐标。
y
的Y坐标。
Graphics.drawBytes(byte[], int, int, int, int)
,
Graphics.drawChars(char[], int, int, int, int)
public void drawString(AttributedCharacterIterator iterator, int x, int y)
Graphics.drawString
。
drawString
方法重写,继承类
Graphics
iterator
-迭代器的文本要画
x
的X坐标。
y
的Y坐标。
Graphics.drawBytes(byte[], int, int, int, int)
,
Graphics.drawChars(char[], int, int, int, int)
public void drawBytes(byte[] data, int offset, int length, int x, int y)
Graphics.drawBytes
。
drawBytes
方法重写,继承类
Graphics
data
-要绘制的数据
offset
的起始偏移量的数据
length
-字节数,绘制
x
-文本的基线坐标
y
-文本的基线坐标
Graphics.drawChars(char[], int, int, int, int)
,
Graphics.drawString(java.lang.String, int, int)
public void drawChars(char[] data, int offset, int length, int x, int y)
Graphics.drawChars
。
drawChars
方法重写,继承类
Graphics
data
-被绘制字符数组
offset
的起始偏移量的数据
length
-字符数可以得出
x
-文本的基线坐标
y
-文本的基线坐标
Graphics.drawBytes(byte[], int, int, int, int)
,
Graphics.drawString(java.lang.String, int, int)
public boolean drawImage(Image img, int x, int y, ImageObserver observer)
Graphics.drawImage
。
drawImage
方法重写,继承类
Graphics
img
-指定要绘制的图像。如果这个方法不
img
是空的。
x
的X坐标。
y
的Y坐标。
observer
对象有更多的图像转换通知。
false
如果图像像素仍在改变;
true
否则。
Image
,
ImageObserver
,
ImageObserver.imageUpdate(java.awt.Image, int, int, int, int, int)
public boolean drawImage(Image img, int x, int y, int width, int height, ImageObserver observer)
Graphics.drawImage
。
drawImage
方法重写,继承类
Graphics
img
-指定要绘制的图像。如果这个方法不
img
是空的。
x
的X坐标。
y
的Y坐标。
width
-矩形的宽度。
height
-矩形的高度。
observer
对象有更多的图像转换通知。
false
如果图像像素仍在改变;
true
否则。
Image
,
ImageObserver
,
ImageObserver.imageUpdate(java.awt.Image, int, int, int, int, int)
public boolean drawImage(Image img, int x, int y, Color bgcolor, ImageObserver observer)
Graphics.drawImage
。
drawImage
方法重写,继承类
Graphics
img
-指定要绘制的图像。如果这个方法不
img
是空的。
x
的X坐标。
y
的Y坐标。
bgcolor
-背景颜色来画图像的透明部分下。
observer
对象有更多的图像转换通知。
false
如果图像像素仍在改变;
true
否则。
Image
,
ImageObserver
,
ImageObserver.imageUpdate(java.awt.Image, int, int, int, int, int)
public boolean drawImage(Image img, int x, int y, int width, int height, Color bgcolor, ImageObserver observer)
Graphics.drawImage
。
drawImage
方法重写,继承类
Graphics
img
-指定要绘制的图像。如果这个方法不
img
是空的。
x
的X坐标。
y
的Y坐标。
width
-矩形的宽度。
height
-矩形的高度。
bgcolor
-背景颜色来画图像的透明部分下。
observer
对象有更多的图像转换通知。
false
如果图像像素仍在改变;
true
否则。
Image
,
ImageObserver
,
ImageObserver.imageUpdate(java.awt.Image, int, int, int, int, int)
public boolean drawImage(Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, ImageObserver observer)
Graphics.drawImage
。
drawImage
方法重写,继承类
Graphics
img
-指定要绘制的图像。如果这个方法不
img
是空的。
dx1
-目标矩形的第一个角点的X坐标。
dy1
-目标矩形的第一个角点的Y坐标。
dx2
-目标矩形的第二角的x坐标。
dy2
-目标矩形的第二角的y坐标。
sx1
-源矩形的第一个角点的X坐标。
sy1
-源矩形的第一个角点的Y坐标。
sx2
-源矩形的第二角的x坐标。
sy2
-源矩形的第二角的y坐标。
observer
对象有更多的图像缩放和转换的通知。
false
如果图像像素仍在改变;
true
否则。
Image
,
ImageObserver
,
ImageObserver.imageUpdate(java.awt.Image, int, int, int, int, int)
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)
Graphics.drawImage
。
drawImage
方法重写,继承类
Graphics
img
-指定要绘制的图像。如果这个方法不
img
是空的。
dx1
-目标矩形的第一个角点的X坐标。
dy1
-目标矩形的第一个角点的Y坐标。
dx2
-目标矩形的第二角的x坐标。
dy2
-目标矩形的第二角的y坐标。
sx1
-源矩形的第一个角点的X坐标。
sy1
-源矩形的第一个角点的Y坐标。
sx2
-源矩形的第二角的x坐标。
sy2
-源矩形的第二角的y坐标。
bgcolor
-背景颜色来画图像的透明部分下。
observer
对象有更多的图像缩放和转换的通知。
false
如果图像像素仍在改变;
true
否则。
Image
,
ImageObserver
,
ImageObserver.imageUpdate(java.awt.Image, int, int, int, int, int)
public void copyArea(int x, int y, int width, int height, int destX, int destY)
Graphics.copyArea
。
public void dispose()
Graphics.dispose
。
dispose
方法重写,继承类
Graphics
Graphics.finalize()
,
Component.paint(java.awt.Graphics)
,
Component.update(java.awt.Graphics)
,
Component.getGraphics()
,
Graphics.create()
public boolean isDrawingBuffer()
public void setDebugOptions(int options)
public int getDebugOptions()
setDebugOptions(int)
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.