public class DebugGraphics extends Graphics
ノート: DebugGraphicsを使うには、ダブル・バッファリングをオフに設定しなければいけません。RepaintManager repaintManager = RepaintManager.currentManager(component); repaintManager.setDoubleBufferingEnabled(false);
| 修飾子と型 | フィールド | 説明 |
|---|---|---|
static int |
BUFFERED_OPTION |
独立した
Frameでのバッファ利用処理を示します。 |
static int |
FLASH_OPTION |
グラフィックス処理をフラッシュします。
|
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() |
描画処理をフラッシュするのに使う色を返します。
|
static int |
flashCount() |
描画処理がフラッシュする回数を返します。
|
static int |
flashTime() |
描画処理フラッシュの時間遅延を返します。
|
Shape |
getClip() |
Graphics.getClipをオーバーライドします。 |
Rectangle |
getClipBounds() |
Graphics.getClipBoundsをオーバーライドします。 |
Color |
getColor() |
テキスト描画処理に使う色を返します。
|
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) |
描画処理をフラッシュするのに使う色を設定します。
|
static void |
setFlashCount(int flashCount) |
描画処理がフラッシュする回数を設定します。
|
static void |
setFlashTime(int flashTime) |
描画処理フラッシュの時間遅延を設定します。
|
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をオーバーライドします。 |
drawPolygon, fillPolygon, finalize, getClipBounds, getClipRect, hitClip, toStringpublic 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 - ゆっくりした速度で描画されるJComponentpublic 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、クラスGraphicsx - 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)
public Font getFont()
getFont、クラスGraphicssetFont(java.awt.Font)public void setColor(Color aColor)
setColor、クラスGraphicsaColor - 新しい描画色。Color, Graphics.getColor()public Color getColor()
getColor、クラスGraphicssetColor(java.awt.Color)public FontMetrics getFontMetrics()
Graphics.getFontMetricsをオーバーライドします。getFontMetrics、クラスGraphicsGraphics.getFont(), FontMetrics, Graphics.getFontMetrics(Font)public FontMetrics getFontMetrics(Font f)
Graphics.getFontMetricsをオーバーライドします。getFontMetrics、クラスGraphicsf - 指定されたフォントGraphics.getFont(), FontMetrics, Graphics.getFontMetrics()public void translate(int x,
int y)
Graphics.translateをオーバーライドします。public void setPaintMode()
Graphics.setPaintModeをオーバーライドします。setPaintMode、クラスGraphicspublic void setXORMode(Color aColor)
Graphics.setXORModeをオーバーライドします。setXORMode、クラスGraphicsaColor - XORの交代色public Rectangle getClipBounds()
Graphics.getClipBoundsをオーバーライドします。getClipBounds、クラスGraphicsnull。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、クラスGraphicsx - 交差してクリップする矩形の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、クラスGraphicsx - 新しいクリップ矩形のx座標。y - 新しいクリップ矩形のy座標。width - 新しいクリップ矩形の幅。height - 新しいクリップ矩形の高さ。Graphics.clipRect(int, int, int, int), Graphics.setClip(Shape), Graphics.getClip()public Shape getClip()
Graphics.getClipをオーバーライドします。getClip、クラスGraphicsShapeオブジェクト。クリップが設定されていない場合は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、クラスGraphicsclip - クリップ設定に使用するShapeGraphics.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、クラスGraphicsx - 描画される矩形のx座標。y - 描画される矩形の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、クラスGraphicsx - 塗りつぶされる矩形の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、クラスGraphicsx - クリア対象の矩形の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、クラスGraphicsx - 描画される矩形のx座標。y - 描画される矩形のy座標。width - 描画される矩形の幅。height - 描画される矩形の高さ。arcWidth - 4隅にある弧の水平方向の直径。arcHeight - 4隅にある弧の垂直方向の直径。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、クラスGraphicsx - 塗りつぶされる矩形のx座標。y - 塗りつぶされる矩形のy座標。width - 塗りつぶされる矩形の幅。height - 塗りつぶされる矩形の高さ。arcWidth - 4隅にある弧の水平方向の直径。arcHeight - 4隅にある弧の垂直方向の直径。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、クラスGraphicsx - 描画される矩形のx座標。y - 描画される矩形のy座標。width - 描画される矩形の幅。height - 描画される矩形の高さ。raised - 矩形が表面から浮き出たように見えるか、または表面がへこんだように見えるかを決定するboolean値。Graphics.fill3DRect(int, int, int, int, boolean)public void fill3DRect(int x,
int y,
int width,
int height,
boolean raised)
Graphics.fill3DRectをオーバーライドします。fill3DRect、クラスGraphicsx - 塗りつぶされる矩形のx座標。y - 塗りつぶされる矩形のy座標。width - 塗りつぶされる矩形の幅。height - 塗りつぶされる矩形の高さ。raised - 矩形が表面から浮き出たように見えるか、または表面に彫り込まれたように見えるかを決定するboolean値。Graphics.draw3DRect(int, int, int, int, boolean)public void drawOval(int x,
int y,
int width,
int height)
Graphics.drawOvalをオーバーライドします。drawOval、クラスGraphicsx - 描画される楕円の左上隅の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、クラスGraphicsx - 塗りつぶされる楕円の左上隅の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、クラスGraphicsx - 描画される弧の左上隅の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、クラスGraphicsx - 塗りつぶされる弧の左上隅の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、クラスGraphicsxPoints - x点の配列yPoints - y点の配列nPoints - 点の総数Graphics.drawPolygon(int[], int[], int)public void drawPolygon(int[] xPoints,
int[] yPoints,
int nPoints)
Graphics.drawPolygonをオーバーライドします。drawPolygon、クラスGraphicsxPoints - x座標の配列。yPoints - y座標の配列。nPoints - 点の総数。Graphics.fillPolygon(int[], int[], int), Graphics.drawPolyline(int[], int[], int)public void fillPolygon(int[] xPoints,
int[] yPoints,
int nPoints)
Graphics.fillPolygonをオーバーライドします。fillPolygon、クラスGraphicsxPoints - x座標の配列。yPoints - y座標の配列。nPoints - 点の総数。Graphics.drawPolygon(int[], int[], int)public void drawString(String aString, int x, int y)
Graphics.drawStringをオーバーライドします。drawString、クラスGraphicsaString - 描画される文字列。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、クラスGraphicsiterator - 描画されるテキストを持つイテレータ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、クラスGraphicsdata - 描画されるデータoffset - データ内の開始オフセットlength - 描画されるバイト数x - テキストのベースラインのx座標y - テキストのベースラインの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、クラスGraphicsdata - 描画される文字の配列offset - データ内の開始オフセットlength - 描画される文字数x - テキストのベースラインのx座標y - テキストのベースラインの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、クラスGraphicsimg - 描画される指定されたイメージ。 imgがnullである場合、このメソッドは何も行いません。 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、クラスGraphicsimg - 描画される指定されたイメージ。 imgがnullである場合、このメソッドは何も行いません。 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、クラスGraphicsimg - 描画される指定されたイメージ。 imgがnullである場合、このメソッドは何も行いません。 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、クラスGraphicsimg - 描画される指定されたイメージ。 imgがnullである場合、このメソッドは何も行いません。 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、クラスGraphicsimg - 描画される指定されたイメージ。 imgがnullである場合、このメソッドは何も行いません。 dx1 - デスティネーション矩形の最初の隅のx座標。dy1 - デスティネーション矩形の最初の隅のy座標。dx2 - デスティネーション矩形の2番目の隅のx座標。dy2 - デスティネーション矩形の2番目の隅のy座標。sx1 - ソース矩形の最初の隅のx座標。sy1 - ソース矩形の最初の隅のy座標。sx2 - ソース矩形の2番目の隅のx座標。sy2 - ソース矩形の2番目の隅の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、クラスGraphicsimg - 描画される指定されたイメージ。 imgがnullである場合、このメソッドは何も行いません。 dx1 - デスティネーション矩形の最初の隅のx座標。dy1 - デスティネーション矩形の最初の隅のy座標。dx2 - デスティネーション矩形の2番目の隅のx座標。dy2 - デスティネーション矩形の2番目の隅のy座標。sx1 - ソース矩形の最初の隅のx座標。sy1 - ソース矩形の最初の隅のy座標。sx2 - ソース矩形の2番目の隅のx座標。sy2 - ソース矩形の2番目の隅の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をオーバーライドします。public boolean isDrawingBuffer()
public void setDebugOptions(int options)
public int getDebugOptions()
setDebugOptions(int) バグまたは機能を送信
詳細なAPIリファレンスおよび開発者ドキュメントについては、Java SEのドキュメントを参照してください。 そのドキュメントには、概念的な概要、用語の定義、回避方法、有効なコード例などの、開発者を対象にしたより詳細な説明が含まれています。
Copyright © 1993, 2025, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Documentation Redistribution Policyも参照してください。