public abstract class AbstractPSDocumentGraphics2D extends PSGraphics2D
Originally authored by Keiron Liddle.
Modifier and Type | Field and Description |
---|---|
protected int |
height |
protected java.awt.Shape |
initialClip |
protected java.awt.geom.AffineTransform |
initialTransform |
protected int |
pagecount |
protected boolean |
pagePending |
protected float |
viewportHeight |
protected float |
viewportWidth |
protected int |
width |
protected static java.lang.Integer |
ZERO |
clippingDisabled, currentColour, customTextHandler, fallbackTextHandler, gen, rootG2D
gc, inPossibleRecursion, textAsShapes
Constructor and Description |
---|
AbstractPSDocumentGraphics2D(AbstractPSDocumentGraphics2D g)
This constructor supports the create method
|
AbstractPSDocumentGraphics2D(boolean textAsShapes,
java.io.OutputStream stream,
int width,
int height)
Create a new AbstractPSDocumentGraphics2D.
|
Modifier and Type | Method and Description |
---|---|
protected void |
closePage()
Closes the current page.
|
void |
finish()
The rendering process has finished.
|
int |
getPageCount()
Returns the number of pages generated so far.
|
void |
nextPage()
Closes the current page and prepares to start a new one.
|
void |
preparePainting()
This method is used by AbstractPSDocumentGraphics2D to prepare a new page if
necessary.
|
void |
setBackgroundColor(java.awt.Color col)
Set the background of the PostScript document.
|
void |
setupDocument(java.io.OutputStream stream,
int width,
int height)
Setup the document.
|
void |
setViewportDimension(float w,
float h)
Set the dimensions of the document that will be drawn.
|
protected void |
startPage()
Starts a new page.
|
protected abstract void |
writeFileHeader()
Writes the file header.
|
protected abstract void |
writePageHeader()
Writes the page header for a page.
|
protected abstract void |
writePageTrailer()
Writes the page trailer for a page.
|
protected void |
writeProcSets()
Writes the ProcSets ending up in the prolog to the PostScript file.
|
applyPaint, applyStroke, applyStroke, buildBufferedImage, copyArea, create, disableClipping, dispose, doDrawing, draw, drawImage, drawImage, drawRenderableImage, drawRenderedImage, drawString, establishColor, fill, getCustomTextHandler, getDeviceConfiguration, getFallbackTextHandler, getFontMetrics, getPSGenerator, handleIOException, processPathIterator, processShape, setCustomTextHandler, setGraphicContext, setPSGenerator, setXORMode, shouldBeClipped, writeClip
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, translate
protected static final java.lang.Integer ZERO
protected int width
protected int height
protected float viewportWidth
protected float viewportHeight
protected int pagecount
protected boolean pagePending
protected java.awt.Shape initialClip
protected java.awt.geom.AffineTransform initialTransform
public AbstractPSDocumentGraphics2D(boolean textAsShapes, java.io.OutputStream stream, int width, int height) throws java.io.IOException
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 documentjava.io.IOException
- an io exception if there is a problem
writing to the output streampublic AbstractPSDocumentGraphics2D(AbstractPSDocumentGraphics2D g)
g
- the PostScript document graphics to make a copy ofpublic void setupDocument(java.io.OutputStream stream, int width, int height) throws java.io.IOException
stream
- the output stream to write the documentwidth
- the width of the pageheight
- the height of the pagejava.io.IOException
- an io exception if there is a problem
writing to the output streamprotected abstract void writeFileHeader() throws java.io.IOException
java.io.IOException
- if an I/O error occurspublic void setViewportDimension(float w, float h) throws java.io.IOException
w
- the width of the pageh
- the height of the pagejava.io.IOException
- in case of an I/O problempublic void setBackgroundColor(java.awt.Color col)
col
- the background colour to fillpublic int getPageCount()
public void nextPage() throws java.io.IOException
java.io.IOException
- if an I/O error occursprotected void closePage() throws java.io.IOException
java.io.IOException
- if an I/O error occursprotected abstract void writePageHeader() throws java.io.IOException
java.io.IOException
- In case an I/O error occursprotected abstract void writePageTrailer() throws java.io.IOException
java.io.IOException
- In case an I/O error occursprotected void writeProcSets() throws java.io.IOException
java.io.IOException
- In case an I/O error occurspublic void preparePainting()
preparePainting
in class PSGraphics2D
protected void startPage() throws java.io.IOException
java.io.IOException
- if an I/O error occurspublic void finish() throws java.io.IOException
java.io.IOException
- an io exception if there is a problem
writing to the output streamCopyright 1999-2012 The Apache Software Foundation. All Rights Reserved.