| Method from javax.swing.DebugGraphics Detail: |
public void clearRect(int x,
int y,
int width,
int height) {
if ((debugOptions & LOG_OPTION) != 0)
{
logStream().println(prefix() + " Clearing rect: "
+ new Rectangle(x, y, width, height));
}
graphics.clearRect(x, y, width, height);
}
|
public void clipRect(int x,
int y,
int width,
int height) {
if ((debugOptions & LOG_OPTION) != 0)
{
logStream().print(prefix() + " Setting clipRect: "
+ new Rectangle(x, y, width, height));
}
graphics.clipRect(x, y, width, height);
if ((debugOptions & LOG_OPTION) != 0)
logStream().println(" Netting clipRect: " + graphics.getClipBounds());
}
Intersects the current clip region with the given region. |
public void copyArea(int x,
int y,
int width,
int height,
int destx,
int desty) {
if ((debugOptions & LOG_OPTION) != 0)
{
logStream().println(prefix() + " Copying area from: "
+ new Rectangle(x, y, width, height)
+ " to: " + new Point(destx, desty));
}
graphics.copyArea(x, y, width, height, destx, desty);
}
|
public Graphics create() {
DebugGraphics copy = new DebugGraphics(graphics.create());
copy.debugOptions = debugOptions;
return copy;
}
Creates a overrides Graphics.create to create a
DebugGraphics object. |
public Graphics create(int x,
int y,
int width,
int height) {
DebugGraphics copy = new DebugGraphics(graphics.create(x, y, width,
height));
copy.debugOptions = debugOptions;
return copy;
}
Creates a overrides Graphics.create to create a
DebugGraphics object. |
public void dispose() {
graphics.dispose();
graphics = null;
}
Releases all system resources that this Graphics is using. |
public void draw3DRect(int x,
int y,
int width,
int height,
boolean raised) {
if ((debugOptions & LOG_OPTION) != 0)
{
logStream().println(prefix() + " Drawing 3D rect: "
+ new Rectangle(x, y, width, height)
+ "Raised bezel: " + raised);
}
graphics.draw3DRect(x, y, width, height, raised);
}
|
public void drawArc(int x,
int y,
int width,
int height,
int startAngle,
int arcAngle) {
if ((debugOptions & LOG_OPTION) != 0)
{
logStream().println(prefix() + " Drawing arc: "
+ new Rectangle(x, y, width, height)
+ " startAngle: " + startAngle
+ " arcAngle: " + arcAngle);
}
graphics.drawArc(x, y, width, height, startAngle, arcAngle);
}
|
public void drawBytes(byte[] data,
int offset,
int length,
int x,
int y) {
if ((debugOptions & LOG_OPTION) != 0)
logStream().println(prefix() + " Drawing bytes at: " + new Point(x, y));
graphics.drawBytes(data, offset, length, x, y);
}
|
public void drawChars(char[] data,
int offset,
int length,
int x,
int y) {
if ((debugOptions & LOG_OPTION) != 0)
logStream().println(prefix() + " Drawing chars at: " + new Point(x, y));
if ((debugOptions & FLASH_OPTION) != 0)
{
Color color = graphics.getColor();
for (int index = 0; index < (debugFlashCount - 1); ++index)
{
graphics.setColor(color);
graphics.drawChars(data, offset, length, x, y);
sleep(debugFlashTime);
graphics.setColor(debugFlashColor);
graphics.drawChars(data, offset, length, x, y);
sleep(debugFlashTime);
}
graphics.setColor(color);
}
graphics.drawChars(data, offset, length, x, y);
}
|
public boolean drawImage(Image image,
int x,
int y,
ImageObserver observer) {
if ((debugOptions & LOG_OPTION) != 0)
{
logStream().println(prefix() + " Drawing image: " + image + " at: "
+ new Point(x, y));
}
return graphics.drawImage(image, x, y, observer);
}
|
public boolean drawImage(Image image,
int x,
int y,
Color background,
ImageObserver observer) {
if ((debugOptions & LOG_OPTION) != 0)
{
logStream().println(prefix() + " Drawing image: " + image
+ " at: " + new Point(x, y)
+ ", bgcolor: " + background);
}
return graphics.drawImage(image, x, y, background, observer);
}
|
public boolean drawImage(Image image,
int x,
int y,
int width,
int height,
ImageObserver observer) {
if ((debugOptions & LOG_OPTION) != 0)
{
logStream().println(prefix() + " Drawing image: " + image
+ " at: " + new Rectangle(x, y, width, height));
}
return graphics.drawImage(image, x, y, width, height, observer);
}
|
public boolean drawImage(Image image,
int x,
int y,
int width,
int height,
Color background,
ImageObserver observer) {
if ((debugOptions & LOG_OPTION) != 0)
{
logStream().println(prefix() + " Drawing image: " + image
+ " at: " + new Rectangle(x, y, width, height)
+ ", bgcolor: " + background);
}
return graphics.drawImage(image, x, y, width, height, background, observer);
}
|
public boolean drawImage(Image image,
int dx1,
int dy1,
int dx2,
int dy2,
int sx1,
int sy1,
int sx2,
int sy2,
ImageObserver observer) {
if ((debugOptions & LOG_OPTION) != 0)
{
logStream().println(prefix() + " Drawing image: " + image
+ " destination: " + new Rectangle(dx1, dy1, dx2, dy2)
+ " source: " + new Rectangle(sx1, sy1, sx2, sy2));
}
return graphics.drawImage(image, dx1, dy1, dx2, dy2, sx1, sy1, sx2, sy2, observer);
}
|
public boolean drawImage(Image image,
int dx1,
int dy1,
int dx2,
int dy2,
int sx1,
int sy1,
int sx2,
int sy2,
Color background,
ImageObserver observer) {
if ((debugOptions & LOG_OPTION) != 0)
{
logStream().println(prefix() + " Drawing image: " + image
+ " destination: " + new Rectangle(dx1, dy1, dx2, dy2)
+ " source: " + new Rectangle(sx1, sy1, sx2, sy2)
+ ", bgcolor: " + background);
}
return graphics.drawImage(image, dx1, dy1, dx2, dy2, sx1, sy1, sx2, sy2, background, observer);
}
|
public void drawLine(int x1,
int y1,
int x2,
int y2) {
if ((debugOptions & LOG_OPTION) != 0)
{
logStream().println(prefix() + " Drawing line: from (" + x1 + ", "
+ y1 + ") to (" + x2 + ", " + y2 + ")");
}
graphics.drawLine(x1, y1, x2, y2);
}
|
public void drawOval(int x,
int y,
int width,
int height) {
if ((debugOptions & LOG_OPTION) != 0)
{
logStream().println(prefix() + " Drawing oval: "
+ new Rectangle(x, y, width, height));
}
graphics.drawOval(x, y, width, height);
}
|
public void drawPolygon(int[] xpoints,
int[] ypoints,
int npoints) {
if ((debugOptions & LOG_OPTION) != 0)
{
logStream().println(prefix() + " Drawing polygon: nPoints: " + npoints
+ " X's: " + xpoints + " Y's: " + ypoints);
}
graphics.drawPolygon(xpoints, ypoints, npoints);
}
|
public void drawPolyline(int[] xpoints,
int[] ypoints,
int npoints) {
if ((debugOptions & LOG_OPTION) != 0)
{
logStream().println(prefix() + " Drawing polyline: nPoints: " + npoints
+ " X's: " + xpoints + " Y's: " + ypoints);
}
graphics.drawPolyline(xpoints, ypoints, npoints);
}
|
public void drawRect(int x,
int y,
int width,
int height) {
if ((debugOptions & LOG_OPTION) != 0)
{
logStream().println(prefix() + " Drawing rect: "
+ new Rectangle(x, y, width, height));
}
if ((debugOptions & FLASH_OPTION) != 0)
{
Color color = graphics.getColor();
for (int index = 0; index < (debugFlashCount - 1); ++index)
{
graphics.setColor(color);
graphics.drawRect(x, y, width, height);
sleep(debugFlashTime);
graphics.setColor(debugFlashColor);
graphics.drawRect(x, y, width, height);
sleep(debugFlashTime);
}
graphics.setColor(color);
}
graphics.drawRect(x, y, width, height);
}
|
public void drawRoundRect(int x,
int y,
int width,
int height,
int arcWidth,
int arcHeight) {
if ((debugOptions & LOG_OPTION) != 0)
{
logStream().println(prefix() + " Drawing round rect: "
+ new Rectangle(x, y, width, height)
+ " arcWidth: " + arcWidth
+ " arcHeight: " + arcHeight);
}
graphics.drawRoundRect(x, y, width, height, arcWidth, arcHeight);
}
|
public void drawString(String string,
int x,
int y) {
if ((debugOptions & LOG_OPTION) != 0)
{
logStream().println(prefix() + " Drawing string: \"" + string
+ "\" at: " + new Point(x, y));
}
graphics.drawString(string, x, y);
}
|
public void drawString(AttributedCharacterIterator iterator,
int x,
int y) {
if ((debugOptions & LOG_OPTION) != 0)
{
logStream().println(prefix() + " Drawing string: \"" + iterator
+ "\" at: " + new Point(x, y));
}
graphics.drawString(iterator, x, y);
}
|
public void fill3DRect(int x,
int y,
int width,
int height,
boolean raised) {
if ((debugOptions & LOG_OPTION) != 0)
{
logStream().println(prefix() + " Filling 3D rect: "
+ new Rectangle(x, y, width, height)
+ "Raised bezel: " + raised);
}
graphics.fill3DRect(x, y, width, height, raised);
}
|
public void fillArc(int x,
int y,
int width,
int height,
int startAngle,
int arcAngle) {
if ((debugOptions & LOG_OPTION) != 0)
{
logStream().println(prefix() + " Filling arc: "
+ new Rectangle(x, y, width, height)
+ " startAngle: " + startAngle
+ " arcAngle: " + arcAngle);
}
graphics.fillArc(x, y, width, height, startAngle, arcAngle);
}
|
public void fillOval(int x,
int y,
int width,
int height) {
if ((debugOptions & LOG_OPTION) != 0)
{
logStream().println(prefix() + " Filling oval: "
+ new Rectangle(x, y, width, height));
}
graphics.fillOval(x, y, width, height);
}
|
public void fillPolygon(int[] xpoints,
int[] ypoints,
int npoints) {
if ((debugOptions & LOG_OPTION) != 0)
{
logStream().println(prefix() + " Drawing polygon: nPoints: " + npoints
+ " X's: " + xpoints + " Y's: " + ypoints);
}
graphics.fillPolygon(xpoints, ypoints, npoints);
}
|
public void fillRect(int x,
int y,
int width,
int height) {
if ((debugOptions & LOG_OPTION) != 0)
{
logStream().println(prefix() + " Filling rect: "
+ new Rectangle(x, y, width, height));
}
if ((debugOptions & FLASH_OPTION) != 0)
{
Color color = graphics.getColor();
for (int index = 0; index < (debugFlashCount - 1); ++index)
{
graphics.setColor(color);
graphics.fillRect(x, y, width, height);
sleep(debugFlashTime);
graphics.setColor(debugFlashColor);
graphics.fillRect(x, y, width, height);
sleep(debugFlashTime);
}
graphics.setColor(color);
}
graphics.fillRect(x, y, width, height);
}
Draws a filled rectangle. |
public void fillRoundRect(int x,
int y,
int width,
int height,
int arcWidth,
int arcHeight) {
if ((debugOptions & LOG_OPTION) != 0)
{
logStream().println(prefix() + " Filling round rect: "
+ new Rectangle(x, y, width, height)
+ " arcWidth: " + arcWidth
+ " arcHeight: " + arcHeight);
}
graphics.fillRoundRect(x, y, width, height, arcWidth, arcHeight);
}
|
public static Color flashColor() {
return debugFlashColor;
}
|
public static int flashCount() {
return debugFlashCount;
}
|
public static int flashTime() {
return debugFlashTime;
}
|
public Shape getClip() {
return graphics.getClip();
}
Returns the current clipping region. |
public Rectangle getClipBounds() {
return graphics.getClipBounds();
}
|
public Color getColor() {
return graphics.getColor();
}
Returns the color used for drawing. |
public int getDebugOptions() {
return debugOptions;
}
|
public Font getFont() {
return graphics.getFont();
}
|
public FontMetrics getFontMetrics() {
return graphics.getFontMetrics();
}
Returns the font metrics of the current font. |
public FontMetrics getFontMetrics(Font font) {
return graphics.getFontMetrics(font);
}
Returns the font metrics for a given font. |
public boolean isDrawingBuffer() {
return false; // TODO
}
|
public static PrintStream logStream() {
return debugLogStream;
}
|
public void setClip(Shape shape) {
if ((debugOptions & LOG_OPTION) != 0)
logStream().println(prefix() + " Setting new clipRect: " + shape);
graphics.setClip(shape);
}
Sets the current clipping region |
public void setClip(int x,
int y,
int width,
int height) {
if ((debugOptions & LOG_OPTION) != 0)
{
logStream().println(prefix() + " Setting new clipRect: "
+ new Rectangle(x, y, width, height));
}
graphics.setClip(x, y, width, height);
}
Sets the clipping region. |
public void setColor(Color color) {
if ((debugOptions & LOG_OPTION) != 0)
logStream().println(prefix() + " Setting color: " + color);
graphics.setColor(color);
}
Sets the color to draw stuff with. |
public void setDebugOptions(int options) {
debugOptions = options;
if ((debugOptions & LOG_OPTION) != 0)
if (options == NONE_OPTION)
logStream().println(prefix() + "Disabling debug");
else
logStream().println(prefix() + "Enabling debug");
}
|
public static void setFlashColor(Color color) {
debugFlashColor = color;
}
|
public static void setFlashCount(int count) {
debugFlashCount = count;
}
|
public static void setFlashTime(int time) {
debugFlashTime = time;
}
|
public void setFont(Font font) {
if ((debugOptions & LOG_OPTION) != 0)
logStream().println(prefix() + " Setting font: " + font);
graphics.setFont(font);
}
|
public static void setLogStream(PrintStream stream) {
debugLogStream = stream;
}
|
public void setPaintMode() {
if ((debugOptions & LOG_OPTION) != 0)
logStream().println(prefix() + " Setting paint mode");
graphics.setPaintMode();
}
|
public void setXORMode(Color color) {
if ((debugOptions & LOG_OPTION) != 0)
logStream().println(prefix() + " Setting XOR mode: " + color);
graphics.setXORMode(color);
}
|
public void translate(int x,
int y) {
if ((debugOptions & LOG_OPTION) != 0)
logStream().println(prefix() + " Translating by: " + new Point(x, y));
graphics.translate(x, y);
}
|