< prev index next >
src/java.desktop/share/classes/javax/swing/DebugGraphics.java
Print this page
*** 58,68 ****
/** Log graphics operations. */
public static final int LOG_OPTION = 1 << 0;
/** Flash graphics operations. */
public static final int FLASH_OPTION = 1 << 1;
! /** Show buffered operations in a separate <code>Frame</code>. */
public static final int BUFFERED_OPTION = 1 << 2;
/** Don't debug graphics operations. */
public static final int NONE_OPTION = -1;
static {
--- 58,68 ----
/** Log graphics operations. */
public static final int LOG_OPTION = 1 << 0;
/** Flash graphics operations. */
public static final int FLASH_OPTION = 1 << 1;
! /** Show buffered operations in a separate {@code Frame}. */
public static final int BUFFERED_OPTION = 1 << 2;
/** Don't debug graphics operations. */
public static final int NONE_OPTION = -1;
static {
*** 101,111 ****
this();
this.graphics = graphics;
}
/**
! * Overrides <code>Graphics.create</code> to return a DebugGraphics object.
*/
public Graphics create() {
DebugGraphics debugGraphics;
debugGraphics = new DebugGraphics();
--- 101,111 ----
this();
this.graphics = graphics;
}
/**
! * Overrides {@code Graphics.create} to return a DebugGraphics object.
*/
public Graphics create() {
DebugGraphics debugGraphics;
debugGraphics = new DebugGraphics();
*** 115,125 ****
return debugGraphics;
}
/**
! * Overrides <code>Graphics.create</code> to return a DebugGraphics object.
*/
public Graphics create(int x, int y, int width, int height) {
DebugGraphics debugGraphics;
debugGraphics = new DebugGraphics();
--- 115,125 ----
return debugGraphics;
}
/**
! * Overrides {@code Graphics.create} to return a DebugGraphics object.
*/
public Graphics create(int x, int y, int width, int height) {
DebugGraphics debugGraphics;
debugGraphics = new DebugGraphics();
*** 249,273 ****
//-----------------------------------------------
// OVERRIDDEN METHODS
//------------------------------------------------
/**
! * Overrides <code>Graphics.getFontMetrics</code>.
*/
public FontMetrics getFontMetrics() {
return graphics.getFontMetrics();
}
/**
! * Overrides <code>Graphics.getFontMetrics</code>.
*/
public FontMetrics getFontMetrics(Font f) {
return graphics.getFontMetrics(f);
}
/**
! * Overrides <code>Graphics.translate</code>.
*/
public void translate(int x, int y) {
if (debugLog()) {
info().log(toShortString() +
" Translating by: " + new Point(x, y));
--- 249,273 ----
//-----------------------------------------------
// OVERRIDDEN METHODS
//------------------------------------------------
/**
! * Overrides {@code Graphics.getFontMetrics}.
*/
public FontMetrics getFontMetrics() {
return graphics.getFontMetrics();
}
/**
! * Overrides {@code Graphics.getFontMetrics}.
*/
public FontMetrics getFontMetrics(Font f) {
return graphics.getFontMetrics(f);
}
/**
! * Overrides {@code Graphics.translate}.
*/
public void translate(int x, int y) {
if (debugLog()) {
info().log(toShortString() +
" Translating by: " + new Point(x, y));
*** 276,313 ****
yOffset += y;
graphics.translate(x, y);
}
/**
! * Overrides <code>Graphics.setPaintMode</code>.
*/
public void setPaintMode() {
if (debugLog()) {
info().log(toShortString() + " Setting paint mode");
}
graphics.setPaintMode();
}
/**
! * Overrides <code>Graphics.setXORMode</code>.
*/
public void setXORMode(Color aColor) {
if (debugLog()) {
info().log(toShortString() + " Setting XOR mode: " + aColor);
}
graphics.setXORMode(aColor);
}
/**
! * Overrides <code>Graphics.getClipBounds</code>.
*/
public Rectangle getClipBounds() {
return graphics.getClipBounds();
}
/**
! * Overrides <code>Graphics.clipRect</code>.
*/
public void clipRect(int x, int y, int width, int height) {
graphics.clipRect(x, y, width, height);
if (debugLog()) {
info().log(toShortString() +
--- 276,313 ----
yOffset += y;
graphics.translate(x, y);
}
/**
! * Overrides {@code Graphics.setPaintMode}.
*/
public void setPaintMode() {
if (debugLog()) {
info().log(toShortString() + " Setting paint mode");
}
graphics.setPaintMode();
}
/**
! * Overrides {@code Graphics.setXORMode}.
*/
public void setXORMode(Color aColor) {
if (debugLog()) {
info().log(toShortString() + " Setting XOR mode: " + aColor);
}
graphics.setXORMode(aColor);
}
/**
! * Overrides {@code Graphics.getClipBounds}.
*/
public Rectangle getClipBounds() {
return graphics.getClipBounds();
}
/**
! * Overrides {@code Graphics.clipRect}.
*/
public void clipRect(int x, int y, int width, int height) {
graphics.clipRect(x, y, width, height);
if (debugLog()) {
info().log(toShortString() +
*** 315,354 ****
" New clipRect: " + graphics.getClip());
}
}
/**
! * Overrides <code>Graphics.setClip</code>.
*/
public void setClip(int x, int y, int width, int height) {
graphics.setClip(x, y, width, height);
if (debugLog()) {
info().log(toShortString() +
" Setting new clipRect: " + graphics.getClip());
}
}
/**
! * Overrides <code>Graphics.getClip</code>.
*/
public Shape getClip() {
return graphics.getClip();
}
/**
! * Overrides <code>Graphics.setClip</code>.
*/
public void setClip(Shape clip) {
graphics.setClip(clip);
if (debugLog()) {
info().log(toShortString() +
" Setting new clipRect: " + graphics.getClip());
}
}
/**
! * Overrides <code>Graphics.drawRect</code>.
*/
public void drawRect(int x, int y, int width, int height) {
DebugGraphicsInfo info = info();
if (debugLog()) {
--- 315,354 ----
" New clipRect: " + graphics.getClip());
}
}
/**
! * Overrides {@code Graphics.setClip}.
*/
public void setClip(int x, int y, int width, int height) {
graphics.setClip(x, y, width, height);
if (debugLog()) {
info().log(toShortString() +
" Setting new clipRect: " + graphics.getClip());
}
}
/**
! * Overrides {@code Graphics.getClip}.
*/
public Shape getClip() {
return graphics.getClip();
}
/**
! * Overrides {@code Graphics.setClip}.
*/
public void setClip(Shape clip) {
graphics.setClip(clip);
if (debugLog()) {
info().log(toShortString() +
" Setting new clipRect: " + graphics.getClip());
}
}
/**
! * Overrides {@code Graphics.drawRect}.
*/
public void drawRect(int x, int y, int width, int height) {
DebugGraphicsInfo info = info();
if (debugLog()) {
*** 378,388 ****
}
graphics.drawRect(x, y, width, height);
}
/**
! * Overrides <code>Graphics.fillRect</code>.
*/
public void fillRect(int x, int y, int width, int height) {
DebugGraphicsInfo info = info();
if (debugLog()) {
--- 378,388 ----
}
graphics.drawRect(x, y, width, height);
}
/**
! * Overrides {@code Graphics.fillRect}.
*/
public void fillRect(int x, int y, int width, int height) {
DebugGraphicsInfo info = info();
if (debugLog()) {
*** 412,422 ****
}
graphics.fillRect(x, y, width, height);
}
/**
! * Overrides <code>Graphics.clearRect</code>.
*/
public void clearRect(int x, int y, int width, int height) {
DebugGraphicsInfo info = info();
if (debugLog()) {
--- 412,422 ----
}
graphics.fillRect(x, y, width, height);
}
/**
! * Overrides {@code Graphics.clearRect}.
*/
public void clearRect(int x, int y, int width, int height) {
DebugGraphicsInfo info = info();
if (debugLog()) {
*** 446,456 ****
}
graphics.clearRect(x, y, width, height);
}
/**
! * Overrides <code>Graphics.drawRoundRect</code>.
*/
public void drawRoundRect(int x, int y, int width, int height,
int arcWidth, int arcHeight) {
DebugGraphicsInfo info = info();
--- 446,456 ----
}
graphics.clearRect(x, y, width, height);
}
/**
! * Overrides {@code Graphics.drawRoundRect}.
*/
public void drawRoundRect(int x, int y, int width, int height,
int arcWidth, int arcHeight) {
DebugGraphicsInfo info = info();
*** 484,494 ****
}
graphics.drawRoundRect(x, y, width, height, arcWidth, arcHeight);
}
/**
! * Overrides <code>Graphics.fillRoundRect</code>.
*/
public void fillRoundRect(int x, int y, int width, int height,
int arcWidth, int arcHeight) {
DebugGraphicsInfo info = info();
--- 484,494 ----
}
graphics.drawRoundRect(x, y, width, height, arcWidth, arcHeight);
}
/**
! * Overrides {@code Graphics.fillRoundRect}.
*/
public void fillRoundRect(int x, int y, int width, int height,
int arcWidth, int arcHeight) {
DebugGraphicsInfo info = info();
*** 522,532 ****
}
graphics.fillRoundRect(x, y, width, height, arcWidth, arcHeight);
}
/**
! * Overrides <code>Graphics.drawLine</code>.
*/
public void drawLine(int x1, int y1, int x2, int y2) {
DebugGraphicsInfo info = info();
if (debugLog()) {
--- 522,532 ----
}
graphics.fillRoundRect(x, y, width, height, arcWidth, arcHeight);
}
/**
! * Overrides {@code Graphics.drawLine}.
*/
public void drawLine(int x1, int y1, int x2, int y2) {
DebugGraphicsInfo info = info();
if (debugLog()) {
*** 556,566 ****
}
graphics.drawLine(x1, y1, x2, y2);
}
/**
! * Overrides <code>Graphics.draw3DRect</code>.
*/
public void draw3DRect(int x, int y, int width, int height,
boolean raised) {
DebugGraphicsInfo info = info();
--- 556,566 ----
}
graphics.drawLine(x1, y1, x2, y2);
}
/**
! * Overrides {@code Graphics.draw3DRect}.
*/
public void draw3DRect(int x, int y, int width, int height,
boolean raised) {
DebugGraphicsInfo info = info();
*** 591,601 ****
}
graphics.draw3DRect(x, y, width, height, raised);
}
/**
! * Overrides <code>Graphics.fill3DRect</code>.
*/
public void fill3DRect(int x, int y, int width, int height,
boolean raised) {
DebugGraphicsInfo info = info();
--- 591,601 ----
}
graphics.draw3DRect(x, y, width, height, raised);
}
/**
! * Overrides {@code Graphics.fill3DRect}.
*/
public void fill3DRect(int x, int y, int width, int height,
boolean raised) {
DebugGraphicsInfo info = info();
*** 626,636 ****
}
graphics.fill3DRect(x, y, width, height, raised);
}
/**
! * Overrides <code>Graphics.drawOval</code>.
*/
public void drawOval(int x, int y, int width, int height) {
DebugGraphicsInfo info = info();
if (debugLog()) {
--- 626,636 ----
}
graphics.fill3DRect(x, y, width, height, raised);
}
/**
! * Overrides {@code Graphics.drawOval}.
*/
public void drawOval(int x, int y, int width, int height) {
DebugGraphicsInfo info = info();
if (debugLog()) {
*** 659,669 ****
}
graphics.drawOval(x, y, width, height);
}
/**
! * Overrides <code>Graphics.fillOval</code>.
*/
public void fillOval(int x, int y, int width, int height) {
DebugGraphicsInfo info = info();
if (debugLog()) {
--- 659,669 ----
}
graphics.drawOval(x, y, width, height);
}
/**
! * Overrides {@code Graphics.fillOval}.
*/
public void fillOval(int x, int y, int width, int height) {
DebugGraphicsInfo info = info();
if (debugLog()) {
*** 692,702 ****
}
graphics.fillOval(x, y, width, height);
}
/**
! * Overrides <code>Graphics.drawArc</code>.
*/
public void drawArc(int x, int y, int width, int height,
int startAngle, int arcAngle) {
DebugGraphicsInfo info = info();
--- 692,702 ----
}
graphics.fillOval(x, y, width, height);
}
/**
! * Overrides {@code Graphics.drawArc}.
*/
public void drawArc(int x, int y, int width, int height,
int startAngle, int arcAngle) {
DebugGraphicsInfo info = info();
*** 729,739 ****
}
graphics.drawArc(x, y, width, height, startAngle, arcAngle);
}
/**
! * Overrides <code>Graphics.fillArc</code>.
*/
public void fillArc(int x, int y, int width, int height,
int startAngle, int arcAngle) {
DebugGraphicsInfo info = info();
--- 729,739 ----
}
graphics.drawArc(x, y, width, height, startAngle, arcAngle);
}
/**
! * Overrides {@code Graphics.fillArc}.
*/
public void fillArc(int x, int y, int width, int height,
int startAngle, int arcAngle) {
DebugGraphicsInfo info = info();
*** 766,776 ****
}
graphics.fillArc(x, y, width, height, startAngle, arcAngle);
}
/**
! * Overrides <code>Graphics.drawPolyline</code>.
*/
public void drawPolyline(int xPoints[], int yPoints[], int nPoints) {
DebugGraphicsInfo info = info();
if (debugLog()) {
--- 766,776 ----
}
graphics.fillArc(x, y, width, height, startAngle, arcAngle);
}
/**
! * Overrides {@code Graphics.drawPolyline}.
*/
public void drawPolyline(int xPoints[], int yPoints[], int nPoints) {
DebugGraphicsInfo info = info();
if (debugLog()) {
*** 801,811 ****
}
graphics.drawPolyline(xPoints, yPoints, nPoints);
}
/**
! * Overrides <code>Graphics.drawPolygon</code>.
*/
public void drawPolygon(int xPoints[], int yPoints[], int nPoints) {
DebugGraphicsInfo info = info();
if (debugLog()) {
--- 801,811 ----
}
graphics.drawPolyline(xPoints, yPoints, nPoints);
}
/**
! * Overrides {@code Graphics.drawPolygon}.
*/
public void drawPolygon(int xPoints[], int yPoints[], int nPoints) {
DebugGraphicsInfo info = info();
if (debugLog()) {
*** 836,846 ****
}
graphics.drawPolygon(xPoints, yPoints, nPoints);
}
/**
! * Overrides <code>Graphics.fillPolygon</code>.
*/
public void fillPolygon(int xPoints[], int yPoints[], int nPoints) {
DebugGraphicsInfo info = info();
if (debugLog()) {
--- 836,846 ----
}
graphics.drawPolygon(xPoints, yPoints, nPoints);
}
/**
! * Overrides {@code Graphics.fillPolygon}.
*/
public void fillPolygon(int xPoints[], int yPoints[], int nPoints) {
DebugGraphicsInfo info = info();
if (debugLog()) {
*** 871,881 ****
}
graphics.fillPolygon(xPoints, yPoints, nPoints);
}
/**
! * Overrides <code>Graphics.drawString</code>.
*/
public void drawString(String aString, int x, int y) {
DebugGraphicsInfo info = info();
if (debugLog()) {
--- 871,881 ----
}
graphics.fillPolygon(xPoints, yPoints, nPoints);
}
/**
! * Overrides {@code Graphics.drawString}.
*/
public void drawString(String aString, int x, int y) {
DebugGraphicsInfo info = info();
if (debugLog()) {
*** 906,916 ****
}
graphics.drawString(aString, x, y);
}
/**
! * Overrides <code>Graphics.drawString</code>.
*/
public void drawString(AttributedCharacterIterator iterator, int x, int y) {
DebugGraphicsInfo info = info();
if (debugLog()) {
--- 906,916 ----
}
graphics.drawString(aString, x, y);
}
/**
! * Overrides {@code Graphics.drawString}.
*/
public void drawString(AttributedCharacterIterator iterator, int x, int y) {
DebugGraphicsInfo info = info();
if (debugLog()) {
*** 941,951 ****
}
graphics.drawString(iterator, x, y);
}
/**
! * Overrides <code>Graphics.drawBytes</code>.
*/
public void drawBytes(byte data[], int offset, int length, int x, int y) {
DebugGraphicsInfo info = info();
Font font = graphics.getFont();
--- 941,951 ----
}
graphics.drawString(iterator, x, y);
}
/**
! * Overrides {@code Graphics.drawBytes}.
*/
public void drawBytes(byte data[], int offset, int length, int x, int y) {
DebugGraphicsInfo info = info();
Font font = graphics.getFont();
*** 977,987 ****
}
graphics.drawBytes(data, offset, length, x, y);
}
/**
! * Overrides <code>Graphics.drawChars</code>.
*/
public void drawChars(char data[], int offset, int length, int x, int y) {
DebugGraphicsInfo info = info();
Font font = graphics.getFont();
--- 977,987 ----
}
graphics.drawBytes(data, offset, length, x, y);
}
/**
! * Overrides {@code Graphics.drawChars}.
*/
public void drawChars(char data[], int offset, int length, int x, int y) {
DebugGraphicsInfo info = info();
Font font = graphics.getFont();
*** 1013,1023 ****
}
graphics.drawChars(data, offset, length, x, y);
}
/**
! * Overrides <code>Graphics.drawImage</code>.
*/
public boolean drawImage(Image img, int x, int y,
ImageObserver observer) {
DebugGraphicsInfo info = info();
--- 1013,1023 ----
}
graphics.drawChars(data, offset, length, x, y);
}
/**
! * Overrides {@code Graphics.drawImage}.
*/
public boolean drawImage(Image img, int x, int y,
ImageObserver observer) {
DebugGraphicsInfo info = info();
*** 1057,1067 ****
}
return graphics.drawImage(img, x, y, observer);
}
/**
! * Overrides <code>Graphics.drawImage</code>.
*/
public boolean drawImage(Image img, int x, int y, int width, int height,
ImageObserver observer) {
DebugGraphicsInfo info = info();
--- 1057,1067 ----
}
return graphics.drawImage(img, x, y, observer);
}
/**
! * Overrides {@code Graphics.drawImage}.
*/
public boolean drawImage(Image img, int x, int y, int width, int height,
ImageObserver observer) {
DebugGraphicsInfo info = info();
*** 1101,1111 ****
}
return graphics.drawImage(img, x, y, width, height, observer);
}
/**
! * Overrides <code>Graphics.drawImage</code>.
*/
public boolean drawImage(Image img, int x, int y,
Color bgcolor,
ImageObserver observer) {
DebugGraphicsInfo info = info();
--- 1101,1111 ----
}
return graphics.drawImage(img, x, y, width, height, observer);
}
/**
! * Overrides {@code Graphics.drawImage}.
*/
public boolean drawImage(Image img, int x, int y,
Color bgcolor,
ImageObserver observer) {
DebugGraphicsInfo info = info();
*** 1147,1157 ****
}
return graphics.drawImage(img, x, y, bgcolor, observer);
}
/**
! * Overrides <code>Graphics.drawImage</code>.
*/
public boolean drawImage(Image img, int x, int y,int width, int height,
Color bgcolor,
ImageObserver observer) {
DebugGraphicsInfo info = info();
--- 1147,1157 ----
}
return graphics.drawImage(img, x, y, bgcolor, observer);
}
/**
! * Overrides {@code Graphics.drawImage}.
*/
public boolean drawImage(Image img, int x, int y,int width, int height,
Color bgcolor,
ImageObserver observer) {
DebugGraphicsInfo info = info();
*** 1194,1204 ****
}
return graphics.drawImage(img, x, y, width, height, bgcolor, observer);
}
/**
! * Overrides <code>Graphics.drawImage</code>.
*/
public boolean drawImage(Image img,
int dx1, int dy1, int dx2, int dy2,
int sx1, int sy1, int sx2, int sy2,
ImageObserver observer) {
--- 1194,1204 ----
}
return graphics.drawImage(img, x, y, width, height, bgcolor, observer);
}
/**
! * Overrides {@code Graphics.drawImage}.
*/
public boolean drawImage(Image img,
int dx1, int dy1, int dx2, int dy2,
int sx1, int sy1, int sx2, int sy2,
ImageObserver observer) {
*** 1244,1254 ****
return graphics.drawImage(img, dx1, dy1, dx2, dy2, sx1, sy1, sx2, sy2,
observer);
}
/**
! * Overrides <code>Graphics.drawImage</code>.
*/
public boolean drawImage(Image img,
int dx1, int dy1, int dx2, int dy2,
int sx1, int sy1, int sx2, int sy2,
Color bgcolor,
--- 1244,1254 ----
return graphics.drawImage(img, dx1, dy1, dx2, dy2, sx1, sy1, sx2, sy2,
observer);
}
/**
! * Overrides {@code Graphics.drawImage}.
*/
public boolean drawImage(Image img,
int dx1, int dy1, int dx2, int dy2,
int sx1, int sy1, int sx2, int sy2,
Color bgcolor,
*** 1301,1311 ****
imageLoadingIcon.loadImage(img);
}
/**
! * Overrides <code>Graphics.copyArea</code>.
*/
public void copyArea(int x, int y, int width, int height,
int destX, int destY) {
if (debugLog()) {
info().log(toShortString() +
--- 1301,1311 ----
imageLoadingIcon.loadImage(img);
}
/**
! * Overrides {@code Graphics.copyArea}.
*/
public void copyArea(int x, int y, int width, int height,
int destX, int destY) {
if (debugLog()) {
info().log(toShortString() +
*** 1322,1332 ****
} catch (Exception e) {
}
}
/**
! * Overrides <code>Graphics.dispose</code>.
*/
public void dispose() {
graphics.dispose();
graphics = null;
}
--- 1322,1332 ----
} catch (Exception e) {
}
}
/**
! * Overrides {@code Graphics.dispose}.
*/
public void dispose() {
graphics.dispose();
graphics = null;
}
< prev index next >