Java プラットフォーム 1.2

javax.swing
クラス DebugGraphics

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);

関連項目:
JComponent.setDebugGraphicsOptions(int), RepaintManager.currentManager(java.awt.Component), RepaintManager.setDoubleBufferingEnabled(boolean)

フィールドの概要
static int BUFFERED_OPTION
          独立したフレームでのバッファ利用処理を示します。
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(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 をオーバーライドします。
 
クラス java.awt.Graphics から継承したメソッド
drawPolygon, drawString, 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
グラフィックス処理をフラッシュします。

BUFFERED_OPTION

public static final int BUFFERED_OPTION
独立したフレームでのバッファ利用処理を示します。

NONE_OPTION

public static final int NONE_OPTION
グラフィックス処理をデバッグしません。
コンストラクタの詳細

DebugGraphics

public DebugGraphics()
速度の遅い描画をサポートする新しいデバッググラフィックスコンテキストを構築します。

DebugGraphics

public DebugGraphics(Graphics graphics,
                     JComponent component)
既存のグラフィックスコンテキストから、指定されたコンポーネントの描画速度を遅くするデバッググラフィックスコンテキストを構築します。
パラメータ:
graphics - 描画速度を遅くするグラフィックスコンテキスト
component - ゆっくりした速度で描画される JComponent

DebugGraphics

public DebugGraphics(Graphics graphics)
既存のグラフィックスコンテキストから、速度の遅い描画をサポートするデバッググラフィックスコンテキストを構築します。
パラメータ:
graphics - 描画速度を遅くするグラフィックスコンテキスト
メソッドの詳細

create

public Graphics create()
Graphics.create をオーバーライドして、DebugGraphics オブジェクトを返すようにします。
オーバーライド:
クラス Graphics 内の create

create

public Graphics create(int x,
                       int y,
                       int width,
                       int height)
Graphics.create をオーバーライドして、DebugGraphics オブジェクトを返すようにします。
オーバーライド:
クラス Graphics 内の create

setFlashColor

public static void setFlashColor(Color flashColor)
描画処理をフラッシュするのに使う色を設定します。

flashColor

public static Color flashColor()
描画処理をフラッシュするのに使う色を返します。
関連項目:
setFlashColor(java.awt.Color)

setFlashTime

public static void setFlashTime(int flashTime)
描画処理フラッシュの時間遅延を設定します。

flashTime

public static int flashTime()
描画処理フラッシュの時間遅延を返します。
関連項目:
setFlashTime(int)

setFlashCount

public static void setFlashCount(int flashCount)
描画処理がフラッシュする回数を設定します。

flashCount

public static int flashCount()
描画処理がフラッシュする回数を返します。
関連項目:
setFlashCount(int)

setLogStream

public static void setLogStream(PrintStream stream)
DebugGraphics が描画処理のログをとるストリームを設定します。

logStream

public static PrintStream logStream()
DebugGraphics が描画処理のログをとるストリームを返します。
関連項目:
setLogStream(java.io.PrintStream)

setFont

public void setFont(Font aFont)
テキスト描画処理に使うフォントを設定します。
オーバーライド:
クラス Graphics 内の setFont

getFont

public Font getFont()
テキスト描画処理に使うフォントを返します。
オーバーライド:
クラス Graphics 内の getFont
関連項目:
setFont(java.awt.Font)

setColor

public void setColor(Color aColor)
線と形状を描画し塗りつぶすのに使う色を設定します。
オーバーライド:
クラス Graphics 内の setColor

getColor

public Color getColor()
テキスト描画処理に使う色を返します。
オーバーライド:
クラス Graphics 内の getColor
関連項目:
setColor(java.awt.Color)

getFontMetrics

public FontMetrics getFontMetrics()
Graphics.getFontMetrics をオーバーライドします。
オーバーライド:
クラス Graphics 内の getFontMetrics

getFontMetrics

public FontMetrics getFontMetrics(Font f)
Graphics.getFontMetrics をオーバーライドします。
オーバーライド:
クラス Graphics 内の getFontMetrics

translate

public void translate(int x,
                      int y)
Graphics.translate をオーバーライドします。
オーバーライド:
クラス Graphics 内の translate

setPaintMode

public void setPaintMode()
Graphics.setPaintMode をオーバーライドします。
オーバーライド:
クラス Graphics 内の setPaintMode

setXORMode

public void setXORMode(Color aColor)
Graphics.setXORMode をオーバーライドします。
オーバーライド:
クラス Graphics 内の setXORMode

getClipBounds

public Rectangle getClipBounds()
Graphics.getClipBounds をオーバーライドします。
オーバーライド:
クラス Graphics 内の getClipBounds

clipRect

public void clipRect(int x,
                     int y,
                     int width,
                     int height)
Graphics.clipRect をオーバーライドします。
オーバーライド:
クラス Graphics 内の clipRect

setClip

public void setClip(int x,
                    int y,
                    int width,
                    int height)
Graphics.setClip をオーバーライドします。
オーバーライド:
クラス Graphics 内の setClip

getClip

public Shape getClip()
Graphics.getClip をオーバーライドします。
オーバーライド:
クラス Graphics 内の getClip

setClip

public void setClip(Shape clip)
Graphics.setClip をオーバーライドします。
オーバーライド:
クラス Graphics 内の setClip

drawRect

public void drawRect(int x,
                     int y,
                     int width,
                     int height)
Graphics.drawRect をオーバーライドします。
オーバーライド:
クラス Graphics 内の drawRect

fillRect

public void fillRect(int x,
                     int y,
                     int width,
                     int height)
Graphics.fillRect をオーバーライドします。
オーバーライド:
クラス Graphics 内の fillRect

clearRect

public void clearRect(int x,
                      int y,
                      int width,
                      int height)
Graphics.clearRect をオーバーライドします。
オーバーライド:
クラス Graphics 内の clearRect

drawRoundRect

public void drawRoundRect(int x,
                          int y,
                          int width,
                          int height,
                          int arcWidth,
                          int arcHeight)
Graphics.drawRoundRect をオーバーライドします。
オーバーライド:
クラス Graphics 内の drawRoundRect

fillRoundRect

public void fillRoundRect(int x,
                          int y,
                          int width,
                          int height,
                          int arcWidth,
                          int arcHeight)
Graphics.fillRoundRect をオーバーライドします。
オーバーライド:
クラス Graphics 内の fillRoundRect

drawLine

public void drawLine(int x1,
                     int y1,
                     int x2,
                     int y2)
Graphics.drawLine をオーバーライドします。
オーバーライド:
クラス Graphics 内の drawLine

draw3DRect

public void draw3DRect(int x,
                       int y,
                       int width,
                       int height,
                       boolean raised)
Graphics.draw3DRect をオーバーライドします。
オーバーライド:
クラス Graphics 内の draw3DRect

fill3DRect

public void fill3DRect(int x,
                       int y,
                       int width,
                       int height,
                       boolean raised)
Graphics.fill3DRect をオーバーライドします。
オーバーライド:
クラス Graphics 内の fill3DRect

drawOval

public void drawOval(int x,
                     int y,
                     int width,
                     int height)
Graphics.drawOval をオーバーライドします。
オーバーライド:
クラス Graphics 内の drawOval

fillOval

public void fillOval(int x,
                     int y,
                     int width,
                     int height)
Graphics.fillOval をオーバーライドします。
オーバーライド:
クラス Graphics 内の fillOval

drawArc

public void drawArc(int x,
                    int y,
                    int width,
                    int height,
                    int startAngle,
                    int arcAngle)
Graphics.drawArc をオーバーライドします。
オーバーライド:
クラス Graphics 内の drawArc

fillArc

public void fillArc(int x,
                    int y,
                    int width,
                    int height,
                    int startAngle,
                    int arcAngle)
Graphics.fillArc をオーバーライドします。
オーバーライド:
クラス Graphics 内の fillArc

drawPolyline

public void drawPolyline(int[] xPoints,
                         int[] yPoints,
                         int nPoints)
Graphics.drawPolyline をオーバーライドします。
オーバーライド:
クラス Graphics 内の drawPolyline

drawPolygon

public void drawPolygon(int[] xPoints,
                        int[] yPoints,
                        int nPoints)
Graphics.drawPolygon をオーバーライドします。
オーバーライド:
クラス Graphics 内の drawPolygon

fillPolygon

public void fillPolygon(int[] xPoints,
                        int[] yPoints,
                        int nPoints)
Graphics.fillPolygon をオーバーライドします。
オーバーライド:
クラス Graphics 内の fillPolygon

drawString

public void drawString(String aString,
                       int x,
                       int y)
Graphics.drawString をオーバーライドします。
オーバーライド:
クラス Graphics 内の drawString

drawBytes

public void drawBytes(byte[] data,
                      int offset,
                      int length,
                      int x,
                      int y)
Graphics.drawBytes をオーバーライドします。
オーバーライド:
クラス Graphics 内の drawBytes

drawChars

public void drawChars(char[] data,
                      int offset,
                      int length,
                      int x,
                      int y)
Graphics.drawChars をオーバーライドします。
オーバーライド:
クラス Graphics 内の drawChars

drawImage

public boolean drawImage(Image img,
                         int x,
                         int y,
                         ImageObserver observer)
Graphics.drawImage をオーバーライドします。
オーバーライド:
クラス Graphics 内の drawImage

drawImage

public boolean drawImage(Image img,
                         int x,
                         int y,
                         int width,
                         int height,
                         ImageObserver observer)
Graphics.drawImage をオーバーライドします。
オーバーライド:
クラス Graphics 内の drawImage

drawImage

public boolean drawImage(Image img,
                         int x,
                         int y,
                         Color bgcolor,
                         ImageObserver observer)
Graphics.drawImage をオーバーライドします。
オーバーライド:
クラス Graphics 内の drawImage

drawImage

public boolean drawImage(Image img,
                         int x,
                         int y,
                         int width,
                         int height,
                         Color bgcolor,
                         ImageObserver observer)
Graphics.drawImage をオーバーライドします。
オーバーライド:
クラス 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 をオーバーライドします。
オーバーライド:
クラス Graphics 内の drawImage

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 をオーバーライドします。
オーバーライド:
クラス Graphics 内の drawImage

copyArea

public void copyArea(int x,
                     int y,
                     int width,
                     int height,
                     int destX,
                     int destY)
Graphics.copyArea をオーバーライドします。
オーバーライド:
クラス Graphics 内の copyArea

dispose

public void dispose()
Graphics.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 を使います。

getDebugOptions

public int getDebugOptions()
DebugGraphics の現在のデバッグオプションを返します。
関連項目:
setDebugOptions(int)

Java プラットフォーム 1.2

バグや機能要求の報告
新しい javadoc の表示についてのコメントやご提案
Java は、米国およびその他の国における米国 Sun Microsystems, Inc. の商標もしくは登録商標です。
Copyright 1993-1998 Sun Microsystems, Inc. 901 San Antonio Road,
Palo Alto, California, 94303, U.S.A. All Rights Reserved.