1 /* DebugGraphics.java --
2 Copyright (C) 2002, 2004 Free Software Foundation, Inc.
4 This file is part of GNU Classpath.
6 GNU Classpath is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
11 GNU Classpath is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with GNU Classpath; see the file COPYING. If not, write to the
18 Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
21 Linking this library statically or dynamically with other modules is
22 making a combined work based on this library. Thus, the terms and
23 conditions of the GNU General Public License cover the whole
26 As a special exception, the copyright holders of this library give you
27 permission to link this library with independent modules to produce an
28 executable, regardless of the license terms of these independent
29 modules, and to copy and distribute the resulting executable under
30 terms of your choice, provided that you also meet, for each linked
31 independent module, the terms and conditions of the license of that
32 module. An independent module is a module which is not derived from
33 or based on this library. If you modify this library, you may extend
34 this exception to your version of the library, but you are not
35 obligated to do so. If you do not wish to do so, delete this
36 exception statement from your version. */
40 import java
.awt
.Color
;
42 import java
.awt
.FontMetrics
;
43 import java
.awt
.Graphics
;
44 import java
.awt
.Image
;
45 import java
.awt
.Rectangle
;
46 import java
.awt
.Shape
;
47 import java
.awt
.image
.ImageObserver
;
48 import java
.io
.PrintStream
;
49 import java
.text
.AttributedCharacterIterator
;
53 * @author Andrew Selkirk
56 public class DebugGraphics
extends Graphics
{
58 //-------------------------------------------------------------
59 // Variables --------------------------------------------------
60 //-------------------------------------------------------------
95 public static final int LOG_OPTION
= 1;
100 public static final int FLASH_OPTION
= 2;
105 public static final int BUFFERED_OPTION
= 4;
110 public static final int NONE_OPTION
= -1;
113 //-------------------------------------------------------------
114 // Initialization ---------------------------------------------
115 //-------------------------------------------------------------
118 * Constructor DebugGraphics
120 public DebugGraphics() {
125 * Constructor DebugGraphics
126 * @param graphics TODO
127 * @param component TODO
129 public DebugGraphics(Graphics graphics
, JComponent component
) {
134 * Constructor DebugGraphics
135 * @param graphics TODO
137 public DebugGraphics(Graphics graphics
) {
142 //-------------------------------------------------------------
143 // Methods ----------------------------------------------------
144 //-------------------------------------------------------------
150 public void setColor(Color color
) {
158 public Graphics
create() {
170 public Graphics
create(int valx
, int y
, int w
, int h
) {
178 public static Color
flashColor() {
186 public static void setFlashColor(Color color
) {
194 public static int flashTime() {
202 public static void setFlashTime(int time
) {
210 public static int flashCount() {
218 public static void setFlashCount(int count
) {
224 * @returns PrintStream
226 public static PrintStream
logStream() {
234 public static void setLogStream(PrintStream stream
) {
242 public Font
getFont() {
250 public void setFont(Font font
) {
258 public Color
getColor() {
264 * @returns FontMetrics
266 public FontMetrics
getFontMetrics() {
268 } // getFontMetrics()
273 * @returns FontMetrics
275 public FontMetrics
getFontMetrics(Font font
) {
277 } // getFontMetrics()
284 public void translate(int x
, int y
) {
291 public void setPaintMode() {
299 public void setXORMode(Color color
) {
307 public Rectangle
getClipBounds() {
318 public void clipRect(int value0
, int value1
, int value2
, int value3
) {
329 public void setClip(int x
, int y
, int w
, int h
) {
337 public Shape
getClip() {
345 public void setClip(Shape shape
) {
356 public void drawRect(int x
, int y
, int w
, int h
) {
367 public void fillRect(int x
, int y
, int w
, int h
) {
378 public void clearRect(int x
, int y
, int w
, int h
) {
388 * @param arcWidth TODO
389 * @param arcHeight TODO
391 public void drawRoundRect(int x
, int y
, int w
, int h
,
392 int arcWidth
, int arcHeight
) {
402 * @param arcWidth TODO
403 * @param arcHeight TODO
405 public void fillRoundRect(int x
, int y
, int w
, int h
,
406 int arcWidth
, int arcHeight
) {
417 public void drawLine(int x1
, int y1
, int x2
, int y2
) {
429 public void draw3DRect(int x
, int y
, int w
, int h
, boolean raised
) {
441 public void fill3DRect(int x
, int y
, int w
, int h
, boolean raised
) {
452 public void drawOval(int x
, int y
, int w
, int h
) {
463 public void fillOval(int x
, int y
, int w
, int h
) {
473 * @param startAngle TODO
474 * @param arcAngle TODO
476 public void drawArc(int x
, int y
, int w
, int h
,
477 int startAngle
, int arcAngle
) {
487 * @param startAngle TODO
488 * @param arcAngle TODO
490 public void fillArc(int x
, int y
, int w
, int h
,
491 int startAngle
, int arcAngle
) {
497 * @param xpoints TODO
498 * @param ypoints TODO
499 * @param npoints TODO
501 public void drawPolyline(int[] xpoints
, int[] ypoints
, int npoints
) {
507 * @param xpoints TODO
508 * @param ypoints TODO
509 * @param npoints TODO
511 public void drawPolygon(int[] xpoints
, int[] ypoints
, int npoints
) {
517 * @param xpoints TODO
518 * @param ypoints TODO
519 * @param npoints TODO
521 public void fillPolygon(int[] xpoints
, int[] ypoints
, int npoints
) {
531 public void drawString(String string
, int s
, int y
) {
537 * @param iterator TODO
541 public void drawString(AttributedCharacterIterator iterator
,
554 public void drawBytes(byte[] data
, int offset
, int length
,
567 public void drawChars(char[] data
, int offset
, int value2
,
577 * @param observer TODO
580 public boolean drawImage(Image image
, int x
, int y
,
581 ImageObserver observer
) {
582 return false; // TODO
592 * @param observer TODO
595 public boolean drawImage(Image image
, int x
, int y
, int w
,
596 int h
, ImageObserver observer
) {
597 return false; // TODO
605 * @param background TODO
606 * @param observer TODO
609 public boolean drawImage(Image image
, int x
, int y
,
610 Color background
, ImageObserver observer
) {
611 return false; // TODO
621 * @param background TODO
622 * @param observer TODO
625 public boolean drawImage(Image image
, int x
, int y
, int w
, int h
,
626 Color background
, ImageObserver observer
) {
627 return false; // TODO
641 * @param observer TODO
644 public boolean drawImage(Image image
, int dx1
, int dy1
,
645 int dx2
, int dy2
, int sx1
, int sy1
, int sx2
, int sy2
,
646 ImageObserver observer
) {
647 return false; // TODO
661 * @param background TODO
662 * @param observer TODO
665 public boolean drawImage(Image image
, int dx1
, int dy1
,
666 int dx2
, int dy2
, int sx1
, int sy1
, int sx2
, int sy2
,
667 Color background
, ImageObserver observer
) {
668 return false; // TODO
680 public void copyArea(int x
, int y
, int w
, int h
,
681 int destx
, int desty
) {
688 public void dispose() {
696 public boolean isDrawingBuffer() {
697 return false; // TODO
698 } // isDrawingBuffer()
704 String
toShortString() {
710 * @param options TODO
712 public void setDebugOptions(int options
) {
714 } // setDebugOptions()
720 public int getDebugOptions() {
722 } // getDebugOptions()