Re: [cp-patches] FYI: Graphics2D.java - API docs

2006-05-15 Thread Mark Wielaard
Hi,

On Mon, 2006-05-15 at 10:24 +0100, David Gilbert wrote:
> 2006-05-15  David Gilbert  <[EMAIL PROTECTED]>
> 
>   * java/awt/Graphics2D.java: Added some API doc comments.
> [...]
> +import java.awt.print.PageFormat;
> +import java.awt.print.Printable;
> +import java.awt.print.PrinterJob;

For some unknown reason jikes completely fails to compile anything
unless that last import statement is removed. Since I this prevents the
autobuilder from working I have just removed it for now. Freaky.

2006-05-15  Mark Wielaard  <[EMAIL PROTECTED]>

   * java/awt/Graphics2D.java: Remove PrinterJob import.

Cheers,

Mark

diff -u -r1.9 Graphics2D.java
--- java/awt/Graphics2D.java15 May 2006 09:22:26 -  1.9
+++ java/awt/Graphics2D.java15 May 2006 23:14:07 -
@@ -47,7 +47,6 @@
 import java.awt.image.renderable.RenderableImage;
 import java.awt.print.PageFormat;
 import java.awt.print.Printable;
-import java.awt.print.PrinterJob;
 import java.text.AttributedCharacterIterator;
 import java.util.Map;


signature.asc
Description: This is a digitally signed message part


[cp-patches] FYI: Graphics2D.java - API docs

2006-05-15 Thread David Gilbert
This patch (committed) adds some API doc comments to Graphics2D.java.  These have 
been sitting on my hard drive for a while - they're not comprehensive or complete, 
but they're better than nothing at all:


2006-05-15  David Gilbert  <[EMAIL PROTECTED]>

* java/awt/Graphics2D.java: Added some API doc comments.

Regards,

Dave
Index: java/awt/Graphics2D.java
===
RCS file: /sources/classpath/classpath/java/awt/Graphics2D.java,v
retrieving revision 1.8
diff -u -r1.8 Graphics2D.java
--- java/awt/Graphics2D.java2 Jul 2005 20:32:24 -   1.8
+++ java/awt/Graphics2D.java15 May 2006 09:20:06 -
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2002, 2004  Free Software Foundation
+/* Copyright (C) 2000, 2002, 2004, 2006,  Free Software Foundation
 
 This file is part of GNU Classpath.
 
@@ -45,10 +45,36 @@
 import java.awt.image.ImageObserver;
 import java.awt.image.RenderedImage;
 import java.awt.image.renderable.RenderableImage;
+import java.awt.print.PageFormat;
+import java.awt.print.Printable;
+import java.awt.print.PrinterJob;
 import java.text.AttributedCharacterIterator;
 import java.util.Map;
 
 /**
+ * An abstract class defining a device independent two-dimensional vector 
+ * graphics API.  Concrete subclasses implement this API for output of 
+ * vector graphics to: (*)
+ * 
+ * 
+ * a [EMAIL PROTECTED] javax.swing.JComponent} - in the 
+ * [EMAIL PROTECTED] javax.swing.JComponent#paint(Graphics)} method, the 
incoming 
+ * [EMAIL PROTECTED] Graphics} should always be an instance of 
+ * Graphics2D (*); 
+ * a [EMAIL PROTECTED] BufferedImage} - see 
+ * [EMAIL PROTECTED] BufferedImage#createGraphics()} (*);
+ * a [EMAIL PROTECTED] PrinterJob} - in the 
+ * [EMAIL PROTECTED] Printable#print(Graphics, PageFormat, int)} method, 
the incoming
+ * [EMAIL PROTECTED] Graphics} should always be an instance of 
Graphics2D
+ * (*).
+ * 
+ * 
+ * (*) Support for this API is not fully implemented in GNU Classpath yet.
+ * 
+ * Third party libraries provide support for output to other formats via this 
+ * API, including encapsulated postscript (EPS), portable document format 
(PDF),
+ * and scalable vector graphics (SVG).
+ * 
  * @author Rolf W. Rasmussen ([EMAIL PROTECTED])
  */
 public abstract class Graphics2D extends Graphics
@@ -70,6 +96,14 @@
 super.fill3DRect(x, y, width, height, raised);
   }
 
+  /**
+   * Draws an outline around a shape using the current stroke and paint.
+   * 
+   * @param shape  the shape (null not permitted).
+   * 
+   * @see #getStroke()
+   * @see #getPaint()
+   */
   public abstract void draw(Shape shape);
 
   public abstract boolean drawImage(Image image, AffineTransform xform,
@@ -86,18 +120,57 @@
   public abstract void drawRenderableImage(RenderableImage image,
AffineTransform xform);
 
+  /**
+   * Draws a string at the specified location, using the current font.
+   * 
+   * @param text  the string to draw.
+   * @param x  the x-coordinate.
+   * @param y  the y-coordinate.
+   * 
+   * @see Graphics#setFont(Font)
+   */
   public abstract void drawString(String text, int x, int y);
 
+  /**
+   * Draws a string at the specified location, using the current font.
+   * 
+   * @param text  the string to draw.
+   * @param x  the x-coordinate.
+   * @param y  the y-coordinate.
+   * 
+   * @see Graphics#setFont(Font)
+   */
   public abstract void drawString(String text, float x, float y);
 
+  /**
+   * Draws an attributed string at the specified location.
+   * 
+   * @param iterator  the source of the attributed text.
+   * @param x  the x-coordinate.
+   * @param y  the y-coordinate.
+   */
   public abstract void drawString(AttributedCharacterIterator iterator,
   int x, int y);
 
+  /**
+   * Draws an attributed string at the specified location.
+   * 
+   * @param iterator  the source of the attributed text.
+   * @param x  the x-coordinate.
+   * @param y  the y-coordinate.
+   */
   public abstract void drawString(AttributedCharacterIterator iterator,
  float x, float y);
 
-  // public abstract void drawGlyphVector(GlyphVector g, float x, float y);
-
+  /**
+   * Fills the interior of the specified shape using the current
+   * paint.
+   * 
+   * @param shape  the shape to fill (null not permitted).
+   * 
+   * @see #draw(Shape)
+   * @see #getPaint()
+   */
   public abstract void fill(Shape shape);
 
   public abstract boolean hit(Rectangle rect, Shape text,
@@ -105,21 +178,72 @@
 
   public abstract GraphicsConfiguration getDeviceConfiguration();
 
+  /**
+   * Sets the current compositing rule.
+   * 
+   * @param comp  the composite.
+   * 
+   * @see #getComposite()
+   */
   public abstract void setComposite(Composite comp);
-
+
+  /**
+   * Sets the paint to be used for subsequent drawing operations.
+   * 
+   * @param paint