Note
You must turn off double buffering to use DebugGraphics: RepaintManager repaintManager = RepaintManager.currentManager(component); repaintManager.setDoubleBufferingEnabled(false);
JComponent#setDebugGraphicsOptions, RepaintManager#currentManager, RepaintManager#setDoubleBufferingEnabled
| Modifier and Type | Field and Description |
|---|---|
| pack-priv Image | |
| public static final int | BUFFERED_OPTION
Show buffered operations in a separate |
| private static DebugGraphicsInfo | |
| pack-priv int | |
| public static final int | FLASH_OPTION
Flash graphics operations. |
| pack-priv Graphics | |
| private static int | |
| pack-priv int | |
| private static ImageIcon | |
| public static final int | LOG_OPTION
Log graphics operations. |
| public static final int | NONE_OPTION
Don't debug graphics operations. |
| pack-priv int | |
| pack-priv int |
| Access | Constructor and Description |
|---|---|
| public | |
| public | DebugGraphics(Graphics
the Graphics context to slow down graphics, JComponent the JComponent to draw slowly component)Constructs a debug graphics context from an existing graphics context that slows down drawing for the specified component. |
| public | DebugGraphics(Graphics
the Graphics context to slow down graphics)Constructs a debug graphics context from an existing graphics context that supports slowed down drawing. |
| Modifier and Type | Method and Description |
|---|---|
| public void | clearRect(int x, int y, int width, int height)
Implements abstract java. Overrides |
| public void | clipRect(int x, int y, int width, int height)
Implements abstract java. Overrides |
| public void | copyArea(int x, int y, int width, int height, int destX, int destY)
Implements abstract java. Overrides |
| public Graphics | create()
Implements abstract java. Overrides |
| public Graphics | create(int x, int y, int width, int height)
Overrides java. Overrides |
| pack-priv boolean | |
| pack-priv static int | |
| pack-priv boolean | |
| private Graphics | |
| pack-priv boolean | |
| public void | |
| public void | draw3DRect(int x, int y, int width, int height, boolean raised)
Overrides java. Overrides |
| public void | drawArc(int x, int y, int width, int height, int startAngle, int arcAngle)
Implements abstract java. Overrides |
| public void | drawBytes(byte[] data, int offset, int length, int x, int y)
Overrides java. Overrides |
| public void | drawChars(char[] data, int offset, int length, int x, int y)
Overrides java. Overrides |
| public boolean | drawImage(Image img, int x, int y, ImageObserver observer)
Implements abstract java. Overrides |
| public boolean | drawImage(Image img, int x, int y, int width, int height, ImageObserver observer)
Implements abstract java. Overrides |
| public boolean | drawImage(Image img, int x, int y, Color bgcolor, ImageObserver observer)
Implements abstract java. Overrides |
| public boolean | drawImage(Image img, int x, int y, int width, int height, Color bgcolor, ImageObserver observer)
Implements abstract java. Overrides |
| public boolean | drawImage(Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, ImageObserver observer)
Implements abstract java. Overrides |
| 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)
Implements abstract java. Overrides |
| public void | drawLine(int x1, int y1, int x2, int y2)
Implements abstract java. Overrides |
| public void | drawOval(int x, int y, int width, int height)
Implements abstract java. Overrides |
| public void | drawPolygon(int[] xPoints, int[] yPoints, int nPoints)
Implements abstract java. Overrides |
| public void | drawPolyline(int[] xPoints, int[] yPoints, int nPoints)
Implements abstract java. Overrides |
| public void | drawRect(int x, int y, int width, int height)
Overrides java. Overrides |
| public void | drawRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight)
Implements abstract java. Overrides |
| public void | drawString(String aString, int x, int y)
Implements abstract java. Overrides |
| public void | drawString(AttributedCharacterIterator iterator, int x, int y)
Implements abstract java. Overrides |
| public void | fill3DRect(int x, int y, int width, int height, boolean raised)
Overrides java. Overrides |
| public void | fillArc(int x, int y, int width, int height, int startAngle, int arcAngle)
Implements abstract java. Overrides |
| public void | fillOval(int x, int y, int width, int height)
Implements abstract java. Overrides |
| public void | fillPolygon(int[] xPoints, int[] yPoints, int nPoints)
Implements abstract java. Overrides |
| public void | fillRect(int x, int y, int width, int height)
Implements abstract java. Overrides |
| public void | fillRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight)
Implements abstract java. Overrides |
| public static Color | Returns: the Color used to flash drawing operationsReturns the Color used to flash drawing operations. |
| public static int | Returns: the number of times that drawing operations will flashReturns the number of times that drawing operations will flash. |
| public static int | Returns: the time delay of drawing operation flashingReturns the time delay of drawing operation flashing. |
| public Shape | |
| public Rectangle | getClipBounds()
Implements abstract java. Overrides |
| public Color | getColor()
Implements abstract java. Returns the Color used for text drawing operations. |
| public int | Returns: the current debugging options for this DebugGraphicsReturns the current debugging options for this DebugGraphics. |
| pack-priv static int | |
| public Font | getFont()
Implements abstract java. Returns the Font used for text drawing operations. |
| public FontMetrics | |
| public FontMetrics | getFontMetrics(Font f)
Implements abstract java. Overrides |
| pack-priv static DebugGraphicsInfo | |
| public boolean | Returns: true if this object is drawing from a BufferReturns the drawingBuffer value. |
| pack-priv static void | |
| public static PrintStream | Returns: the stream to which the DebugGraphics logs drawing operationsReturns the stream to which the DebugGraphics logs drawing operations. |
| pack-priv String | |
| public void | setClip(int x, int y, int width, int height)
Implements abstract java. Overrides |
| public void | |
| public void | setColor(Color aColor)
Implements abstract java. Sets the color to be used for drawing and filling lines and shapes. |
| public void | setDebugOptions(int
indicates how diagnostic information should be displayed options)Enables/disables diagnostic information about every graphics operation. |
| pack-priv static void | setDebugOptions(JComponent component, int options)
Static wrapper method for DebugGraphicsInfo.setDebugOptions(). |
| public static void | setFlashColor(Color
the Color used to flash drawing operations flashColor)Sets the Color used to flash drawing operations. |
| public static void | setFlashCount(int
number of times that drawing operations will flash flashCount)Sets the number of times that drawing operations will flash. |
| public static void | setFlashTime(int
the time delay of drawing operation flashing flashTime)Sets the time delay of drawing operation flashing. |
| public void | setFont(Font aFont)
Implements abstract java. Sets the Font used for text drawing operations. |
| public static void | setLogStream(PrintStream
the stream to which the DebugGraphics logs drawing operations stream)Sets the stream to which the DebugGraphics logs drawing operations. |
| public void | |
| public void | setXORMode(Color aColor)
Implements abstract java. Overrides |
| pack-priv static int | shouldComponentDebug(JComponent component)
Returns non-zero if component should display with DebugGraphics, zero otherwise. |
| pack-priv final void | |
| pack-priv String | |
| public void | translate(int x, int y)
Implements abstract java. Overrides |
| buffer | back to summary |
|---|---|
| pack-priv Image buffer | |
| BUFFERED_OPTION | back to summary |
|---|---|
| public static final int BUFFERED_OPTION Show buffered operations in a separate | |
| debugGraphicsInfo | back to summary |
|---|---|
| private static DebugGraphicsInfo debugGraphicsInfo | |
| debugOptions | back to summary |
|---|---|
| pack-priv int debugOptions | |
| FLASH_OPTION | back to summary |
|---|---|
| public static final int FLASH_OPTION Flash graphics operations. | |
| graphics | back to summary |
|---|---|
| pack-priv Graphics graphics | |
| graphicsCount | back to summary |
|---|---|
| private static int graphicsCount | |
| graphicsID | back to summary |
|---|---|
| pack-priv int graphicsID | |
| imageLoadingIcon | back to summary |
|---|---|
| private static ImageIcon imageLoadingIcon | |
| LOG_OPTION | back to summary |
|---|---|
| public static final int LOG_OPTION Log graphics operations. | |
| NONE_OPTION | back to summary |
|---|---|
| public static final int NONE_OPTION Don't debug graphics operations. | |
| xOffset | back to summary |
|---|---|
| pack-priv int xOffset | |
| yOffset | back to summary |
|---|---|
| pack-priv int yOffset | |
| DebugGraphics | back to summary |
|---|---|
| public DebugGraphics() Constructs a new debug graphics context that supports slowed down drawing. Note This constructor should not be called by applications, it is for internal use only. When called directly it will create an un-usable instance. | |
| DebugGraphics | back to summary |
|---|---|
| public DebugGraphics(Graphics graphics, JComponent component) Constructs a debug graphics context from an existing graphics context that slows down drawing for the specified component.
| |
| DebugGraphics | back to summary |
|---|---|
| public DebugGraphics(Graphics graphics) Constructs a debug graphics context from an existing graphics context that supports slowed down drawing.
| |
| clearRect | back to summary |
|---|---|
| public void clearRect(int x, int y, int width, int height) Implements abstract java. Overrides | |
| clipRect | back to summary |
|---|---|
| public void clipRect(int x, int y, int width, int height) Implements abstract java. Overrides | |
| copyArea | back to summary |
|---|---|
| public void copyArea(int x, int y, int width, int height, int destX, int destY) Implements abstract java. Overrides | |
| create | back to summary |
|---|---|
| public Graphics create() Implements abstract java. Overrides | |
| create | back to summary |
|---|---|
| public Graphics create(int x, int y, int width, int height) Overrides java. Overrides | |
| debugBuffered | back to summary |
|---|---|
| pack-priv boolean debugBuffered() | |
| debugComponentCount | back to summary |
|---|---|
| pack-priv static int debugComponentCount() Returns the number of JComponents that have debugging options turned on. | |
| debugFlash | back to summary |
|---|---|
| pack-priv boolean debugFlash() | |
| debugGraphics | back to summary |
|---|---|
| private Graphics debugGraphics() Returns a DebugGraphics for use in buffering window.
| |
| debugLog | back to summary |
|---|---|
| pack-priv boolean debugLog() | |
| dispose | back to summary |
|---|---|
| public void dispose() Implements abstract java. Overrides | |
| draw3DRect | back to summary |
|---|---|
| public void draw3DRect(int x, int y, int width, int height, boolean raised) Overrides java. Overrides | |
| drawArc | back to summary |
|---|---|
| public void drawArc(int x, int y, int width, int height, int startAngle, int arcAngle) Implements abstract java. Overrides | |
| drawBytes | back to summary |
|---|---|
| public void drawBytes(byte[] data, int offset, int length, int x, int y) Overrides java. Overrides | |
| drawChars | back to summary |
|---|---|
| public void drawChars(char[] data, int offset, int length, int x, int y) Overrides java. Overrides | |
| drawImage | back to summary |
|---|---|
| public boolean drawImage(Image img, int x, int y, ImageObserver observer) Implements abstract java. Overrides | |
| drawImage | back to summary |
|---|---|
| public boolean drawImage(Image img, int x, int y, int width, int height, ImageObserver observer) Implements abstract java. Overrides | |
| drawImage | back to summary |
|---|---|
| public boolean drawImage(Image img, int x, int y, Color bgcolor, ImageObserver observer) Implements abstract java. Overrides | |
| drawImage | back to summary |
|---|---|
| public boolean drawImage(Image img, int x, int y, int width, int height, Color bgcolor, ImageObserver observer) Implements abstract java. Overrides | |
| drawImage | back to summary |
|---|---|
| public boolean drawImage(Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, ImageObserver observer) Implements abstract java. Overrides | |
| drawImage | back to summary |
|---|---|
| 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) Implements abstract java. Overrides | |
| drawLine | back to summary |
|---|---|
| public void drawLine(int x1, int y1, int x2, int y2) Implements abstract java. Overrides | |
| drawOval | back to summary |
|---|---|
| public void drawOval(int x, int y, int width, int height) Implements abstract java. Overrides | |
| drawPolygon | back to summary |
|---|---|
| public void drawPolygon(int[] xPoints, int[] yPoints, int nPoints) Implements abstract java. Overrides | |
| drawPolyline | back to summary |
|---|---|
| public void drawPolyline(int[] xPoints, int[] yPoints, int nPoints) Implements abstract java. Overrides | |
| drawRect | back to summary |
|---|---|
| public void drawRect(int x, int y, int width, int height) Overrides java. Overrides | |
| drawRoundRect | back to summary |
|---|---|
| public void drawRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight) Implements abstract java. Overrides | |
| drawString | back to summary |
|---|---|
| public void drawString(String aString, int x, int y) Implements abstract java. Overrides | |
| drawString | back to summary |
|---|---|
| public void drawString(AttributedCharacterIterator iterator, int x, int y) Implements abstract java. Overrides | |
| fill3DRect | back to summary |
|---|---|
| public void fill3DRect(int x, int y, int width, int height, boolean raised) Overrides java. Overrides | |
| fillArc | back to summary |
|---|---|
| public void fillArc(int x, int y, int width, int height, int startAngle, int arcAngle) Implements abstract java. Overrides | |
| fillOval | back to summary |
|---|---|
| public void fillOval(int x, int y, int width, int height) Implements abstract java. Overrides | |
| fillPolygon | back to summary |
|---|---|
| public void fillPolygon(int[] xPoints, int[] yPoints, int nPoints) Implements abstract java. Overrides | |
| fillRect | back to summary |
|---|---|
| public void fillRect(int x, int y, int width, int height) Implements abstract java. Overrides | |
| fillRoundRect | back to summary |
|---|---|
| public void fillRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight) Implements abstract java. Overrides | |
| flashColor | back to summary |
|---|---|
| public static Color flashColor() Returns the Color used to flash drawing operations.
| |
| flashCount | back to summary |
|---|---|
| public static int flashCount() Returns the number of times that drawing operations will flash.
| |
| flashTime | back to summary |
|---|---|
| public static int flashTime() Returns the time delay of drawing operation flashing.
| |
| getClip | back to summary |
|---|---|
| public Shape getClip() Implements abstract java. Overrides | |
| getClipBounds | back to summary |
|---|---|
| public Rectangle getClipBounds() Implements abstract java. Overrides | |
| getColor | back to summary |
|---|---|
| public Color getColor() Implements abstract java. Returns the Color used for text drawing operations.
| |
| getDebugOptions | back to summary |
|---|---|
| public int getDebugOptions() Returns the current debugging options for this DebugGraphics.
| |
| getDebugOptions | back to summary |
|---|---|
| pack-priv static int getDebugOptions(JComponent component) Static wrapper method for DebugGraphicsInfo.getDebugOptions(). | |
| getFont | back to summary |
|---|---|
| public Font getFont() Implements abstract java. Returns the Font used for text drawing operations.
| |
| getFontMetrics | back to summary |
|---|---|
| public FontMetrics getFontMetrics() Overrides java. Overrides | |
| getFontMetrics | back to summary |
|---|---|
| public FontMetrics getFontMetrics(Font f) Implements abstract java. Overrides | |
| info | back to summary |
|---|---|
| pack-priv static DebugGraphicsInfo info() Returns DebugGraphicsInfo, or creates one if none exists. | |
| isDrawingBuffer | back to summary |
|---|---|
| public boolean isDrawingBuffer() Returns the drawingBuffer value.
| |
| loadImage | back to summary |
|---|---|
| pack-priv static void loadImage(Image img) | |
| logStream | back to summary |
|---|---|
| public static PrintStream logStream() Returns the stream to which the DebugGraphics logs drawing operations.
| |
| pointToString | back to summary |
|---|---|
| pack-priv String pointToString(int x, int y) | |
| setClip | back to summary |
|---|---|
| public void setClip(int x, int y, int width, int height) Implements abstract java. Overrides | |
| setClip | back to summary |
|---|---|
| public void setClip(Shape clip) Implements abstract java. Overrides | |
| setColor | back to summary |
|---|---|
| public void setColor(Color aColor) Implements abstract java. Sets the color to be used for drawing and filling lines and shapes. | |
| setDebugOptions | back to summary |
|---|---|
| public void setDebugOptions(int options) Enables/disables diagnostic information about every graphics operation. The value of options indicates how this information should be displayed. LOG_OPTION causes a text message to be printed. FLASH_OPTION causes the drawing to flash several times. BUFFERED_OPTION creates a new Frame that shows each operation on an offscreen buffer. The value of options is bitwise OR'd into the current value. To disable debugging use NONE_OPTION.
| |
| setDebugOptions | back to summary |
|---|---|
| pack-priv static void setDebugOptions(JComponent component, int options) Static wrapper method for DebugGraphicsInfo.setDebugOptions(). Stores options on a per component basis. | |
| setFlashColor | back to summary |
|---|---|
| public static void setFlashColor(Color flashColor) Sets the Color used to flash drawing operations.
| |
| setFlashCount | back to summary |
|---|---|
| public static void setFlashCount(int flashCount) Sets the number of times that drawing operations will flash.
| |
| setFlashTime | back to summary |
|---|---|
| public static void setFlashTime(int flashTime) Sets the time delay of drawing operation flashing.
| |
| setFont | back to summary |
|---|---|
| public void setFont(Font aFont) Implements abstract java. Sets the Font used for text drawing operations. | |
| setLogStream | back to summary |
|---|---|
| public static void setLogStream(PrintStream stream) Sets the stream to which the DebugGraphics logs drawing operations.
| |
| setPaintMode | back to summary |
|---|---|
| public void setPaintMode() Implements abstract java. Overrides | |
| setXORMode | back to summary |
|---|---|
| public void setXORMode(Color aColor) Implements abstract java. Overrides | |
| shouldComponentDebug | back to summary |
|---|---|
| pack-priv static int shouldComponentDebug(JComponent component) Returns non-zero if component should display with DebugGraphics, zero otherwise. Walks the JComponent's parent tree to determine if any debugging options have been set. | |
| sleep | back to summary |
|---|---|
| pack-priv final void sleep(int mSecs) | |
| toShortString | back to summary |
|---|---|
| pack-priv String toShortString() | |
| translate | back to summary |
|---|---|
| public void translate(int x, int y) Implements abstract java. Overrides | |