Index: ChangeLog =================================================================== RCS file: /cvsroot/classpath/classpath/ChangeLog,v retrieving revision 1.2336 diff -u -r1.2336 ChangeLog --- ChangeLog 23 Jul 2004 13:59:00 -0000 1.2336 +++ ChangeLog 23 Jul 2004 18:06:59 -0000 @@ -1,5 +1,14 @@ 2004-07-23 Craig Black + * gnu/java/awt/peer/gtk/GdkGraphics.java + (drawRoundRect): Implemented. + (fillRoundRect): Implemented. + * gnu/java/awt/peer/gtk/GdkGraphics2D.java + (drawRoundRect): Reimplemented to match GdkGraphics. + (fillRoundRect): Reimplemented to match GdkGraphics. + +2004-07-23 Craig Black + * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuPeer.c (addTearOff_: New function. include/gnu_java_awt_peer_gtk_GtkMenuPeer.h: Regenerated. Index: gnu/java/awt/peer/gtk/GdkGraphics.java =================================================================== RCS file: /cvsroot/classpath/classpath/gnu/java/awt/peer/gtk/GdkGraphics.java,v retrieving revision 1.25 diff -u -r1.25 GdkGraphics.java --- gnu/java/awt/peer/gtk/GdkGraphics.java 31 May 2004 21:11:30 -0000 1.25 +++ gnu/java/awt/peer/gtk/GdkGraphics.java 23 Jul 2004 18:06:59 -0000 @@ -238,13 +238,48 @@ public void drawRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight) { - // System.out.println ("drawRoundRect called [UNIMPLEMENTED]"); + if (arcWidth > width) + arcWidth = width; + if (arcHeight > height) + arcHeight = height; + + int xx = x + width - arcWidth; + int yy = y + height - arcHeight; + + drawArc (x, y, arcWidth, arcHeight, 90, 90); + drawArc (xx, y, arcWidth, arcHeight, 0, 90); + drawArc (xx, yy, arcWidth, arcHeight, 270, 90); + drawArc (x, yy, arcWidth, arcHeight, 180, 90); + + int y1 = y + arcHeight / 2; + int y2 = y + height - arcHeight / 2; + drawLine (x, y1, x, y2); + drawLine (x + width, y1, x + width, y2); + + int x1 = x + arcWidth / 2; + int x2 = x + width - arcWidth / 2; + drawLine (x1, y, x2, y); + drawLine (x1, y + height, x2, y + height); } public void fillRoundRect (int x, int y, int width, int height, int arcWidth, int arcHeight) { - // System.out.println ("fillRoundRect called [UNIMPLEMENTED]"); + if (arcWidth > width) + arcWidth = width; + if (arcHeight > height) + arcHeight = height; + + int xx = x + width - arcWidth; + int yy = y + height - arcHeight; + + fillArc (x, y, arcWidth, arcHeight, 90, 90); + fillArc (xx, y, arcWidth, arcHeight, 0, 90); + fillArc (xx, yy, arcWidth, arcHeight, 270, 90); + fillArc (x, yy, arcWidth, arcHeight, 180, 90); + + fillRect (x, y + arcHeight / 2, width, height - arcHeight + 1); + fillRect (x + arcWidth / 2, y, width - arcWidth + 1, height); } public Shape getClip () Index: gnu/java/awt/peer/gtk/GdkGraphics2D.java =================================================================== RCS file: /cvsroot/classpath/classpath/gnu/java/awt/peer/gtk/GdkGraphics2D.java,v retrieving revision 1.12 diff -u -r1.12 GdkGraphics2D.java --- gnu/java/awt/peer/gtk/GdkGraphics2D.java 26 Jun 2004 16:06:47 -0000 1.12 +++ gnu/java/awt/peer/gtk/GdkGraphics2D.java 23 Jul 2004 18:06:59 -0000 @@ -1478,14 +1478,28 @@ public void drawRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight) { - int x1 = x + arcWidth, x2 = x + width - arcWidth; - int y1 = y + arcHeight, y2 = y + height - arcHeight; - fillRect (x1, y, x2 - x1, height); - fillRect (x, y1, width, y2 - y1); - fillArc (x, y, arcWidth, arcHeight, 90, 90); - fillArc (x1, y, arcWidth, arcHeight, 0, 90); - fillArc (x2, y2, arcWidth, arcHeight, 270, 90); - fillArc (x, y2, arcWidth, arcHeight, 180, 90); + if (arcWidth > width) + arcWidth = width; + if (arcHeight > height) + arcHeight = height; + + int xx = x + width - arcWidth; + int yy = y + height - arcHeight; + + drawArc (x, y, arcWidth, arcHeight, 90, 90); + drawArc (xx, y, arcWidth, arcHeight, 0, 90); + drawArc (xx, yy, arcWidth, arcHeight, 270, 90); + drawArc (x, yy, arcWidth, arcHeight, 180, 90); + + int y1 = y + arcHeight / 2; + int y2 = y + height - arcHeight / 2; + drawLine (x, y1, x, y2); + drawLine (x + width, y1, x + width, y2); + + int x1 = x + arcWidth / 2; + int x2 = x + width - arcWidth / 2; + drawLine (x1, y, x2, y); + drawLine (x1, y + height, x2, y + height); } public void drawString (String str, int x, int y) @@ -1527,14 +1541,21 @@ public void fillRoundRect (int x, int y, int width, int height, int arcWidth, int arcHeight) { - int x1 = x + arcWidth, x2 = x + width - arcWidth; - int y1 = y + arcHeight, y2 = y + height - arcHeight; - fillRect (x1, y, x2 - x1, height); - fillRect (x, y1, width, y2 - y1); + if (arcWidth > width) + arcWidth = width; + if (arcHeight > height) + arcHeight = height; + + int xx = x + width - arcWidth; + int yy = y + height - arcHeight; + fillArc (x, y, arcWidth, arcHeight, 90, 90); - fillArc (x1, y, arcWidth, arcHeight, 0, 90); - fillArc (x2, y2, arcWidth, arcHeight, 270, 90); - fillArc (x, y2, arcWidth, arcHeight, 180, 90); + fillArc (xx, y, arcWidth, arcHeight, 0, 90); + fillArc (xx, yy, arcWidth, arcHeight, 270, 90); + fillArc (x, yy, arcWidth, arcHeight, 180, 90); + + fillRect (x, y + arcHeight / 2, width, height - arcHeight + 1); + fillRect (x + arcWidth / 2, y, width - arcWidth + 1, height); } public Font getFont ()