com.sun.pdfview
public class PDFRenderer extends BaseWatchable implements Runnable
Field Summary | |
---|---|
static int | NOCAP |
static float[] | NODASH |
static int | NOJOIN |
static float | NOLIMIT |
static float | NOPHASE |
static float | NOWIDTH |
static long | UPDATE_DURATION how long (in milliseconds) to wait between image updates |
Constructor Summary | |
---|---|
PDFRenderer(PDFPage page, ImageInfo imageinfo, BufferedImage bi)
create a new PDFGraphics state | |
PDFRenderer(PDFPage page, Graphics2D g, Rectangle imgbounds, Rectangle2D clip, Color bgColor)
create a new PDFGraphics state, given a Graphics2D. |
Method Summary | |
---|---|
void | addObserver(ImageObserver observer)
Add an image observer |
void | clip(GeneralPath s)
add the path to the current clip. |
void | draw(GeneralPath p, BasicStroke bs)
draw an outline. |
Rectangle2D | drawImage(PDFImage image)
draw an image. |
Rectangle2D | fill(GeneralPath s)
fill an outline using the current fill paint |
AffineTransform | getInitialTransform()
get the initial transform from page space to Java space |
GeneralPath | getLastShape()
Get the last shape drawn |
BasicStroke | getStroke()
get the current stroke as a BasicStroke |
AffineTransform | getTransform()
get the current affinetransform |
int | iterate()
Draws the next command in the PDFPage to the buffered image.
|
void | pop()
restore the state of this object to what it was when the previous
push() was called. |
void | push()
push the current graphics state onto the stack. |
void | removeObserver(ImageObserver observer)
Remove an image observer |
void | setFillAlpha(float alpha)
set the stroke alpha |
void | setFillPaint(PDFPaint paint)
set the fill color |
void | setLastShape(GeneralPath shape)
Set the last shape drawn |
void | setStroke(BasicStroke bs)
set the current stroke as a BasicStroke |
void | setStrokeAlpha(float alpha)
set the stroke alpha |
void | setStrokePaint(PDFPaint paint)
set the stroke color |
void | setStrokeParts(float w, int cap, int join, float limit, float[] ary, float phase)
Set some or all aspects of the current stroke. |
void | setTransform(AffineTransform at)
replace the current transform with the given one. |
Rectangle2D | stroke(GeneralPath s)
draw an outline using the current stroke and draw paint |
void | transform(AffineTransform at)
concatenate the given transform with the current transform |
Parameters: page the current page imageinfo the paramters of the image to render
Parameters: page the current page g the Graphics2D object to use for drawing imgbounds the bounds of the image into which to fit the page clip the portion of the page to draw, in page space, or null if the whole page should be drawn bgColor the color to draw the background of the image, or null for no color (0 alpha value)
Parameters: p the path to draw bs the stroke with which to draw the path
Parameters: image the image to draw
Parameters: s the path to fill
Returns:
Parameters: w the width of the stroke, or NOWIDTH to leave it unchanged cap the end cap style, or NOCAP to leave it unchanged join the join style, or NOJOIN to leave it unchanged limit the miter limit, or NOLIMIT to leave it unchanged phase the phase of the dash array, or NOPHASE to leave it unchanged ary the dash array, or null to leave it unchanged. phase and ary must both be valid, or phase must be NOPHASE while ary is null.
Parameters: s the path to stroke
Returns: a Rectangle2D to which the current region being drawn will be added. May also be null, in which case no dirty region will be recorded.