Package org.apache.xmlgraphics.java2d.ps
Class PSDocumentGraphics2D
java.lang.Object
java.awt.Graphics
java.awt.Graphics2D
org.apache.xmlgraphics.java2d.AbstractGraphics2D
org.apache.xmlgraphics.java2d.ps.PSGraphics2D
org.apache.xmlgraphics.java2d.ps.AbstractPSDocumentGraphics2D
org.apache.xmlgraphics.java2d.ps.PSDocumentGraphics2D
- All Implemented Interfaces:
Cloneable
This class is a wrapper for the PSGraphics2D that
is used to create a full document around the PostScript rendering from
PSGraphics2D.
- Version:
- $Id$
- See Also:
-
Field Summary
Fields inherited from class org.apache.xmlgraphics.java2d.ps.AbstractPSDocumentGraphics2D
height, initialClip, initialTransform, pagecount, pagePending, viewportHeight, viewportWidth, width, ZEROFields inherited from class org.apache.xmlgraphics.java2d.ps.PSGraphics2D
clippingDisabled, currentColour, customTextHandler, fallbackTextHandler, gen, pathHashCache, rootG2D, startCacheFields inherited from class org.apache.xmlgraphics.java2d.AbstractGraphics2D
gc, inPossibleRecursion, textAsShapes -
Constructor Summary
ConstructorsConstructorDescriptionPSDocumentGraphics2D(boolean textAsShapes) Create a new AbstractPSDocumentGraphics2D.PSDocumentGraphics2D(boolean textAsShapes, OutputStream stream, int width, int height) Create a new AbstractPSDocumentGraphics2D.This constructor supports the create method -
Method Summary
Modifier and TypeMethodDescriptionvoidnextPage()Closes the current page and prepares to start a new one.protected voidWrites the file header.protected voidWrites the page header for a page.protected voidWrites the page trailer for a page.Methods inherited from class org.apache.xmlgraphics.java2d.ps.AbstractPSDocumentGraphics2D
closePage, finish, getPageCount, preparePainting, setBackgroundColor, setupDocument, setViewportDimension, startPage, writeProcSetsMethods inherited from class org.apache.xmlgraphics.java2d.ps.PSGraphics2D
applyPaint, applyStroke, applyStroke, buildBufferedImage, copyArea, create, disableClipping, dispose, doDrawing, draw, drawImage, drawImage, drawImage, drawImage, drawRenderableImage, drawRenderedImage, drawString, establishColor, fill, getCustomTextHandler, getDeviceConfiguration, getFallbackTextHandler, getFontMetrics, getPSGenerator, handleIOException, processPathIterator, processPathIteratorCached, processPathIteratorToString, processShape, setCustomTextHandler, setGraphicContext, setPSGenerator, setXORMode, shouldBeClipped, writeClipMethods 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, 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, translateMethods inherited from class java.awt.Graphics2D
draw3DRect, fill3DRectMethods inherited from class java.awt.Graphics
create, drawBytes, drawChars, drawPolygon, fillPolygon, finalize, getClipBounds, getClipRect, getFontMetrics, hitClip, toString
-
Constructor Details
-
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, OutputStream stream, int width, int height) throws 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 documentheight- the height of the document- Throws:
IOException- an io exception if there is a problem writing to the output stream
-
PSDocumentGraphics2D
This constructor supports the create method- Parameters:
g- the PostScript document graphics to make a copy of
-
-
Method Details
-
nextPage
Closes the current page and prepares to start a new one.- Overrides:
nextPagein classAbstractPSDocumentGraphics2D- Throws:
IOException- if an I/O error occurs
-
writeFileHeader
Writes the file header.- Specified by:
writeFileHeaderin classAbstractPSDocumentGraphics2D- Throws:
IOException- if an I/O error occurs
-
writePageHeader
Writes the page header for a page.- Specified by:
writePageHeaderin classAbstractPSDocumentGraphics2D- Throws:
IOException- In case an I/O error occurs
-
writePageTrailer
Writes the page trailer for a page.- Specified by:
writePageTrailerin classAbstractPSDocumentGraphics2D- Throws:
IOException- In case an I/O error occurs
-