Class DebugGraphics
All Packages Class Hierarchy This Package Previous Next Index
Class DebugGraphics
public class netscape.application.DebugGraphics
extends netscape.application.Graphics
{
/* Fields
*/
public final static int BUFFERED_OPTION;
public final static int FLASH_OPTION;
public final static int LOG_OPTION;
public final static int NONE_OPTION;
/* Constructors
*/
public DebugGraphics(View);
public DebugGraphics(Bitmap);
/* Methods
*/
public static Color flashColor();
public static int flashCount();
public static int flashTime();
public static PrintStream logStream();
public static void setFlashColor(Color);
public static void setFlashCount(int);
public static void setFlashTime(int);
public static void setLogStream(PrintStream);
public int debug();
public int debugOptions();
public void drawArc(int, int, int, int, int, int);
public void drawBitmapAt(Bitmap, int, int);
public void drawBitmapScaled(Bitmap, int, int, int, int);
public void drawBytes(byte[], int, int, int, int);
public void drawChars(char[], int, int, int, int);
public void drawLine(int, int, int, int);
public void drawOval(int, int, int, int);
public void drawPoint(int, int);
public void drawPolygon(int[], int[], int);
public void drawRect(int, int, int, int);
public void drawRoundedRect(int, int, int, int, int, int);
public void drawString(String, int, int);
public void fillArc(int, int, int, int, int, int);
public void fillOval(int, int, int, int);
public void fillPolygon(int[], int[], int);
public void fillRect(int, int, int, int);
public void fillRoundedRect(int, int, int, int, int, int);
public void popState();
public void pushState();
public void setClipRect(Rect, boolean);
public void setColor(Color);
public void setDebugOptions(int);
public void setFont(Font);
public void setPaintMode();
public void setXORMode(Color);
public void translate(int, int);
}
Graphics subclass supporting graphics debugging. Overrides most methods
from Graphics. You rarely create a DebugGraphics, instead a View creates
them in response to use of its setDebugGraphics() method, which
registers that View, and its subviews, for graphics debugging.
- See Also:
- setDebugGraphics
Fields
LOG_OPTION
public final static int LOG_OPTION
- Log graphics operations.
FLASH_OPTION
public final static int FLASH_OPTION
- Flash graphics operations.
BUFFERED_OPTION
public final static int BUFFERED_OPTION
- Show buffered operations in an ExternalWindow.
NONE_OPTION
public final static int NONE_OPTION
- Don't debug graphics operations.
Constructors
DebugGraphics
public DebugGraphics(View view)
- Constructs a DebugGraphics for view.
DebugGraphics
public DebugGraphics(Bitmap aBitmap)
- Constructs a DebugGraphics for aBitmap.
Methods
setFlashColor
public static void setFlashColor(Color flashColor)
- Sets the Color used to flash drawing operations.
flashColor
public static Color flashColor()
- Returns the Color used to flash drawing operations.
- See Also:
- setFlashColor
setFlashTime
public static void setFlashTime(int flashTime)
- Sets the time delay of drawing operation flashing.
flashTime
public static int flashTime()
- Returns the time delay of drawing operation flashing.
- See Also:
- setFlashTime
setFlashCount
public static void setFlashCount(int flashCount)
- Sets the number of times that drawing operations will flash.
flashCount
public static int flashCount()
- Returns the number of times that drawing operations will flash.
- See Also:
- setFlashCount
setLogStream
public static void setLogStream(PrintStream stream)
- Sets the stream to which the DebugGraphics logs drawing operations.
logStream
public static PrintStream logStream()
- Returns the stream to which the DebugGraphics logs drawing operations.
- See Also:
- setLogStream
pushState
public void pushState()
- Creates an entry in the Graphics state stack. Each call to
pushState() should be paired with a call to popState().
Any changes to the Graphics object between the calls will be flushed
after the popState().
- Overrides:
- pushState in class Graphics
- See Also:
- popState
popState
public void popState()
- Restores the Graphics object to its condition before the most recent
pushState() call. All fonts, colors, clipping rectangles and
translations will be restored.
- Overrides:
- popState in class Graphics
setFont
public void setFont(Font aFont)
- Sets the Font used for text drawing operations.
- Overrides:
- setFont in class Graphics
setColor
public void setColor(Color aColor)
- Sets the color to be used for drawing and filling lines and shapes.
- Overrides:
- setColor in class Graphics
translate
public void translate(int x,
int y)
- Alters the coordinate system so that all drawing, filling, and
clipping operations implicitly have x and y added to
their positions. If there is any current translation, the total
translation is the sum of the old and new translations.
- Overrides:
- translate in class Graphics
- See Also:
- xTranslation, yTranslation, translation
setClipRect
public void setClipRect(Rect rect,
boolean intersect)
- Sets the rectangle within which drawing can occur. Any drawing
occurring outside of this rectangle will not appear. If
intersect is true, this method intersects
rect with the current clipping rectangle to produce the new
clipping rectangle.
- Overrides:
- setClipRect in class Graphics
setPaintMode
public void setPaintMode()
- Sets the paint mode to overwrite the destination with the current
color.
- Overrides:
- setPaintMode in class Graphics
- See Also:
- setXORMode
setXORMode
public void setXORMode(Color aColor)
- Sets the paint mode to alternate between the current color and
aColor.
- Overrides:
- setXORMode in class Graphics
- See Also:
- setPaintMode
drawRect
public void drawRect(int x,
int y,
int width,
int height)
- Draws the rectangle
(x, y, width, height) using
the current color.
- Overrides:
- drawRect in class Graphics
fillRect
public void fillRect(int x,
int y,
int width,
int height)
- Fills the rectangle
(x, y, width, height) using the current
color.
- Overrides:
- fillRect in class Graphics
drawRoundedRect
public void drawRoundedRect(int x,
int y,
int width,
int height,
int arcWidth,
int arcHeight)
- Draws a rectangle with rounded corners in the rectangle
(x, y, width, height), as determined by
arcWidth and arcHeight.
- Overrides:
- drawRoundedRect in class Graphics
fillRoundedRect
public void fillRoundedRect(int x,
int y,
int width,
int height,
int arcWidth,
int arcHeight)
- Fills a rectangle with rounded corners in the rectangle
(x, y, width, height), as determined by
arcWidth and arcHeight.
- Overrides:
- fillRoundedRect in class Graphics
drawLine
public void drawLine(int x1,
int y1,
int x2,
int y2)
- Draws a line from the point (x1, y1) to the
point (x2, y2) in the current color.
- Overrides:
- drawLine in class Graphics
drawPoint
public void drawPoint(int x,
int y)
- Draws the point (x, y) in the current color.
- Overrides:
- drawPoint in class Graphics
drawOval
public void drawOval(int x,
int y,
int width,
int height)
- Draws an oval inside the rect
(x, y, width, height) in the
current color.
- Overrides:
- drawOval in class Graphics
fillOval
public void fillOval(int x,
int y,
int width,
int height)
- Fills an oval inside the rect
(x, y, width, height) in the
current color.
- Overrides:
- fillOval in class Graphics
drawArc
public void drawArc(int x,
int y,
int width,
int height,
int startAngle,
int arcAngle)
- Draws an arc in aRect from startAngle for
arcAngle degrees.
- Overrides:
- drawArc in class Graphics
fillArc
public void fillArc(int x,
int y,
int width,
int height,
int startAngle,
int arcAngle)
- Fills an arc in aRect from startAngle for
arcAngle degrees.
- Overrides:
- fillArc in class Graphics
drawPolygon
public void drawPolygon(int xPoints[],
int yPoints[],
int nPoints)
- Draws the polygon described by xPoints and yPoints
using the current color. Both arrays must have at least
nPoints integers.
- Overrides:
- drawPolygon in class Graphics
fillPolygon
public void fillPolygon(int xPoints[],
int yPoints[],
int nPoints)
- Fills the polygon described by xPoints and yPoints
using the current color. Both arrays must have at least
nPoints integers.
- Overrides:
- fillPolygon in class Graphics
drawBitmapAt
public void drawBitmapAt(Bitmap bitmap,
int x,
int y)
- Displays bitmap at the point (x, y).
- Overrides:
- drawBitmapAt in class Graphics
drawBitmapScaled
public void drawBitmapScaled(Bitmap bitmap,
int x,
int y,
int width,
int height)
- Draws bitmap at the point (x, y), scaled in the
X-dimension to have width width and the Y-dimension to
have height height.
- Overrides:
- drawBitmapScaled in class Graphics
drawString
public void drawString(String aString,
int x,
int y)
- Draws aString at the point (x, y) using the
current font and color.
- Overrides:
- drawString in class Graphics
- See Also:
- drawStringInRect
drawBytes
public void drawBytes(byte data[],
int offset,
int length,
int x,
int y)
- Draws length bytes of data, beginning offset bytes
into the array, using the current font and color, at the point
(x, y).
- Overrides:
- drawBytes in class Graphics
drawChars
public void drawChars(char data[],
int offset,
int length,
int x,
int y)
- Draws length characters of data, beginning offset
characters into the array, using the current font and color, at the
point (x, y).
- Overrides:
- drawChars in class Graphics
setDebugOptions
public void setDebugOptions(int debugOptions)
- Enables/disables diagnostic information about every graphics
operation. The value of debug indicates how this information
should be displayed. DEBUG_LOG causes a text message to be printed.
DEBUG_FLASH causes the drawing to flash several times. DEBUG_BUFFERED
creates an ExternalWindow that shows each operation on an
offscreen buffer. The value of debug is bitwise OR'd into
the current value. To disable debugging use DEBUG_NONE.
- Overrides:
- setDebugOptions in class Graphics
debugOptions
public int debugOptions()
- Returns the current debugging options.
- Overrides:
- debugOptions in class Graphics
- See Also:
- setDebugOptions
debug
public int debug()
- Returns the state of graphics debugging.
- See Also:
- setDebug
All Packages Class Hierarchy This Package Previous Next Index