xmlgraphics-commons 1.0

org.apache.xmlgraphics.java2d.ps
Class PSDocumentGraphics2D

java.lang.Object
  extended byjava.awt.Graphics
      extended byjava.awt.Graphics2D
          extended byorg.apache.xmlgraphics.java2d.AbstractGraphics2D
              extended byorg.apache.xmlgraphics.java2d.ps.PSGraphics2D
                  extended byorg.apache.xmlgraphics.java2d.ps.AbstractPSDocumentGraphics2D
                      extended byorg.apache.xmlgraphics.java2d.ps.PSDocumentGraphics2D
All Implemented Interfaces:
java.lang.Cloneable

public class PSDocumentGraphics2D
extends AbstractPSDocumentGraphics2D

This class is a wrapper for the PSGraphics2D that is used to create a full document around the PostScript rendering from PSGraphics2D.

Version:
$Id: PSDocumentGraphics2D.java 391268 2006-04-04 10:02:53Z jeremias $
Author:
Keiron Liddle
See Also:
PSGraphics2D

Field Summary
 
Fields inherited from class org.apache.xmlgraphics.java2d.ps.AbstractPSDocumentGraphics2D
height, initialClip, initialTransform, pagecount, pagePending, viewportHeight, viewportWidth, width, ZERO
 
Fields inherited from class org.apache.xmlgraphics.java2d.ps.PSGraphics2D
currentColour, customTextHandler, fallbackTextHandler, gen
 
Fields inherited from class org.apache.xmlgraphics.java2d.AbstractGraphics2D
gc, textAsShapes
 
Constructor Summary
PSDocumentGraphics2D(boolean textAsShapes)
          Create a new AbstractPSDocumentGraphics2D.
PSDocumentGraphics2D(boolean textAsShapes, java.io.OutputStream stream, int width, int height)
          Create a new AbstractPSDocumentGraphics2D.
PSDocumentGraphics2D(PSDocumentGraphics2D g)
          This constructor supports the create method
 
Method Summary
 java.awt.Graphics create()
          Creates a new Graphics object that is a copy of this Graphics object.
 void nextPage()
           
protected  void writeFileHeader()
           
protected  void writePageHeader()
          Writes the page header for a page.
protected  void writePageTrailer()
          Writes the page trailer for a page.
 
Methods inherited from class org.apache.xmlgraphics.java2d.ps.AbstractPSDocumentGraphics2D
closePage, finish, getPageCount, preparePainting, setBackgroundColor, setupDocument, setViewportDimension, startPage
 
Methods inherited from class org.apache.xmlgraphics.java2d.ps.PSGraphics2D
applyPaint, applyStroke, buildBufferedImage, copyArea, dispose, doDrawing, draw, drawImage, drawImage, drawRenderableImage, drawRenderedImage, drawString, drawString, establishColor, fill, getCustomTextHandler, getDeviceConfiguration, getFallbackTextHandler, getFontMetrics, getPSGenerator, handleIOException, processPathIterator, setCustomTextHandler, setGraphicContext, setPSGenerator, setXORMode, writeClip
 
Methods inherited from class org.apache.xmlgraphics.java2d.AbstractGraphics2D
addRenderingHints, clearRect, clip, clipRect, drawArc, drawGlyphVector, drawImage, drawImage, drawImage, drawImage, drawImage, drawImage, drawLine, drawOval, drawPolygon, drawPolyline, drawRect, drawRoundRect, drawString, drawString, fillArc, fillOval, fillPolygon, fillRect, fillRoundRect, getBackground, getClip, getClipBounds, getColor, getComposite, getFont, getFontRenderContext, getGraphicContext, getPaint, getRenderingHint, getRenderingHints, getStroke, getTransform, hit, rotate, rotate, scale, setBackground, setClip, setClip, setColor, setComposite, setFont, setPaint, setPaintMode, setRenderingHint, setRenderingHints, setStroke, setTransform, shear, transform, translate, translate
 
Methods inherited from class java.awt.Graphics2D
draw3DRect, fill3DRect
 
Methods inherited from class java.awt.Graphics
create, drawBytes, 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
 

Constructor Detail

PSDocumentGraphics2D

public PSDocumentGraphics2D(boolean textAsShapes)
Create a new AbstractPSDocumentGraphics2D. This is used to create a new PostScript document, the height, width and output stream can be setup later. For use by the transcoder which needs font information for the bridge before the document size is known. The resulting document is written to the stream after rendering.

Parameters:
textAsShapes - set this to true so that text will be rendered using curves and not the font.

PSDocumentGraphics2D

public PSDocumentGraphics2D(boolean textAsShapes,
                            java.io.OutputStream stream,
                            int width,
                            int height)
                     throws java.io.IOException
Create a new AbstractPSDocumentGraphics2D. This is used to create a new PostScript document of the given height and width. The resulting document is written to the stream after rendering.

Parameters:
textAsShapes - set this to true so that text will be rendered using curves and not the font.
stream - the stream that the final document should be written to.
width - the width of the document
height - the height of the document
Throws:
java.io.IOException - an io exception if there is a problem writing to the output stream

PSDocumentGraphics2D

public PSDocumentGraphics2D(PSDocumentGraphics2D g)
This constructor supports the create method

Parameters:
g - the PostScript document graphics to make a copy of
Method Detail

nextPage

public void nextPage()
              throws java.io.IOException
Overrides:
nextPage in class AbstractPSDocumentGraphics2D
Throws:
java.io.IOException

writeFileHeader

protected void writeFileHeader()
                        throws java.io.IOException
Specified by:
writeFileHeader in class AbstractPSDocumentGraphics2D
Throws:
java.io.IOException

writePageHeader

protected void writePageHeader()
                        throws java.io.IOException
Description copied from class: AbstractPSDocumentGraphics2D
Writes the page header for a page.

Specified by:
writePageHeader in class AbstractPSDocumentGraphics2D
Throws:
java.io.IOException - In case an I/O error occurs

writePageTrailer

protected void writePageTrailer()
                         throws java.io.IOException
Description copied from class: AbstractPSDocumentGraphics2D
Writes the page trailer for a page.

Specified by:
writePageTrailer in class AbstractPSDocumentGraphics2D
Throws:
java.io.IOException - In case an I/O error occurs

create

public java.awt.Graphics create()
Creates a new Graphics object that is a copy of this Graphics object.

Overrides:
create in class PSGraphics2D
Returns:
a new graphics context that is a copy of this graphics context.

xmlgraphics-commons 1.0

Copyright 1999-2006 The Apache Software Foundation. All Rights Reserved.