|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Graphics
java.awt.Graphics2D
org.apache.batik.ext.awt.g2d.AbstractGraphics2D
org.foray.graphic.batik.PDFGraphics2D
public class PDFGraphics2D
A Graphics2D
implementation used by Batik to render two-dimensional
objects (the SVG image) into a PDF document.
Field Summary | |
---|---|
static byte |
QTY_ELEMENTS_CUBIC
Constant indicating the number of elements in a cubic element, that is, 6. |
static byte |
QTY_ELEMENTS_LINEAR
Constant indicating the number of elements in a linear element, that is, 2. |
static byte |
QTY_ELEMENTS_QUAD
Constant indicating the number of elements in a quad element, that is, 4. |
Fields inherited from class org.apache.batik.ext.awt.g2d.AbstractGraphics2D |
---|
gc, textAsShapes |
Constructor Summary | |
---|---|
PDFGraphics2D(boolean textAsShapes,
org.w3c.dom.svg.SVGDocument svgDocument,
org.axsl.font.FontConsumer fontConsumer,
org.apache.commons.logging.Log logger,
org.axsl.graphic.output.GraphicOutputContext pdfContext,
OutputStream outputStream)
Create a new PDFGraphics2D with the given pdf document info. |
|
PDFGraphics2D(PDFGraphics2D g)
This constructor supports the create method. |
Method Summary | |
---|---|
void |
addLink(org.axsl.pdf.PdfPage pdfPage,
Shape bounds,
AffineTransform trans,
String dest,
boolean externalLink)
This is a pdf specific method used to add a link to the pdf document. |
protected void |
applyColor(Color color,
boolean fill)
Apply a color to the document. |
protected void |
applyPaint(Paint paint,
boolean fill)
Apply a paint to the document. |
protected void |
applyStroke(Stroke stroke)
Apply a stroke to the document. |
void |
copyArea(int x,
int y,
int width,
int height,
int dx,
int dy)
|
Graphics |
create()
|
void |
dispose()
|
protected void |
doDrawing(boolean fill,
boolean stroke,
boolean nonzero)
Add the commands to do the actual drawing. |
void |
draw(Shape s)
|
boolean |
drawImage(Image img,
int x,
int y,
ImageObserver observer)
|
boolean |
drawImage(Image img,
int x,
int y,
int width,
int height,
ImageObserver observer)
|
void |
drawRenderableImage(RenderableImage img,
AffineTransform xform)
|
void |
drawRenderedImage(RenderedImage img,
AffineTransform xform)
|
void |
drawString(AttributedCharacterIterator iterator,
float x,
float y)
|
void |
drawString(String s,
float x,
float y)
|
void |
fill(Shape s)
|
GraphicsConfiguration |
getDeviceConfiguration()
|
FontMetrics |
getFontMetrics(Font f)
|
boolean |
ioErrorFound()
Indicates whether any I/O errors were found while writing to the output stream. |
static String |
matrixToString(double[] theMatrix,
int numElements)
Converts a matrix of decimal values to its PDF representation. |
static String |
octalMatrixToString(double[] theMatrix)
Converts a matrix of octal values to its PDF representation. |
void |
setGraphicContext(org.apache.batik.ext.awt.g2d.GraphicContext c)
Sets the graphic context. |
void |
setOverrideFontState(org.axsl.font.output.FontPdf infont,
float size)
Sets the override font and size. |
void |
setXORMode(Color c1)
|
protected void |
writeClip(Shape s)
Clip the document to a specific shape. |
Methods inherited from class org.apache.batik.ext.awt.g2d.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 |
Field Detail |
---|
public static final byte QTY_ELEMENTS_CUBIC
public static final byte QTY_ELEMENTS_QUAD
public static final byte QTY_ELEMENTS_LINEAR
Constructor Detail |
---|
public PDFGraphics2D(boolean textAsShapes, org.w3c.dom.svg.SVGDocument svgDocument, org.axsl.font.FontConsumer fontConsumer, org.apache.commons.logging.Log logger, org.axsl.graphic.output.GraphicOutputContext pdfContext, OutputStream outputStream) throws org.axsl.graphic.GraphicException
textAsShapes
- Set this to true so that text will be rendered
using curves and not the font.svgDocument
- The SVG document to be drawn.fontConsumer
- The font consumer for this document.logger
- The logger.pdfContext
- The PDF context in which this content is being written.outputStream
- The output stream to which this processor writes its
PDF output.
org.axsl.graphic.GraphicException
- If there is no graphical environment available.public PDFGraphics2D(PDFGraphics2D g)
g
- The encapsulated image.Method Detail |
---|
public static String octalMatrixToString(double[] theMatrix)
theMatrix
- The matrix to be converted.
public static String matrixToString(double[] theMatrix, int numElements)
theMatrix
- The matrix to be converted.numElements
- The number of elements in the matrix to be included
in the output.
public void setGraphicContext(org.apache.batik.ext.awt.g2d.GraphicContext c)
c
- The new graphic context.public void setOverrideFontState(org.axsl.font.output.FontPdf infont, float size)
infont
- The new override font.size
- The new override font size.public Graphics create()
create
in class Graphics
public void addLink(org.axsl.pdf.PdfPage pdfPage, Shape bounds, AffineTransform trans, String dest, boolean externalLink)
pdfPage
- The page on which the link should be placed.bounds
- The location of the link.trans
- The affine transform.dest
- The name of the destination.externalLink
- Set to true if the link is to an external document.public boolean drawImage(Image img, int x, int y, ImageObserver observer)
drawImage
in class Graphics
public boolean drawImage(Image img, int x, int y, int width, int height, ImageObserver observer)
drawImage
in class Graphics
public void dispose()
dispose
in class Graphics
public void draw(Shape s)
draw
in class Graphics2D
protected void writeClip(Shape s)
s
- The shape to which the document should be clipped.protected void applyColor(Color color, boolean fill)
color
- The color to be applied.fill
- Set to true if the color is for fill, false if for stroke.protected void applyPaint(Paint paint, boolean fill)
paint
- The paint to be applied.fill
- Set to true if the paint is for fill, false if for stroke.protected void applyStroke(Stroke stroke)
stroke
- The stroke to be applied.public void drawRenderedImage(RenderedImage img, AffineTransform xform)
drawRenderedImage
in class Graphics2D
public void drawRenderableImage(RenderableImage img, AffineTransform xform)
drawRenderableImage
in class Graphics2D
public void drawString(String s, float x, float y)
drawString
in class Graphics2D
public void drawString(AttributedCharacterIterator iterator, float x, float y)
drawString
in class Graphics2D
public void fill(Shape s)
fill
in class Graphics2D
protected void doDrawing(boolean fill, boolean stroke, boolean nonzero)
fill
- Set to true if the item should be filled.stroke
- Set to true if the item should be stroked.nonzero
- Set to true to use the nonzero winding number rule.public GraphicsConfiguration getDeviceConfiguration()
getDeviceConfiguration
in class Graphics2D
public FontMetrics getFontMetrics(Font f)
getFontMetrics
in class Graphics
public void setXORMode(Color c1)
setXORMode
in class Graphics
public void copyArea(int x, int y, int width, int height, int dx, int dy)
copyArea
in class Graphics
public boolean ioErrorFound()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |