java.lang.Object
java.awt.Graphics
javax.swing.DebugGraphics
public class DebugGraphics extends Graphics
グラフィックスのデバッグをサポートするGraphicsのサブクラスです。 Graphicsからのほとんどのメソッドをオーバーライドします。 DebugGraphicsオブジェクトを手作業で構築することはほとんどありません。 このようなオブジェクトは通常、JComponentのdebugGraphicsOptionsがsetDebugGraphicsOptions()メソッドを使って変更されたときに自動的に作成されます。
ノート: DebugGraphicsを使うには、ダブル・バッファリングをオフに設定しなければいけません。RepaintManager repaintManager = RepaintManager.currentManager(component); repaintManager.setDoubleBufferingEnabled(false);
- 導入されたバージョン:
- 1.2
- 関連項目:
-
フィールドのサマリー
フィールド修飾子と型フィールド説明static final int独立したFrameでのバッファ利用処理を示します。static final intグラフィックス処理をフラッシュします。static final intグラフィックス処理のログをとります。static final intグラフィックス処理をデバッグしません。 -
コンストラクタのサマリー
コンストラクタコンストラクタ説明速度の遅い描画をサポートする新しいデバッグ・グラフィックス・コンテキストを構築します。DebugGraphics(Graphics graphics) 既存のグラフィックス・コンテキストから、速度の遅い描画をサポートするデバッグ・グラフィックス・コンテキストを構築します。DebugGraphics(Graphics graphics, JComponent component) 既存のグラフィックス・コンテキストから、指定されたコンポーネントの描画速度を遅くするデバッグ・グラフィックス・コンテキストを構築します。 -
メソッドのサマリー
修飾子と型メソッド説明voidclearRect(int x, int y, int width, int height) Graphics.clearRectをオーバーライドします。voidclipRect(int x, int y, int width, int height) Graphics.clipRectをオーバーライドします。voidcopyArea(int x, int y, int width, int height, int destX, int destY) Graphics.copyAreaをオーバーライドします。create()Graphics.createをオーバーライドして、DebugGraphicsオブジェクトを返すようにします。create(int x, int y, int width, int height) Graphics.createをオーバーライドして、DebugGraphicsオブジェクトを返すようにします。voiddispose()Graphics.disposeをオーバーライドします。voiddraw3DRect(int x, int y, int width, int height, boolean raised) Graphics.draw3DRectをオーバーライドします。voiddrawArc(int x, int y, int width, int height, int startAngle, int arcAngle) Graphics.drawArcをオーバーライドします。voiddrawBytes(byte[] data, int offset, int length, int x, int y) Graphics.drawBytesをオーバーライドします。voiddrawChars(char[] data, int offset, int length, int x, int y) Graphics.drawCharsをオーバーライドします。booleandrawImage(Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, Color bgcolor, ImageObserver observer) Graphics.drawImageをオーバーライドします。booleandrawImage(Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, ImageObserver observer) Graphics.drawImageをオーバーライドします。booleandrawImage(Image img, int x, int y, int width, int height, Color bgcolor, ImageObserver observer) Graphics.drawImageをオーバーライドします。booleandrawImage(Image img, int x, int y, int width, int height, ImageObserver observer) Graphics.drawImageをオーバーライドします。booleandrawImage(Image img, int x, int y, Color bgcolor, ImageObserver observer) Graphics.drawImageをオーバーライドします。booleandrawImage(Image img, int x, int y, ImageObserver observer) Graphics.drawImageをオーバーライドします。voiddrawLine(int x1, int y1, int x2, int y2) Graphics.drawLineをオーバーライドします。voiddrawOval(int x, int y, int width, int height) Graphics.drawOvalをオーバーライドします。voiddrawPolygon(int[] xPoints, int[] yPoints, int nPoints) Graphics.drawPolygonをオーバーライドします。voiddrawPolyline(int[] xPoints, int[] yPoints, int nPoints) Graphics.drawPolylineをオーバーライドします。voiddrawRect(int x, int y, int width, int height) Graphics.drawRectをオーバーライドします。voiddrawRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight) Graphics.drawRoundRectをオーバーライドします。voiddrawString(String aString, int x, int y) Graphics.drawStringをオーバーライドします。voiddrawString(AttributedCharacterIterator iterator, int x, int y) Graphics.drawStringをオーバーライドします。voidfill3DRect(int x, int y, int width, int height, boolean raised) Graphics.fill3DRectをオーバーライドします。voidfillArc(int x, int y, int width, int height, int startAngle, int arcAngle) Graphics.fillArcをオーバーライドします。voidfillOval(int x, int y, int width, int height) Graphics.fillOvalをオーバーライドします。voidfillPolygon(int[] xPoints, int[] yPoints, int nPoints) Graphics.fillPolygonをオーバーライドします。voidfillRect(int x, int y, int width, int height) Graphics.fillRectをオーバーライドします。voidfillRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight) Graphics.fillRoundRectをオーバーライドします。static Color描画処理をフラッシュするのに使う色を返します。static int描画処理がフラッシュする回数を返します。static int描画処理フラッシュの時間遅延を返します。getClip()Graphics.getClipをオーバーライドします。Graphics.getClipBoundsをオーバーライドします。getColor()テキスト描画処理に使う色を返します。intDebugGraphicsの現在のデバッグ・オプションを返します。getFont()テキスト描画処理に使うFontを返します。Graphics.getFontMetricsをオーバーライドします。Graphics.getFontMetricsをオーバーライドします。booleandrawingBufferの値を返します。static PrintStreamDebugGraphicsが描画処理のログをとるストリームを返します。voidsetClip(int x, int y, int width, int height) Graphics.setClipをオーバーライドします。voidGraphics.setClipをオーバーライドします。void線と形状を描画し塗りつぶすのに使う色を設定します。voidsetDebugOptions(int options) 各グラフィックス処理についての診断情報を有効または無効にします。static voidsetFlashColor(Color flashColor) 描画処理をフラッシュするのに使う色を設定します。static voidsetFlashCount(int flashCount) 描画処理がフラッシュする回数を設定します。static voidsetFlashTime(int flashTime) 描画処理フラッシュの時間遅延を設定します。voidテキスト描画処理に使うFontを設定します。static voidsetLogStream(PrintStream stream) DebugGraphicsが描画処理のログをとるストリームを設定します。voidGraphics.setPaintModeをオーバーライドします。voidsetXORMode(Color aColor) Graphics.setXORModeをオーバーライドします。voidtranslate(int x, int y) Graphics.translateをオーバーライドします。クラスjava.awt.Graphicsで宣言されたメソッド
drawPolygon, fillPolygon, finalize, getClipBounds, getClipRect, hitClip, toString
-
フィールド詳細
-
LOG_OPTION
public static final int LOG_OPTIONグラフィックス処理のログをとります。- 関連項目:
-
FLASH_OPTION
public static final int FLASH_OPTIONグラフィックス処理をフラッシュします。- 関連項目:
-
BUFFERED_OPTION
public static final int BUFFERED_OPTION独立したFrameでのバッファ利用処理を示します。- 関連項目:
-
NONE_OPTION
public static final int NONE_OPTIONグラフィックス処理をデバッグしません。- 関連項目:
-
-
コンストラクタの詳細
-
DebugGraphics
public DebugGraphics()速度の遅い描画をサポートする新しいデバッグ・グラフィックス・コンテキストを構築します。NOTE: このコンストラクタは、アプリケーションによってコールしないでください。内部使用専用です。 直接コールすると、使用不可能なインスタンスが作成されます。
-
DebugGraphics
public DebugGraphics(Graphics graphics, JComponent component) 既存のグラフィックス・コンテキストから、指定されたコンポーネントの描画速度を遅くするデバッグ・グラフィックス・コンテキストを構築します。- パラメータ:
graphics- 描画速度を遅くするグラフィックス・コンテキストcomponent- ゆっくりした速度で描画されるJComponent
-
DebugGraphics
public DebugGraphics(Graphics graphics) 既存のグラフィックス・コンテキストから、速度の遅い描画をサポートするデバッグ・グラフィックス・コンテキストを構築します。- パラメータ:
graphics- 描画速度を遅くするグラフィックス・コンテキスト
-
-
メソッドの詳細
-
create
public Graphics create()Graphics.createをオーバーライドして、DebugGraphicsオブジェクトを返すようにします。 -
create
public Graphics create(int x, int y, int width, int height) Graphics.createをオーバーライドして、DebugGraphicsオブジェクトを返すようにします。 -
setFlashColor
public static void setFlashColor(Color flashColor) 描画処理をフラッシュするのに使う色を設定します。- パラメータ:
flashColor- 描画操作をフラッシュするために使用されるColor
-
flashColor
public static Color flashColor()描画処理をフラッシュするのに使う色を返します。- 戻り値:
- 描画操作をフラッシュするために使用されるColor
- 関連項目:
-
setFlashTime
public static void setFlashTime(int flashTime) 描画処理フラッシュの時間遅延を設定します。- パラメータ:
flashTime- 描画動作の時間遅れが点滅
-
flashTime
public static int flashTime()描画処理フラッシュの時間遅延を返します。- 戻り値:
- 描画動作の時間遅れが点滅
- 関連項目:
-
setFlashCount
public static void setFlashCount(int flashCount) 描画処理がフラッシュする回数を設定します。- パラメータ:
flashCount- 描画操作が点滅する回数
-
flashCount
public static int flashCount()描画処理がフラッシュする回数を返します。- 戻り値:
- 描画操作が点滅する回数
- 関連項目:
-
setLogStream
public static void setLogStream(PrintStream stream) DebugGraphicsが描画処理のログをとるストリームを設定します。- パラメータ:
stream- DebugGraphicsが描画操作を記録するストリーム
-
logStream
public static PrintStream logStream()DebugGraphicsが描画処理のログをとるストリームを返します。- 戻り値:
- DebugGraphicsが描画操作を記録するストリーム
- 関連項目:
-
setFont
public void setFont(Font aFont) テキスト描画処理に使うFontを設定します。 -
getFont
public Font getFont()テキスト描画処理に使うFontを返します。 -
setColor
public void setColor(Color aColor) 線と形状を描画し塗りつぶすのに使う色を設定します。 -
getColor
public Color getColor()テキスト描画処理に使う色を返します。 -
getFontMetrics
public FontMetrics getFontMetrics()Graphics.getFontMetricsをオーバーライドします。- オーバーライド:
getFontMetrics、クラスGraphics- 戻り値:
- このグラフィックス・コンテキストの現在のフォントのフォント・メトリックス。
- 関連項目:
-
getFontMetrics
public FontMetrics getFontMetrics(Font f) Graphics.getFontMetricsをオーバーライドします。- 定義:
getFontMetrics、クラスGraphics- パラメータ:
f- 指定されたフォント- 戻り値:
- 指定されたフォントのフォント・メトリックス。
- 関連項目:
-
translate
public void translate(int x, int y) Graphics.translateをオーバーライドします。 -
setPaintMode
public void setPaintMode()Graphics.setPaintModeをオーバーライドします。- 定義:
setPaintMode、クラスGraphics
-
setXORMode
public void setXORMode(Color aColor) Graphics.setXORModeをオーバーライドします。- 定義:
setXORMode、クラスGraphics- パラメータ:
aColor- XORの交代色
-
getClipBounds
public Rectangle getClipBounds()Graphics.getClipBoundsをオーバーライドします。- 定義:
getClipBounds、クラスGraphics- 戻り値:
- 現在のクリッピング領域の境界の矩形。クリップが設定されていない場合は
null。 - 関連項目:
-
clipRect
public void clipRect(int x, int y, int width, int height) Graphics.clipRectをオーバーライドします。 -
setClip
public void setClip(int x, int y, int width, int height) Graphics.setClipをオーバーライドします。 -
getClip
public Shape getClip()Graphics.getClipをオーバーライドします。 -
setClip
public void setClip(Shape clip) Graphics.setClipをオーバーライドします。 -
drawRect
public void drawRect(int x, int y, int width, int height) Graphics.drawRectをオーバーライドします。 -
fillRect
public void fillRect(int x, int y, int width, int height) Graphics.fillRectをオーバーライドします。 -
clearRect
public void clearRect(int x, int y, int width, int height) Graphics.clearRectをオーバーライドします。 -
drawRoundRect
public void drawRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight) Graphics.drawRoundRectをオーバーライドします。- 定義:
drawRoundRect、クラスGraphics- パラメータ:
x- 描画される矩形のx座標。y- 描画される矩形のy座標。width- 描画される矩形の幅。height- 描画される矩形の高さ。arcWidth- 4隅にある弧の水平方向の直径。arcHeight- 4隅にある弧の垂直方向の直径。- 関連項目:
-
fillRoundRect
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- 4隅にある弧の水平方向の直径。arcHeight- 4隅にある弧の垂直方向の直径。- 関連項目:
-
drawLine
public void drawLine(int x1, int y1, int x2, int y2) Graphics.drawLineをオーバーライドします。 -
draw3DRect
public void draw3DRect(int x, int y, int width, int height, boolean raised) Graphics.draw3DRectをオーバーライドします。- オーバーライド:
draw3DRect、クラスGraphics- パラメータ:
x- 描画される矩形のx座標。y- 描画される矩形のy座標。width- 描画される矩形の幅。height- 描画される矩形の高さ。raised- 矩形が表面から浮き出たように見えるか、または表面がへこんだように見えるかを決定するboolean値。- 関連項目:
-
fill3DRect
public void fill3DRect(int x, int y, int width, int height, boolean raised) Graphics.fill3DRectをオーバーライドします。- オーバーライド:
fill3DRect、クラスGraphics- パラメータ:
x- 塗りつぶされる矩形のx座標。y- 塗りつぶされる矩形のy座標。width- 塗りつぶされる矩形の幅。height- 塗りつぶされる矩形の高さ。raised- 矩形が表面から浮き出たように見えるか、または表面に彫り込まれたように見えるかを決定するboolean値。- 関連項目:
-
drawOval
public void drawOval(int x, int y, int width, int height) Graphics.drawOvalをオーバーライドします。 -
fillOval
public void fillOval(int x, int y, int width, int height) Graphics.fillOvalをオーバーライドします。 -
drawArc
public void drawArc(int x, int y, int width, int height, int startAngle, int arcAngle) Graphics.drawArcをオーバーライドします。 -
fillArc
public void fillArc(int x, int y, int width, int height, int startAngle, int arcAngle) Graphics.fillArcをオーバーライドします。 -
drawPolyline
public void drawPolyline(int[] xPoints, int[] yPoints, int nPoints) Graphics.drawPolylineをオーバーライドします。- 定義:
drawPolyline、クラスGraphics- パラメータ:
xPoints- x点の配列yPoints- y点の配列nPoints- 点の総数- 関連項目:
-
drawPolygon
public void drawPolygon(int[] xPoints, int[] yPoints, int nPoints) Graphics.drawPolygonをオーバーライドします。- 定義:
drawPolygon、クラスGraphics- パラメータ:
xPoints-x座標の配列。yPoints-y座標の配列。nPoints- 点の総数- 関連項目:
-
fillPolygon
public void fillPolygon(int[] xPoints, int[] yPoints, int nPoints) Graphics.fillPolygonをオーバーライドします。- 定義:
fillPolygon、クラスGraphics- パラメータ:
xPoints-x座標の配列。yPoints-y座標の配列。nPoints- 点の総数- 関連項目:
-
drawString
public void drawString(String aString, int x, int y) Graphics.drawStringをオーバーライドします。- 定義:
drawString、クラスGraphics- パラメータ:
aString- 描画される文字列。x- x座標。y- y座標。- 関連項目:
-
drawString
public void drawString(AttributedCharacterIterator iterator, int x, int y) Graphics.drawStringをオーバーライドします。- 定義:
drawString、クラスGraphics- パラメータ:
iterator- 描画されるテキストを持つイテレータx- x座標。y- y座標。- 関連項目:
-
drawBytes
public void drawBytes(byte[] data, int offset, int length, int x, int y) Graphics.drawBytesをオーバーライドします。 -
drawChars
public void drawChars(char[] data, int offset, int length, int x, int y) Graphics.drawCharsをオーバーライドします。 -
drawImage
public boolean drawImage(Image img, int x, int y, ImageObserver observer) Graphics.drawImageをオーバーライドします。 -
drawImage
public boolean drawImage(Image img, int x, int y, int width, int height, ImageObserver observer) Graphics.drawImageをオーバーライドします。 -
drawImage
public boolean drawImage(Image img, int x, int y, Color bgcolor, ImageObserver observer) Graphics.drawImageをオーバーライドします。 -
drawImage
public boolean drawImage(Image img, int x, int y, int width, int height, Color bgcolor, ImageObserver observer) Graphics.drawImageをオーバーライドします。 -
drawImage
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がnullである場合、このメソッドは何も行いません。dx1- デスティネーション矩形の最初の隅のx座標。dy1- デスティネーション矩形の最初の隅のy座標。dx2- デスティネーション矩形の2番目の隅のx座標。dy2- デスティネーション矩形の2番目の隅のy座標。sx1- ソース矩形の最初の隅のx座標。sy1- ソース矩形の最初の隅のy座標。sx2- ソース矩形の2番目の隅のx座標。sy2- ソース矩形の2番目の隅のy座標。observer- イメージのさらに多くの部分がスケーリングおよび変換されたときに通知を受けるオブジェクト。- 戻り値:
- イメージ・ピクセルがまだ変化している場合は
false、それ以外の場合はtrue。 - 関連項目:
-
drawImage
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が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。 - 関連項目:
-
copyArea
public void copyArea(int x, int y, int width, int height, int destX, int destY) Graphics.copyAreaをオーバーライドします。 -
dispose
public void dispose()Graphics.disposeをオーバーライドします。 -
isDrawingBuffer
public boolean isDrawingBuffer()drawingBufferの値を返します。- 戻り値:
- このオブジェクトがバッファから描画される場合はtrue
-
setDebugOptions
public void setDebugOptions(int options) 各グラフィックス処理についての診断情報を有効または無効にします。 optionsの値は、この情報の表示方法を示します。 LOG_OPTIONは、テキスト・メッセージを出力させます。 FLASH_OPTIONは、描画に数回にわたってフラッシュさせます。 BUFFERED_OPTIONは、オフスクリーン・バッファの各処理を示す新しいフレームを作成します。 optionsの値は、現在の値に対するビット単位の論理和です。 デバッグを無効にするには、NONE_OPTIONを使います。- パラメータ:
options- 診断情報の表示方法を示します。
-
getDebugOptions
public int getDebugOptions()DebugGraphicsの現在のデバッグ・オプションを返します。- 戻り値:
- このDebugGraphicsの現在のデバッグ・オプション
- 関連項目:
-