aboutsummaryrefslogtreecommitdiff
path: root/libjava/gnu/awt
diff options
context:
space:
mode:
authorScott Gilbertson <scottg@mantatest.com>2003-01-15 23:53:49 +0000
committerTom Tromey <tromey@gcc.gnu.org>2003-01-15 23:53:49 +0000
commitf826d5952cbea7d361f5e7869868acb7cce47d95 (patch)
tree1e952a7c0fcd20a9982a9bf4e674f1ab69fc7826 /libjava/gnu/awt
parent2af84af57ba04e022a258d99fb7b688017e583a7 (diff)
downloadgcc-f826d5952cbea7d361f5e7869868acb7cce47d95.zip
gcc-f826d5952cbea7d361f5e7869868acb7cce47d95.tar.gz
gcc-f826d5952cbea7d361f5e7869868acb7cce47d95.tar.bz2
natGC.cc (fillPolygon): New method.
2003-01-15 Scott Gilbertson <scottg@mantatest.com> * gnu/gcj/xlib/natGC.cc (fillPolygon): New method. * gnu/gcj/xlib/GC.java (fillPolygon): Declare. * gnu/awt/xlib/XGraphics.java (fillPolygon): Added translateX and translateY arguments. Implement. * gnu/awt/j2d/IntegerGraphicsState.java (fillPolygon): Pass down translation arguments. (drawPolyline, drawPolygon): Fix incorrect tests. * gnu/awt/j2d/DirectRasterGraphics.java (fillPolygon): Added translateX and translateY arguments. From-SVN: r61369
Diffstat (limited to 'libjava/gnu/awt')
-rw-r--r--libjava/gnu/awt/j2d/DirectRasterGraphics.java5
-rw-r--r--libjava/gnu/awt/j2d/IntegerGraphicsState.java18
-rw-r--r--libjava/gnu/awt/xlib/XGraphics.java8
3 files changed, 14 insertions, 17 deletions
diff --git a/libjava/gnu/awt/j2d/DirectRasterGraphics.java b/libjava/gnu/awt/j2d/DirectRasterGraphics.java
index 8d25b88..28aad9b 100644
--- a/libjava/gnu/awt/j2d/DirectRasterGraphics.java
+++ b/libjava/gnu/awt/j2d/DirectRasterGraphics.java
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 Free Software Foundation
+/* Copyright (C) 2000, 2003 Free Software Foundation
This file is part of libgcj.
@@ -61,7 +61,8 @@ public interface DirectRasterGraphics extends Cloneable
public void drawPolygon(int[] xPoints, int[] yPoints, int nPoints);
- public void fillPolygon(int[] xPoints, int[] yPoints, int nPoints);
+ public void fillPolygon(int[] xPoints, int[] yPoints, int nPoints,
+ int translateX, int translateY);
public void drawString(String str, int x, int y);
diff --git a/libjava/gnu/awt/j2d/IntegerGraphicsState.java b/libjava/gnu/awt/j2d/IntegerGraphicsState.java
index 90a1a4d..bfea661 100644
--- a/libjava/gnu/awt/j2d/IntegerGraphicsState.java
+++ b/libjava/gnu/awt/j2d/IntegerGraphicsState.java
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 Free Software Foundation
+/* Copyright (C) 2000, 2003 Free Software Foundation
This file is part of libgcj.
@@ -212,7 +212,7 @@ public class IntegerGraphicsState extends AbstractGraphicsState
public void drawPolyline(int[] xPoints, int[] yPoints, int nPoints)
{
- if ((tx == 0) || (ty == 0))
+ if ((tx == 0) && (ty == 0))
{
directGfx.drawPolyline(xPoints, yPoints, nPoints);
return;
@@ -223,7 +223,7 @@ public class IntegerGraphicsState extends AbstractGraphicsState
public void drawPolygon(int[] xPoints, int[] yPoints, int nPoints)
{
- if ((tx == 0) || (ty == 0))
+ if ((tx == 0) && (ty == 0))
{
directGfx.drawPolygon(xPoints, yPoints, nPoints);
return;
@@ -232,15 +232,11 @@ public class IntegerGraphicsState extends AbstractGraphicsState
throw new UnsupportedOperationException("translate not implemented");
}
- public void fillPolygon(int[] xPoints, int[] yPoints, int nPoints)
+ public void fillPolygon (int[] xPoints, int[] yPoints, int nPoints)
{
- if ((tx == 0) || (ty == 0))
- {
- directGfx.fillPolygon(xPoints, yPoints, nPoints);
- return;
- }
-
- throw new UnsupportedOperationException("translate not implemented");
+ // FIXME: remove tx & ty args once translation via AffineTransform
+ // is implemented.
+ directGfx.fillPolygon (xPoints, yPoints, nPoints, tx, ty);
}
public boolean drawImage(Image image, int x, int y,
diff --git a/libjava/gnu/awt/xlib/XGraphics.java b/libjava/gnu/awt/xlib/XGraphics.java
index 27b07a2..90f5388 100644
--- a/libjava/gnu/awt/xlib/XGraphics.java
+++ b/libjava/gnu/awt/xlib/XGraphics.java
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 Free Software Foundation
+/* Copyright (C) 2000, 2003 Free Software Foundation
This file is part of libgcj.
@@ -176,10 +176,10 @@ public class XGraphics implements Cloneable, DirectRasterGraphics
throw new UnsupportedOperationException("not implemented");
}
- public void fillPolygon(int[] xPoints, int[] yPoints, int
- nPoints)
+ public void fillPolygon(int[] xPoints, int[] yPoints, int nPoints,
+ int translateX, int translateY)
{
- throw new UnsupportedOperationException("not implemented");
+ context.fillPolygon(xPoints, yPoints, nPoints, translateX, translateY);
}
public void drawString(String str, int x, int y)