gnu.jpdf
Class PDFGraphics

java.lang.Object
  extended by java.awt.Graphics
      extended by gnu.jpdf.PDFGraphics
All Implemented Interfaces:
java.io.Serializable

public class PDFGraphics
extends java.awt.Graphics
implements java.io.Serializable

This class is our implementation of AWT's Graphics class. It provides a Java standard way of rendering into a PDF Document's Page.

See Also:
PDFGraphics, Serialized Form

Field Summary
protected  java.awt.Rectangle clipRectangle
          This holds the current clipRectangle
protected  java.awt.Rectangle media
          This is the media we are working with
protected  int trax
          This is used to translate coordinates
protected  int tray
          This is used to translate coordinates
 
Constructor Summary
PDFGraphics()
           
 
Method Summary
 void arc(double axc, double ayc, double width, double height, double ang1, double ang2, boolean clockwise)
          This produces an arc by breaking it down into one or more Bezier curves.
 void clearRect(int x, int y, int w, int h)
          This simply draws a White Rectangle to clear the area
 void clipPolygon(java.awt.Polygon p)
          This extra method allows PDF users to clip to a Polygon.
 void clipRect(int x, int y, int w, int h)
          Clips to a set of coordinates
 void copyArea(int x, int y, int w, int h, int dx, int dy)
          This is unsupported - how do you do this with Vector graphics?
 java.awt.Graphics create()
          This returns a child instance of this Graphics object.
protected  PDFGraphics createGraphic(PDFPage page, java.io.PrintWriter pw)
          This method creates a new instance of the class based on the page and a print writer.
 void curveto(double x1, double y1, double x2, double y2)
          This extension appends a Bezier curve to the path.
 void curveto(double x1, double y1, double x2, double y2, double x3, double y3)
          This extension appends a Bezier curve to the path.
 void curveto(int x1, int y1, int x2, int y2)
          This extension appends a Bezier curve to the path.
 void curveto(int x1, int y1, int x2, int y2, int x3, int y3)
          This extension appends a Bezier curve to the path.
 void curveto2(double x1, double y1, double x2, double y2)
          This extension appends a Bezier curve to the path.
 void curveto2(int x1, int y1, int x2, int y2)
          This extension appends a Bezier curve to the path.
 void dispose()
          This releases any resources used by this Graphics object.
 void draw3DRect(int x, int y, int width, int height, boolean raised)
          Not implemented
 void drawArc(int x, int y, int w, int h, int sa, int aa)
          Draws an arc
 void drawBytes(byte[] data, int offset, int length, int x, int y)
          Not implemented
 boolean drawImage(java.awt.Image img, int x, int y, java.awt.Color bgcolor, java.awt.image.ImageObserver obs)
          Draw's an image onto the page, with a backing colour.
 boolean drawImage(java.awt.Image img, int x, int y, java.awt.image.ImageObserver obs)
          Draw's an image onto the page
 boolean drawImage(java.awt.Image img, int x, int y, int w, int h, java.awt.Color bgcolor, java.awt.image.ImageObserver obs)
          Draw's an image onto the page, with a backing colour.
 boolean drawImage(java.awt.Image img, int x, int y, int w, int h, java.awt.image.ImageObserver obs)
          Draws an image onto the page.
 boolean drawImage(java.awt.Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, java.awt.Color bgcolor, java.awt.image.ImageObserver obs)
          Draw's an image onto the page, with scaling
 boolean drawImage(java.awt.Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, java.awt.image.ImageObserver obs)
          Draw's an image onto the page, with scaling
 void drawLine(int x1, int y1, int x2, int y2)
          Draws a line between two coordinates.
 void drawOval(int x, int y, int w, int h)
          Draws an oval
 void drawPolygon(int[] xp, int[] yp, int np)
          Draws a polygon, linking the first and last coordinates.
 void drawPolyline(int[] xp, int[] yp, int np)
          Draws a polyline.
 void drawRect(int x, int y, int w, int h)
          We override Graphics.drawRect as it doesn't join the 4 lines.
 void drawRoundRect(int x, int y, int w, int h, int aw, int ah)
          This is not yet implemented
 void drawString(java.text.AttributedCharacterIterator aci, int x, int y)
          Draws a string using a AttributedCharacterIterator.
 void drawString(java.lang.String s, int x, int y)
          This draws a string.
 void fill3DRect(int x, int y, int width, int height, boolean raised)
          Not implemented
 void fillArc(int x, int y, int w, int h, int sa, int aa)
          Fills an arc, joining the start and end coordinates
 void fillOval(int x, int y, int w, int h)
          Draws a filled oval
 void fillPolygon(int[] xp, int[] yp, int np)
          Fills a polygon.
 void fillRect(int x, int y, int w, int h)
          Fills a rectangle with the current colour
 void fillRoundRect(int x, int y, int w, int h, int aw, int ah)
          This is not yet implemented
 java.awt.Shape getClip()
          Returns the Shape of the clipping region As my JDK docs say, this may break with Java 2D.
 java.awt.Rectangle getClipBounds()
          Returns the Rectangle that fits the current clipping region
 java.awt.Color getColor()
          Returns the current pen Colour
 java.awt.Font getFont()
          Return's the current font.
 java.awt.FontMetrics getFontMetrics(java.awt.Font font)
          Returns the FontMetrics for a font.
 PDFPage getPage()
          Returns the associated PDFPage for this graphic
 java.io.PrintWriter getWriter()
          Returns the PrintWriter handling the underlying stream
protected  void init(PDFPage page)
          This is called by PDFPage when creating a Graphcis instance.
protected  void init(PDFPage page, java.io.PrintWriter pw)
          This method is used internally by create() and by the PDFJob class
 void lineto(double x, double y)
          This adds a line segment to the current path
 void lineto(int x, int y)
          This adds a line segment to the current path
 void moveto(double x, double y)
          This moves the current drawing point.
 void moveto(int x, int y)
          This moves the current drawing point.
 void polygon(int[] xp, int[] yp, int np)
          This is used to add a polygon to the current path.
 void setClip(int x, int y, int w, int h)
          Clips to a set of coordinates
 void setClip(java.awt.Shape s)
          As my JDK docs say, this may break with Java 2D.
 void setColor(java.awt.Color c)
          Sets the colour for drawing
 void setDefaultLineWidth()
          This extension sets the line width to the default of 1mm which is what Java uses when drawing to a PrintJob.
 void setFont(java.awt.Font f)
          This sets the font.
 void setLineWidth(double w)
          This extension allows the width of the drawn line to be set
 void setOrientation()
          This sets the media Orientation (0=Portrait, 90=Landscape, 180=Inverse, 270=Seascape).
 void setPaintMode()
          Not implemented, as this is not supported in the PDF specification.
 void setXORMode(java.awt.Color c1)
          Not implemented, as this is not supported in the PDF specification.
 void translate(int x, int y)
          Translate the origin.
 
Methods inherited from class java.awt.Graphics
create, drawChars, drawPolygon, fillPolygon, finalize, getClipBounds, getClipRect, getFontMetrics, hitClip, toString
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

media

protected java.awt.Rectangle media
This is the media we are working with


trax

protected int trax
This is used to translate coordinates


tray

protected int tray
This is used to translate coordinates


clipRectangle

protected java.awt.Rectangle clipRectangle
This holds the current clipRectangle

Constructor Detail

PDFGraphics

public PDFGraphics()
Method Detail

createGraphic

protected PDFGraphics createGraphic(PDFPage page,
                                    java.io.PrintWriter pw)
This method creates a new instance of the class based on the page and a print writer.

Parameters:
page - the page to attach to
pw - the PrintWriter to attach to.

init

protected void init(PDFPage page)
This is called by PDFPage when creating a Graphcis instance.

Parameters:
page - The PDFPage to draw onto.

init

protected void init(PDFPage page,
                    java.io.PrintWriter pw)
This method is used internally by create() and by the PDFJob class

Parameters:
page - PDFPage to draw into
pw - PrintWriter to use

getWriter

public java.io.PrintWriter getWriter()
Returns the PrintWriter handling the underlying stream

Returns:
the PrintWriter handling the underlying stream

getPage

public PDFPage getPage()
Returns the associated PDFPage for this graphic

Returns:
the associated PDFPage for this graphic

create

public java.awt.Graphics create()

This returns a child instance of this Graphics object. As with AWT, the affects of using the parent instance while the child exists, is not determined.

Once complete, the child should be released with it's dispose() method which will restore the graphics state to it's parent.

Specified by:
create in class java.awt.Graphics
Returns:
Graphics object to render onto the page

dispose

public void dispose()

This releases any resources used by this Graphics object. You must use this method once finished with it. Leaving it open will leave the PDF stream in an inconsistent state, and will produce errors.

If this was created with Graphics.create() then the parent instance can be used again. If not, then this closes the graphics operations for this page when used with PDFJob.

When using PDFPage, you can create another fresh Graphics instance, which will draw over this one.

Specified by:
dispose in class java.awt.Graphics

clearRect

public void clearRect(int x,
                      int y,
                      int w,
                      int h)
This simply draws a White Rectangle to clear the area

Specified by:
clearRect in class java.awt.Graphics
Parameters:
x - coord
y - coord
w - width
h - height

drawRect

public void drawRect(int x,
                     int y,
                     int w,
                     int h)
We override Graphics.drawRect as it doesn't join the 4 lines. Also, PDF provides us with a Rectangle operator, so we will use that.

Overrides:
drawRect in class java.awt.Graphics
Parameters:
x - coord
y - coord
w - width
h - height

draw3DRect

public void draw3DRect(int x,
                       int y,
                       int width,
                       int height,
                       boolean raised)

Not implemented

Draws a 3-D highlighted outline of the specified rectangle. The edges of the rectangle are highlighted so that they appear to be beveled and lit from the upper left corner. The colors used for the highlighting effect are determined based on the current color. The resulting rectangle covers an area that is width + 1 pixels wide by height + 1 pixels tall.

Overrides:
draw3DRect in class java.awt.Graphics
Parameters:
x - an int value
y - an int value
width - an int value
height - an int value
raised - a boolean value

fill3DRect

public void fill3DRect(int x,
                       int y,
                       int width,
                       int height,
                       boolean raised)

Not implemented

Overrides:
fill3DRect in class java.awt.Graphics
Parameters:
x - an int value
y - an int value
width - an int value
height - an int value
raised - a boolean value

fillRect

public void fillRect(int x,
                     int y,
                     int w,
                     int h)
Fills a rectangle with the current colour

Specified by:
fillRect in class java.awt.Graphics
Parameters:
x - coord
y - coord
w - width
h - height

fillRoundRect

public void fillRoundRect(int x,
                          int y,
                          int w,
                          int h,
                          int aw,
                          int ah)
This is not yet implemented

Specified by:
fillRoundRect in class java.awt.Graphics
Parameters:
x - coord
y - coord
w - width
h - height
aw - a-width
ah - a-height

drawRoundRect

public void drawRoundRect(int x,
                          int y,
                          int w,
                          int h,
                          int aw,
                          int ah)
This is not yet implemented

Specified by:
drawRoundRect in class java.awt.Graphics
Parameters:
x - coord
y - coord
w - width
h - height
aw - a-width
ah - a-height

drawOval

public void drawOval(int x,
                     int y,
                     int w,
                     int h)

Draws an oval

Specified by:
drawOval in class java.awt.Graphics
Parameters:
x - coord
y - coord
w - width
h - height

fillOval

public void fillOval(int x,
                     int y,
                     int w,
                     int h)

Draws a filled oval

Specified by:
fillOval in class java.awt.Graphics
Parameters:
x - coord
y - coord
w - width
h - height

drawPolygon

public void drawPolygon(int[] xp,
                        int[] yp,
                        int np)
Draws a polygon, linking the first and last coordinates.

Specified by:
drawPolygon in class java.awt.Graphics
Parameters:
xp - Array of x coordinates
yp - Array of y coordinates
np - number of points in polygon

drawPolyline

public void drawPolyline(int[] xp,
                         int[] yp,
                         int np)
Draws a polyline. The first and last coordinates are not linked.

Specified by:
drawPolyline in class java.awt.Graphics
Parameters:
xp - Array of x coordinates
yp - Array of y coordinates
np - number of points in polyline

fillPolygon

public void fillPolygon(int[] xp,
                        int[] yp,
                        int np)
Fills a polygon.

Specified by:
fillPolygon in class java.awt.Graphics
Parameters:
xp - Array of x coordinates
yp - Array of y coordinates
np - number of points in polygon

drawImage

public boolean drawImage(java.awt.Image img,
                         int x,
                         int y,
                         java.awt.image.ImageObserver obs)
Draw's an image onto the page

Specified by:
drawImage in class java.awt.Graphics
Parameters:
img - The java.awt.Image
x - coordinate on page
y - coordinate on page
obs - ImageObserver
Returns:
true if drawn

drawImage

public boolean drawImage(java.awt.Image img,
                         int x,
                         int y,
                         int w,
                         int h,
                         java.awt.image.ImageObserver obs)

Draws an image onto the page.

This method is implemented with ASCIIbase85 encoding and the zip stream deflater. It results in a stream that is anywhere from 3 to 10 times as big as the image. This obviusly needs some improvement, but it works well for small images

Specified by:
drawImage in class java.awt.Graphics
Parameters:
img - The java.awt.Image
x - coordinate on page
y - coordinate on page
w - Width on page
h - height on page
obs - ImageObserver
Returns:
true if drawn

drawImage

public boolean drawImage(java.awt.Image img,
                         int x,
                         int y,
                         java.awt.Color bgcolor,
                         java.awt.image.ImageObserver obs)

Draw's an image onto the page, with a backing colour.

Specified by:
drawImage in class java.awt.Graphics
Parameters:
img - The java.awt.Image
x - coordinate on page
y - coordinate on page
bgcolor - Background colour
obs - ImageObserver
Returns:
true if drawn

drawImage

public boolean drawImage(java.awt.Image img,
                         int x,
                         int y,
                         int w,
                         int h,
                         java.awt.Color bgcolor,
                         java.awt.image.ImageObserver obs)

Draw's an image onto the page, with a backing colour.

Specified by:
drawImage in class java.awt.Graphics
Parameters:
img - The java.awt.Image
x - coordinate on page
y - coordinate on page
w - Width on page
h - height on page
bgcolor - Background colour
obs - ImageObserver
Returns:
true if drawn

drawImage

public boolean drawImage(java.awt.Image img,
                         int dx1,
                         int dy1,
                         int dx2,
                         int dy2,
                         int sx1,
                         int sy1,
                         int sx2,
                         int sy2,
                         java.awt.image.ImageObserver obs)
Draw's an image onto the page, with scaling

This is not yet supported.

Specified by:
drawImage in class java.awt.Graphics
Parameters:
img - The java.awt.Image
dx1 - coordinate on page
dy1 - coordinate on page
dx2 - coordinate on page
dy2 - coordinate on page
sx1 - coordinate on image
sy1 - coordinate on image
sx2 - coordinate on image
sy2 - coordinate on image
obs - ImageObserver
Returns:
true if drawn

drawImage

public boolean drawImage(java.awt.Image img,
                         int dx1,
                         int dy1,
                         int dx2,
                         int dy2,
                         int sx1,
                         int sy1,
                         int sx2,
                         int sy2,
                         java.awt.Color bgcolor,
                         java.awt.image.ImageObserver obs)
Draw's an image onto the page, with scaling

This is not yet supported.

Specified by:
drawImage in class java.awt.Graphics
Parameters:
img - The java.awt.Image
dx1 - coordinate on page
dy1 - coordinate on page
dx2 - coordinate on page
dy2 - coordinate on page
sx1 - coordinate on image
sy1 - coordinate on image
sx2 - coordinate on image
sy2 - coordinate on image
bgcolor - Background colour
obs - ImageObserver
Returns:
true if drawn

clipRect

public void clipRect(int x,
                     int y,
                     int w,
                     int h)
Clips to a set of coordinates

Specified by:
clipRect in class java.awt.Graphics
Parameters:
x - coord
y - coord
w - width
h - height

setClip

public void setClip(int x,
                    int y,
                    int w,
                    int h)
Clips to a set of coordinates

Specified by:
setClip in class java.awt.Graphics
Parameters:
x - coord
y - coord
w - width
h - height

setClip

public void setClip(java.awt.Shape s)
As my JDK docs say, this may break with Java 2D.

Sets the clipping region to that of a Shape.

Specified by:
setClip in class java.awt.Graphics
Parameters:
s - Shape to clip to.

clipPolygon

public void clipPolygon(java.awt.Polygon p)
This extra method allows PDF users to clip to a Polygon.

In theory you could use setClip(), except that java.awt.Graphics only supports Rectangle with that method, so we will have an extra method.

Parameters:
p - Polygon to clip to

getClipBounds

public java.awt.Rectangle getClipBounds()
Returns the Rectangle that fits the current clipping region

Specified by:
getClipBounds in class java.awt.Graphics
Returns:
the Rectangle that fits the current clipping region

getColor

public java.awt.Color getColor()
Returns the current pen Colour

Specified by:
getColor in class java.awt.Graphics
Returns:
the current pen Colour

setColor

public void setColor(java.awt.Color c)
Sets the colour for drawing

Specified by:
setColor in class java.awt.Graphics
Parameters:
c - Color to use

setPaintMode

public void setPaintMode()
Not implemented, as this is not supported in the PDF specification.

Specified by:
setPaintMode in class java.awt.Graphics

setXORMode

public void setXORMode(java.awt.Color c1)
Not implemented, as this is not supported in the PDF specification.

Specified by:
setXORMode in class java.awt.Graphics
Parameters:
c1 - Color to xor with

getFontMetrics

public java.awt.FontMetrics getFontMetrics(java.awt.Font font)
Returns the FontMetrics for a font.

This doesn't work correctly. Perhaps having some way of mapping the base 14 fonts to our own FontMetrics implementation?

Specified by:
getFontMetrics in class java.awt.Graphics
Parameters:
font - The java.awt.Font to return the metrics for
Returns:
FontMetrics for a font

getFont

public java.awt.Font getFont()
Return's the current font.

Specified by:
getFont in class java.awt.Graphics
Returns:
the current font.

setFont

public void setFont(java.awt.Font f)
This sets the font.

Specified by:
setFont in class java.awt.Graphics
Parameters:
f - java.awt.Font to set to.

drawString

public void drawString(java.lang.String s,
                       int x,
                       int y)
This draws a string.

Specified by:
drawString in class java.awt.Graphics
Parameters:
s - String to draw
x - coord
y - coord

drawBytes

public void drawBytes(byte[] data,
                      int offset,
                      int length,
                      int x,
                      int y)

Not implemented

Overrides:
drawBytes in class java.awt.Graphics
Parameters:
data - a byte[] value
offset - an int value
length - an int value
x - an int value
y - an int value

copyArea

public void copyArea(int x,
                     int y,
                     int w,
                     int h,
                     int dx,
                     int dy)
This is unsupported - how do you do this with Vector graphics?

Specified by:
copyArea in class java.awt.Graphics
Parameters:
x - coord
y - coord
w - width
h - height
dx - coord
dy - coord

drawLine

public void drawLine(int x1,
                     int y1,
                     int x2,
                     int y2)
Draws a line between two coordinates. If the first coordinate is the same as the last one drawn (ie a previous drawLine, moveto, etc) it is ignored.

Specified by:
drawLine in class java.awt.Graphics
Parameters:
x1 - coord
y1 - coord
x2 - coord
y2 - coord

translate

public void translate(int x,
                      int y)
Translate the origin.

Specified by:
translate in class java.awt.Graphics
Parameters:
x - coord offset
y - coord offset

drawArc

public void drawArc(int x,
                    int y,
                    int w,
                    int h,
                    int sa,
                    int aa)
Draws an arc

Specified by:
drawArc in class java.awt.Graphics
Parameters:
x - coord
y - coord
w - width
h - height
sa - Start angle
aa - End angle

fillArc

public void fillArc(int x,
                    int y,
                    int w,
                    int h,
                    int sa,
                    int aa)
Fills an arc, joining the start and end coordinates

Specified by:
fillArc in class java.awt.Graphics
Parameters:
x - coord
y - coord
w - width
h - height
sa - Start angle
aa - End angle

moveto

public void moveto(int x,
                   int y)
This moves the current drawing point.

Parameters:
x - coord
y - coord

moveto

public void moveto(double x,
                   double y)
This moves the current drawing point.

Parameters:
x - coord
y - coord

lineto

public void lineto(int x,
                   int y)
This adds a line segment to the current path

Parameters:
x - coord
y - coord

lineto

public void lineto(double x,
                   double y)
This adds a line segment to the current path

Parameters:
x - coord
y - coord

setLineWidth

public void setLineWidth(double w)
This extension allows the width of the drawn line to be set

Parameters:
w - Line width in mm

setDefaultLineWidth

public void setDefaultLineWidth()
This extension sets the line width to the default of 1mm which is what Java uses when drawing to a PrintJob.


polygon

public void polygon(int[] xp,
                    int[] yp,
                    int np)
This is used to add a polygon to the current path. Used by drawPolygon(), drawPolyline() and fillPolygon() etal

Parameters:
xp - Array of x coordinates
yp - Array of y coordinates
np - number of points in polygon
See Also:
drawPolygon(int[], int[], int), drawPolyline(int[], int[], int), fillPolygon(int[], int[], int)

curveto

public void curveto(int x1,
                    int y1,
                    int x2,
                    int y2,
                    int x3,
                    int y3)
This extension appends a Bezier curve to the path. The curve extends from the current point to (x3,y3) using (x1,y1) and (x2,y2) as the Bezier control points.

The new current point is (x3,y3)

Parameters:
x1 - First control point
y1 - First control point
x2 - Second control point
y2 - Second control point
x3 - Destination point
y3 - Destination point

curveto

public void curveto(double x1,
                    double y1,
                    double x2,
                    double y2,
                    double x3,
                    double y3)
This extension appends a Bezier curve to the path. The curve extends from the current point to (x3,y3) using (x1,y1) and (x2,y2) as the Bezier control points.

The new current point is (x3,y3)

Parameters:
x1 - First control point
y1 - First control point
x2 - Second control point
y2 - Second control point
x3 - Destination point
y3 - Destination point

curveto

public void curveto(int x1,
                    int y1,
                    int x2,
                    int y2)
This extension appends a Bezier curve to the path. The curve extends from the current point to (x2,y2) using the current point and (x1,y1) as the Bezier control points.

The new current point is (x2,y2)

Parameters:
x1 - Second control point
y1 - Second control point
x2 - Destination point
y2 - Destination point

curveto

public void curveto(double x1,
                    double y1,
                    double x2,
                    double y2)
This extension appends a Bezier curve to the path. The curve extends from the current point to (x2,y2) using the current point and (x1,y1) as the Bezier control points.

The new current point is (x2,y2)

Parameters:
x1 - Second control point
y1 - Second control point
x2 - Destination point
y2 - Destination point

curveto2

public void curveto2(int x1,
                     int y1,
                     int x2,
                     int y2)
This extension appends a Bezier curve to the path. The curve extends from the current point to (x2,y2) using (x1,y1) and the end point as the Bezier control points.

The new current point is (x2,y2)

Parameters:
x1 - Second control point
y1 - Second control point
x2 - Destination point
y2 - Destination point

curveto2

public void curveto2(double x1,
                     double y1,
                     double x2,
                     double y2)
This extension appends a Bezier curve to the path. The curve extends from the current point to (x2,y2) using (x1,y1) and the end point as the Bezier control points.

The new current point is (x2,y2)

Parameters:
x1 - Second control point
y1 - Second control point
x2 - Destination point
y2 - Destination point

arc

public void arc(double axc,
                double ayc,
                double width,
                double height,
                double ang1,
                double ang2,
                boolean clockwise)
This produces an arc by breaking it down into one or more Bezier curves. It is used internally to implement the drawArc and fillArc methods.

Parameters:
axc - X coordinate of arc centre
ayc - Y coordinate of arc centre
width - of bounding rectangle
height - of bounding rectangle
ang1 - Start angle
ang2 - End angle
clockwise - true to draw clockwise, false anti-clockwise

setOrientation

public void setOrientation()
This sets the media Orientation (0=Portrait, 90=Landscape, 180=Inverse, 270=Seascape).

Normally, this is called when the Graphics instance is created, but if the media is changed, then this must be called, especially when using the PDFJob class to create the file.


getClip

public java.awt.Shape getClip()
Returns the Shape of the clipping region As my JDK docs say, this may break with Java 2D.

Specified by:
getClip in class java.awt.Graphics
Returns:
Shape of the clipping region

drawString

public void drawString(java.text.AttributedCharacterIterator aci,
                       int x,
                       int y)
Draws a string using a AttributedCharacterIterator.

This is not supported yet, as I have no idea what an AttributedCharacterIterator is.

This method is new to the Java2 API.

Specified by:
drawString in class java.awt.Graphics