1 /* DebugGraphics.java --
2 Copyright (C) 2002 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. */
42 import java
.awt
.image
.*;
48 * @author Andrew Selkirk
51 public class DebugGraphics
extends Graphics
{
53 //-------------------------------------------------------------
54 // Variables --------------------------------------------------
55 //-------------------------------------------------------------
90 public static final int LOG_OPTION
= 1;
95 public static final int FLASH_OPTION
= 2;
100 public static final int BUFFERED_OPTION
= 4;
105 public static final int NONE_OPTION
= -1;
108 //-------------------------------------------------------------
109 // Initialization ---------------------------------------------
110 //-------------------------------------------------------------
113 * Constructor DebugGraphics
115 public DebugGraphics() {
120 * Constructor DebugGraphics
121 * @param graphics TODO
122 * @param component TODO
124 public DebugGraphics(Graphics graphics
, JComponent component
) {
129 * Constructor DebugGraphics
130 * @param graphics TODO
132 public DebugGraphics(Graphics graphics
) {
137 //-------------------------------------------------------------
138 // Methods ----------------------------------------------------
139 //-------------------------------------------------------------
145 public void setColor(Color color
) {
153 public Graphics
create() {
165 public Graphics
create(int valx
, int y
, int w
, int h
) {
173 public static Color
flashColor() {
181 public static void setFlashColor(Color color
) {
189 public static int flashTime() {
197 public static void setFlashTime(int time
) {
205 public static int flashCount() {
213 public static void setFlashCount(int count
) {
219 * @returns PrintStream
221 public static PrintStream
logStream() {
229 public static void setLogStream(PrintStream stream
) {
237 public Font
getFont() {
245 public void setFont(Font font
) {
253 public Color
getColor() {
259 * @returns FontMetrics
261 public FontMetrics
getFontMetrics() {
263 } // getFontMetrics()
268 * @returns FontMetrics
270 public FontMetrics
getFontMetrics(Font font
) {
272 } // getFontMetrics()
279 public void translate(int x
, int y
) {
286 public void setPaintMode() {
294 public void setXORMode(Color color
) {
302 public Rectangle
getClipBounds() {
313 public void clipRect(int value0
, int value1
, int value2
, int value3
) {
324 public void setClip(int x
, int y
, int w
, int h
) {
332 public Shape
getClip() {
340 public void setClip(Shape shape
) {
351 public void drawRect(int x
, int y
, int w
, int h
) {
362 public void fillRect(int x
, int y
, int w
, int h
) {
373 public void clearRect(int x
, int y
, int w
, int h
) {
383 * @param arcWidth TODO
384 * @param arcHeight TODO
386 public void drawRoundRect(int x
, int y
, int w
, int h
,
387 int arcWidth
, int arcHeight
) {
397 * @param arcWidth TODO
398 * @param arcHeight TODO
400 public void fillRoundRect(int x
, int y
, int w
, int h
,
401 int arcWidth
, int arcHeight
) {
412 public void drawLine(int x1
, int y1
, int x2
, int y2
) {
424 public void draw3DRect(int x
, int y
, int w
, int h
, boolean raised
) {
436 public void fill3DRect(int x
, int y
, int w
, int h
, boolean raised
) {
447 public void drawOval(int x
, int y
, int w
, int h
) {
458 public void fillOval(int x
, int y
, int w
, int h
) {
468 * @param startAngle TODO
469 * @param arcAngle TODO
471 public void drawArc(int x
, int y
, int w
, int h
,
472 int startAngle
, int arcAngle
) {
482 * @param startAngle TODO
483 * @param arcAngle TODO
485 public void fillArc(int x
, int y
, int w
, int h
,
486 int startAngle
, int arcAngle
) {
492 * @param xpoints TODO
493 * @param ypoints TODO
494 * @param npoints TODO
496 public void drawPolyline(int[] xpoints
, int[] ypoints
, int npoints
) {
502 * @param xpoints TODO
503 * @param ypoints TODO
504 * @param npoints TODO
506 public void drawPolygon(int[] xpoints
, int[] ypoints
, int npoints
) {
512 * @param xpoints TODO
513 * @param ypoints TODO
514 * @param npoints TODO
516 public void fillPolygon(int[] xpoints
, int[] ypoints
, int npoints
) {
526 public void drawString(String string
, int s
, int y
) {
532 * @param iterator TODO
536 public void drawString(AttributedCharacterIterator iterator
,
549 public void drawBytes(byte[] data
, int offset
, int length
,
562 public void drawChars(char[] data
, int offset
, int value2
,
572 * @param observer TODO
575 public boolean drawImage(Image image
, int x
, int y
,
576 ImageObserver observer
) {
577 return false; // TODO
587 * @param observer TODO
590 public boolean drawImage(Image image
, int x
, int y
, int w
,
591 int h
, ImageObserver observer
) {
592 return false; // TODO
600 * @param background TODO
601 * @param observer TODO
604 public boolean drawImage(Image image
, int x
, int y
,
605 Color background
, ImageObserver observer
) {
606 return false; // TODO
616 * @param background TODO
617 * @param observer TODO
620 public boolean drawImage(Image image
, int x
, int y
, int w
, int h
,
621 Color background
, ImageObserver observer
) {
622 return false; // TODO
636 * @param observer TODO
639 public boolean drawImage(Image image
, int dx1
, int dy1
,
640 int dx2
, int dy2
, int sx1
, int sy1
, int sx2
, int sy2
,
641 ImageObserver observer
) {
642 return false; // TODO
656 * @param background TODO
657 * @param observer TODO
660 public boolean drawImage(Image image
, int dx1
, int dy1
,
661 int dx2
, int dy2
, int sx1
, int sy1
, int sx2
, int sy2
,
662 Color background
, ImageObserver observer
) {
663 return false; // TODO
675 public void copyArea(int x
, int y
, int w
, int h
,
676 int destx
, int desty
) {
683 public void dispose() {
691 public boolean isDrawingBuffer() {
692 return false; // TODO
693 } // isDrawingBuffer()
699 String
toShortString() {
705 * @param options TODO
707 public void setDebugOptions(int options
) {
709 } // setDebugOptions()
715 public int getDebugOptions() {
717 } // getDebugOptions()