| |||||||||
摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 |
javax.swing
类 DebugGraphics
java.lang.Object java.awt.Graphics javax.swing.DebugGraphics
public class DebugGraphics
- extends Graphics
支持图形调试的图形子类。重写 Graphics 中的大多数方法。DebugGraphics 对象很少通过手工创建。它们通常在 JComponent 的 debugGraphicsOptions 因使用 setDebugGraphicsOptions() 方法而发生更改时自动创建。
注:必须关闭双缓冲来使用 DebugGraphics:RepaintManager repaintManager = RepaintManager.currentManager(component); repaintManager.setDoubleBufferingEnabled(false);
- 另请参见:
JComponent.setDebugGraphicsOptions(int)
,RepaintManager.currentManager(java.awt.Component)
,RepaintManager.setDoubleBufferingEnabled(boolean)
字段摘要 | |
---|---|
static int | BUFFERED_OPTION 在一个单独的 Frame 中显示已缓冲的操作。 |
static int | FLASH_OPTION Flash 图形操作。 |
static int | LOG_OPTION 记录图形操作。 |
static int | NONE_OPTION 不要调试图形操作。 |
构造方法摘要 | |
---|---|
DebugGraphics() 构造一个支持减速绘制的新调试图形上下文。 | |
DebugGraphics(Graphics graphics) 根据现有图形上下文构造一个调试图形上下文,该上下文支持减慢绘制。 | |
DebugGraphics(Graphics graphics, JComponent component) 根据现有图形上下文构造一个调试图形上下文,该上下文可以减慢指定组件的绘制。 |
方法摘要 | |
---|---|
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() 返回用于 flash 绘制操作的 Color。 |
static int | flashCount() 绘制操作将要 flash 的次数。 |
static int | flashTime() 返回绘制操作 flash 的时间延迟。 |
Shape | getClip() 重写 Graphics.getClip 。 |
Rectangle | getClipBounds() 重写 Graphics.getClipBounds 。 |
Color | getColor() 返回用于文本绘制操作的 Color。 |
int | getDebugOptions() 返回此 DebugGraphics 的当前调试选项。 |
Font | getFont() 返回用于文本绘制操作的 Font。 |
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) 设置用于 flash 绘制操作的 Color。 |
static void | setFlashCount(int flashCount) 设置绘制操作将要 flash 的次数。 |
static void | setFlashTime(int flashTime) 设置绘制操作 flash 的时间延迟。 |
void | setFont(Font aFont) 设置用于文本绘制操作的 Font。 |
static void | setLogStream(PrintStream stream) 设置 DebugGraphics 在其中记录绘制操作的流。 |
void | setPaintMode() 重写 Graphics.setPaintMode 。 |
void | setXORMode(Color aColor) 重写 Graphics.setXORMode 。 |
void | translate(int x, int y) 重写 Graphics.translate 。 |
从类 java.awt.Graphics 继承的方法 |
---|
drawPolygon, fillPolygon, finalize, getClipBounds, getClipRect, hitClip, toString |
从类 java.lang.Object 继承的方法 |
---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
字段详细信息 |
---|
LOG_OPTION
public static final int LOG_OPTION
- 记录图形操作。
- 另请参见:
- 常量字段值
FLASH_OPTION
public static final int FLASH_OPTION
- Flash 图形操作。
- 另请参见:
- 常量字段值
BUFFERED_OPTION
public static final int BUFFERED_OPTION
- 在一个单独的
Frame
中显示已缓冲的操作。- 另请参见:
- 常量字段值
NONE_OPTION
public static final int NONE_OPTION
- 不要调试图形操作。
- 另请参见:
- 常量字段值
构造方法详细信息 |
---|
DebugGraphics
public DebugGraphics()
- 构造一个支持减速绘制的新调试图形上下文。
DebugGraphics
public DebugGraphics(Graphics graphics, JComponent component)
- 根据现有图形上下文构造一个调试图形上下文,该上下文可以减慢指定组件的绘制。
- 参数:
graphics
- 要减慢的 Graphics 上下文component
- 要缓慢绘制的 JComponent
DebugGraphics
public DebugGraphics(Graphics graphics)
- 根据现有图形上下文构造一个调试图形上下文,该上下文支持减慢绘制。
- 参数:
graphics
- 要减慢的 Graphics 上下文
方法详细信息 |
---|
create
public Graphics create()
create
public Graphics create(int x, int y, int width, int height)
- 重写
Graphics.create
来返回一个 DebugGraphics 对象。 - 参数:
x
- x 坐标。y
- y 坐标。width
- 剪贴矩形的宽度。height
- 剪贴矩形的高度。- 返回:
- 新的图形上下文。
- 另请参见:
Graphics.translate(int, int)
,Graphics.clipRect(int, int, int, int)