Public Member Functions | |
PrintWriter | getWriter () |
PDFPage | getPage () |
Graphics | create () |
void | dispose () |
void | clearRect (int x, int y, int w, int h) |
void | drawRect (int x, int y, int w, int h) |
void | draw3DRect (int x, int y, int width, int height, boolean raised) |
void | fill3DRect (int x, int y, int width, int height, boolean raised) |
void | fillRect (int x, int y, int w, int h) |
void | fillRoundRect (int x, int y, int w, int h, int aw, int ah) |
void | drawRoundRect (int x, int y, int w, int h, int aw, int ah) |
void | drawOval (int x, int y, int w, int h) |
void | fillOval (int x, int y, int w, int h) |
void | drawPolygon (int[] xp, int[] yp, int np) |
void | drawPolyline (int[] xp, int[] yp, int np) |
void | fillPolygon (int[] xp, int[] yp, int np) |
boolean | drawImage (Image img, int x, int y, ImageObserver obs) |
boolean | drawImage (Image img, int x, int y, int w, int h, ImageObserver obs) |
boolean | drawImage (Image img, int x, int y, Color bgcolor, ImageObserver obs) |
boolean | drawImage (Image img, int x, int y, int w, int h, Color bgcolor, ImageObserver obs) |
boolean | drawImage (Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, ImageObserver obs) |
boolean | drawImage (Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, Color bgcolor, ImageObserver obs) |
void | clipRect (int x, int y, int w, int h) |
void | setClip (int x, int y, int w, int h) |
void | setClip (Shape s) |
void | clipPolygon (Polygon p) |
Rectangle | getClipBounds () |
Color | getColor () |
void | setColor (Color c) |
void | setPaintMode () |
void | setXORMode (Color c1) |
FontMetrics | getFontMetrics (Font font) |
Font | getFont () |
void | setFont (Font f) |
void | drawString (String s, int x, int y) |
void | drawBytes (byte[] data, int offset, int length, int x, int y) |
void | copyArea (int x, int y, int w, int h, int dx, int dy) |
void | drawLine (int x1, int y1, int x2, int y2) |
void | translate (int x, int y) |
void | drawArc (int x, int y, int w, int h, int sa, int aa) |
void | fillArc (int x, int y, int w, int h, int sa, int aa) |
void | moveto (int x, int y) |
void | moveto (double x, double y) |
void | lineto (int x, int y) |
void | lineto (double x, double y) |
void | setLineWidth (double w) |
void | setDefaultLineWidth () |
void | polygon (int[] xp, int[] yp, int np) |
void | curveto (int x1, int y1, int x2, int y2, int x3, int y3) |
void | curveto (double x1, double y1, double x2, double y2, double x3, double y3) |
void | curveto (int x1, int y1, int x2, int y2) |
void | curveto (double x1, double y1, double x2, double y2) |
void | curveto2 (int x1, int y1, int x2, int y2) |
void | curveto2 (double x1, double y1, double x2, double y2) |
void | arc (double axc, double ayc, double width, double height, double ang1, double ang2, boolean clockwise) |
void | setOrientation () |
Shape | getClip () |
void | drawString (java.text.AttributedCharacterIterator aci, int x, int y) |
Protected Member Functions | |
PDFGraphics | createGraphic (PDFPage page, PrintWriter pw) |
void | init (PDFPage page) |
void | init (PDFPage page, PrintWriter pw) |
Protected Attributes | |
Rectangle | media |
int | trax |
int | tray |
Rectangle | clipRectangle |
Package Functions | |
void | closeBlock () |
void | closeBlock (String code) |
void | newPath () |
void | newTextBlock (int x, int y) |
Java standard way of rendering into a PDF Document's Page.
Eric Z. Beard, ericzbeard@hotmail.com
|
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.
|
|
This simply draws a White Rectangle to clear the area
|
|
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.
|
|
Clips to a set of coordinates
|
|
This is used by code that use the path in any way other than Stroke (like Fill, close path & Stroke etc). Usually this is used internally.
|
|
All functions should call this to close any existing optimised blocks. |
|
This is unsupported - how do you do this with Vector graphics?
|
|
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.
Reimplemented in gnu::jpdf::PDFJob::graphic. |
|
This method creates a new instance of the class based on the page and a print writer.
|
|
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)
|
|
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)
|
|
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)
|
|
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)
|
|
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)
|
|
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)
|
|
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. |
|
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.
|
|
Draws an arc
|
|
Not implemented
|
|
Draw's an image onto the page, with scaling This is not yet supported.
|
|
Draw's an image onto the page, with scaling This is not yet supported.
|
|
Draw's an image onto the page, with a backing colour.
|
|
Draw's an image onto the page, with a backing colour.
|
|
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
|
|
Draw's an image onto the page
|
|
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.
|
|
Draws an oval
|
|
Draws a polygon, linking the first and last coordinates.
|
|
Draws a polyline. The first and last coordinates are not linked.
|
|
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.
|
|
This is not yet implemented
|
|
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. |
|
This draws a string.
|
|
Not implemented
|
|
Fills an arc, joining the start and end coordinates
|
|
Draws a filled oval
|
|
Fills a polygon.
|
|
Fills a rectangle with the current colour
|
|
This is not yet implemented
|
|
Returns the Shape of the clipping region As my JDK docs say, this may break with Java 2D.
|
|
Returns the Rectangle that fits the current clipping region
|
|
Returns the current pen Colour
|
|
Return's the current 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?
|
|
Returns the associated PDFPage for this graphic
|
|
Returns the PrintWriter handling the underlying stream
|
|
This method is used internally by create() and by the PDFJob class
|
|
This is called by PDFPage when creating a Graphcis instance.
|
|
This adds a line segment to the current path
|
|
This adds a line segment to the current path
|
|
This moves the current drawing point.
|
|
This moves the current drawing point.
|
|
Functions that draw lines should start by calling this. It starts a new path unless inStroke is set, in that case it uses the existing path |
|
Functions that draw text should start by calling this. It starts a text block (accounting for media orientation) unless we are already in a Text block. It also handles if the font has been changed since the current text block was started, so your function will be current.
|
|
This is used to add a polygon to the current path. Used by drawPolygon(), drawPolyline() and fillPolygon() etal
|
|
As my JDK docs say, this may break with Java 2D. Sets the clipping region to that of a Shape.
|
|
Clips to a set of coordinates
|
|
Sets the colour for drawing
|
|
This extension sets the line width to the default of 1mm which is what Java uses when drawing to a PrintJob. |
|
This sets the font.
|
|
This extension allows the width of the drawn line to be set
|
|
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. |
|
Not implemented, as this is not supported in the PDF specification. |
|
Not implemented, as this is not supported in the PDF specification.
|
|
Translate the origin.
|
|
This holds the current clipRectangle |
|
This is the media we are working with |
|
This is used to translate coordinates |
|
This is used to translate coordinates |