|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.fop.render.pdf.SVGRenderer
Renderer that renders SVG to PDF
Field Summary | |
protected java.lang.String |
currentFontName
the current (internal) font name |
protected int |
currentFontSize
the current font size in millipoints |
protected int |
currentXPosition
the current horizontal position in millipoints from left |
protected int |
currentYPosition
the current vertical position in millipoints from bottom |
protected FontState |
fontState
|
protected PDFDocument |
pdfDoc
the PDF Document being created |
Constructor Summary | |
SVGRenderer(FontState fs,
PDFDocument doc,
java.lang.String font,
int size,
int xpos,
int ypos)
create the SVG renderer |
Method Summary | |
protected void |
addCircle(float cx,
float cy,
float r,
org.apache.fop.render.pdf.SVGRenderer.DrawingInstruction di)
Add an SVG circle Uses bezier curves to approximate the shape of a circle. |
protected void |
addEllipse(float cx,
float cy,
float rx,
float ry,
org.apache.fop.render.pdf.SVGRenderer.DrawingInstruction di)
Add an SVG ellips Uses bezier curves to approximate the shape of an ellipse. |
protected void |
addLine(float x1,
float y1,
float x2,
float y2,
org.apache.fop.render.pdf.SVGRenderer.DrawingInstruction di)
add a line to the current stream |
protected void |
addPath(java.util.Vector points,
int posx,
int posy,
org.apache.fop.render.pdf.SVGRenderer.DrawingInstruction di)
Adds an SVG path to the current streem. |
protected void |
addPolyline(java.util.Vector points,
org.apache.fop.render.pdf.SVGRenderer.DrawingInstruction di,
boolean close)
Adds an SVG polyline or polygon. |
protected void |
addRect(float x,
float y,
float w,
float h,
float rx,
float ry,
org.apache.fop.render.pdf.SVGRenderer.DrawingInstruction di)
add an SVG rectangle to the current stream. |
protected float |
addSVGStr(FontState fs,
float currentX,
java.lang.String str,
boolean spacing)
Adds an svg string to the output. |
protected org.apache.fop.render.pdf.SVGRenderer.DrawingInstruction |
applyStyle(org.w3c.dom.svg.SVGElement area,
org.w3c.dom.svg.SVGStylable style)
|
protected void |
applyTransform(org.w3c.dom.svg.SVGAnimatedTransformList trans)
|
protected float[] |
calculateLastControl(float x1,
float y1,
float x2,
float y2,
float relx,
float rely)
Calculate the last control point for a bezier curve. |
protected void |
doDrawing(org.apache.fop.render.pdf.SVGRenderer.DrawingInstruction di)
Writes the drawing instruction out to the current stream depending on what type of drawing is required. |
java.lang.String |
getString()
|
protected void |
handleGradient(java.lang.String sp,
org.apache.fop.render.pdf.SVGRenderer.DrawingInstruction di,
boolean fill,
org.w3c.dom.svg.SVGElement area)
Handles the construction of an SVG gradient. |
protected void |
handleLinearGradient(org.w3c.dom.svg.SVGLinearGradientElement linear,
org.apache.fop.render.pdf.SVGRenderer.DrawingInstruction di,
boolean fill,
org.w3c.dom.svg.SVGElement area)
|
protected void |
handlePattern(org.w3c.dom.svg.SVGPatternElement pattern,
org.apache.fop.render.pdf.SVGRenderer.DrawingInstruction di,
boolean fill,
org.w3c.dom.svg.SVGElement area)
|
protected void |
handleRadialGradient(org.w3c.dom.svg.SVGRadialGradientElement radial,
org.apache.fop.render.pdf.SVGRenderer.DrawingInstruction di,
boolean fill,
org.w3c.dom.svg.SVGElement area)
|
protected void |
handleSwitchElement(int posx,
int posy,
org.w3c.dom.svg.SVGSwitchElement ael)
Handles the SVG switch element. |
protected org.w3c.dom.svg.SVGElement |
locateDef(java.lang.String ref,
org.w3c.dom.svg.SVGElement currentElement)
Locates a defined element in an svg document. |
void |
renderElement(org.w3c.dom.svg.SVGElement area,
int posx,
int posy)
Main rendering selection. |
void |
renderGArea(org.w3c.dom.svg.SVGGElement area,
int posx,
int posy)
|
void |
renderImage(java.lang.String href,
float x,
float y,
float width,
float height)
Renders an svg image to the current stream. |
protected void |
renderSVG(org.w3c.dom.svg.SVGSVGElement svg,
int x,
int y)
Renders an SVG element in an SVG document. |
protected void |
renderSymbol(org.w3c.dom.svg.SVGSymbolElement symbol,
int x,
int y)
A symbol has a viewbox and preserve aspect ratio. |
void |
renderText(SVGTextElementImpl tg,
float x,
float y,
org.apache.fop.render.pdf.SVGRenderer.DrawingInstruction di)
Todo: underline, linethrough, textpath |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
protected PDFDocument pdfDoc
protected FontState fontState
protected java.lang.String currentFontName
protected int currentFontSize
protected int currentYPosition
protected int currentXPosition
Constructor Detail |
public SVGRenderer(FontState fs, PDFDocument doc, java.lang.String font, int size, int xpos, int ypos)
Method Detail |
public java.lang.String getString()
protected void renderSVG(org.w3c.dom.svg.SVGSVGElement svg, int x, int y)
public void renderGArea(org.w3c.dom.svg.SVGGElement area, int posx, int posy)
protected void handleSwitchElement(int posx, int posy, org.w3c.dom.svg.SVGSwitchElement ael)
protected void addLine(float x1, float y1, float x2, float y2, org.apache.fop.render.pdf.SVGRenderer.DrawingInstruction di)
x1
- the start x location in millipointsy1
- the start y location in millipointsx2
- the end x location in millipointsy2
- the end y location in millipointsth
- the thickness in millipointsr
- the red componentg
- the green componentb
- the blue componentprotected void addCircle(float cx, float cy, float r, org.apache.fop.render.pdf.SVGRenderer.DrawingInstruction di)
protected void addEllipse(float cx, float cy, float rx, float ry, org.apache.fop.render.pdf.SVGRenderer.DrawingInstruction di)
protected void addRect(float x, float y, float w, float h, float rx, float ry, org.apache.fop.render.pdf.SVGRenderer.DrawingInstruction di)
x
- the x position of left edgey
- the y position of top edgew
- the widthh
- the heightrx
- the x radius curved edgery
- the y radius curved edgeprotected void addPath(java.util.Vector points, int posx, int posy, org.apache.fop.render.pdf.SVGRenderer.DrawingInstruction di)
protected float[] calculateLastControl(float x1, float y1, float x2, float y2, float relx, float rely)
protected void addPolyline(java.util.Vector points, org.apache.fop.render.pdf.SVGRenderer.DrawingInstruction di, boolean close)
protected void doDrawing(org.apache.fop.render.pdf.SVGRenderer.DrawingInstruction di)
public void renderImage(java.lang.String href, float x, float y, float width, float height)
protected void renderSymbol(org.w3c.dom.svg.SVGSymbolElement symbol, int x, int y)
protected void handleGradient(java.lang.String sp, org.apache.fop.render.pdf.SVGRenderer.DrawingInstruction di, boolean fill, org.w3c.dom.svg.SVGElement area)
protected void handlePattern(org.w3c.dom.svg.SVGPatternElement pattern, org.apache.fop.render.pdf.SVGRenderer.DrawingInstruction di, boolean fill, org.w3c.dom.svg.SVGElement area)
protected void handleLinearGradient(org.w3c.dom.svg.SVGLinearGradientElement linear, org.apache.fop.render.pdf.SVGRenderer.DrawingInstruction di, boolean fill, org.w3c.dom.svg.SVGElement area)
protected void handleRadialGradient(org.w3c.dom.svg.SVGRadialGradientElement radial, org.apache.fop.render.pdf.SVGRenderer.DrawingInstruction di, boolean fill, org.w3c.dom.svg.SVGElement area)
protected org.apache.fop.render.pdf.SVGRenderer.DrawingInstruction applyStyle(org.w3c.dom.svg.SVGElement area, org.w3c.dom.svg.SVGStylable style)
protected void applyTransform(org.w3c.dom.svg.SVGAnimatedTransformList trans)
public void renderElement(org.w3c.dom.svg.SVGElement area, int posx, int posy)
public void renderText(SVGTextElementImpl tg, float x, float y, org.apache.fop.render.pdf.SVGRenderer.DrawingInstruction di)
protected float addSVGStr(FontState fs, float currentX, java.lang.String str, boolean spacing)
protected org.w3c.dom.svg.SVGElement locateDef(java.lang.String ref, org.w3c.dom.svg.SVGElement currentElement)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |