/[classpath]/classpath/gnu/java/awt/peer/gtk/GdkGraphics.java
ViewVC logotype

Diff of /classpath/gnu/java/awt/peer/gtk/GdkGraphics.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.26 by mark, Fri Jul 30 16:01:47 2004 UTC revision 1.27 by craig, Fri Jul 30 16:43:18 2004 UTC
# Line 238  public class GdkGraphics extends Graphic Line 238  public class GdkGraphics extends Graphic
238    public void drawRoundRect(int x, int y, int width, int height,    public void drawRoundRect(int x, int y, int width, int height,
239                              int arcWidth, int arcHeight)                              int arcWidth, int arcHeight)
240    {    {
241      // System.out.println ("drawRoundRect called [UNIMPLEMENTED]");      if (arcWidth > width)
242          arcWidth = width;
243        if (arcHeight > height)
244          arcHeight = height;
245    
246        int xx = x + width - arcWidth;
247        int yy = y + height - arcHeight;
248    
249        drawArc (x, y, arcWidth, arcHeight, 90, 90);
250        drawArc (xx, y, arcWidth, arcHeight, 0, 90);
251        drawArc (xx, yy, arcWidth, arcHeight, 270, 90);
252        drawArc (x, yy, arcWidth, arcHeight, 180, 90);
253    
254        int y1 = y + arcHeight / 2;
255        int y2 = y + height - arcHeight / 2;
256        drawLine (x, y1, x, y2);
257        drawLine (x + width, y1, x + width, y2);
258    
259        int x1 = x + arcWidth / 2;
260        int x2 = x + width - arcWidth / 2;
261        drawLine (x1, y, x2, y);
262        drawLine (x1, y + height, x2, y + height);
263    }    }
264    
265    public void fillRoundRect (int x, int y, int width, int height,    public void fillRoundRect (int x, int y, int width, int height,
266                               int arcWidth, int arcHeight)                               int arcWidth, int arcHeight)
267    {    {
268      // System.out.println ("fillRoundRect called [UNIMPLEMENTED]");      if (arcWidth > width)
269          arcWidth = width;
270        if (arcHeight > height)
271          arcHeight = height;
272    
273        int xx = x + width - arcWidth;
274        int yy = y + height - arcHeight;
275    
276        fillArc (x, y, arcWidth, arcHeight, 90, 90);
277        fillArc (xx, y, arcWidth, arcHeight, 0, 90);
278        fillArc (xx, yy, arcWidth, arcHeight, 270, 90);
279        fillArc (x, yy, arcWidth, arcHeight, 180, 90);
280    
281        fillRect (x, y + arcHeight / 2, width, height - arcHeight + 1);
282        fillRect (x + arcWidth / 2, y, width - arcWidth + 1, height);
283    }    }
284    
285    public Shape getClip ()    public Shape getClip ()

Legend:
Removed from v.1.26  
changed lines
  Added in v.1.27

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26