org.apache.fop.render.pcl
Class PCLSVGRenderer

java.lang.Object
  |
  +--org.apache.fop.render.pcl.PCLSVGRenderer

public class PCLSVGRenderer
extends java.lang.Object

Renderer that renders SVG to PCL


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
 
Constructor Summary
PCLSVGRenderer(PCLRenderer rend, FontState fs, java.lang.String font, int size, int xpos, int ypos, int ph, int xo)
          create the SVG renderer
 
Method Summary
protected  void addLine(float x1, float y1, float x2, float y2, PDFColor sc, float sw)
           
protected  void addPolyline(java.util.Vector points, int posx, int posy, PDFColor fc, PDFColor sc, float sw, boolean close)
           
protected  void addRect(float x, float y, float w, float h, float rx, float ry, PDFColor fc, PDFColor sc, float sw)
          add a filled 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  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)
           
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

currentFontName

protected java.lang.String currentFontName
the current (internal) font name

currentFontSize

protected int currentFontSize
the current font size in millipoints

currentYPosition

protected int currentYPosition
the current vertical position in millipoints from bottom

currentXPosition

protected int currentXPosition
the current horizontal position in millipoints from left
Constructor Detail

PCLSVGRenderer

public PCLSVGRenderer(PCLRenderer rend,
                      FontState fs,
                      java.lang.String font,
                      int size,
                      int xpos,
                      int ypos,
                      int ph,
                      int xo)
create the SVG renderer
Method Detail

renderSVG

protected void renderSVG(org.w3c.dom.svg.SVGSVGElement svg,
                         int x,
                         int y)
Renders an SVG element in an SVG document. This renders each of the child elements.

renderGArea

public void renderGArea(org.w3c.dom.svg.SVGGElement area,
                        int posx,
                        int posy)

handleSwitchElement

protected void handleSwitchElement(int posx,
                                   int posy,
                                   org.w3c.dom.svg.SVGSwitchElement ael)
Handles the SVG switch element. The switch determines which of its child elements should be rendered according to the required extensions, required features and system language.

addLine

protected void addLine(float x1,
                       float y1,
                       float x2,
                       float y2,
                       PDFColor sc,
                       float sw)

addRect

protected void addRect(float x,
                       float y,
                       float w,
                       float h,
                       float rx,
                       float ry,
                       PDFColor fc,
                       PDFColor sc,
                       float sw)
add a filled rectangle to the current stream
Parameters:
x - the x position of left edge in millipoints
y - the y position of top edge in millipoints
w - the width in millipoints
h - the height in millipoints
r - the red component of edges
g - the green component of edges
b - the blue component of edges
fr - the red component of the fill
fg - the green component of the fill
fb - the blue component of the fill

addPolyline

protected void addPolyline(java.util.Vector points,
                           int posx,
                           int posy,
                           PDFColor fc,
                           PDFColor sc,
                           float sw,
                           boolean close)

renderImage

public void renderImage(java.lang.String href,
                        float x,
                        float y,
                        float width,
                        float height)

renderSymbol

protected void renderSymbol(org.w3c.dom.svg.SVGSymbolElement symbol,
                            int x,
                            int y)
A symbol has a viewbox and preserve aspect ratio.

renderElement

public void renderElement(org.w3c.dom.svg.SVGElement area,
                          int posx,
                          int posy)
Main rendering selection. This applies any transform ans style and then calls the appropriate rendering method depending on the type of the element.

addSVGStr

protected float addSVGStr(FontState fs,
                          float currentX,
                          java.lang.String str,
                          boolean spacing)
Adds an svg string to the output. This handles the escaping of special pdf chars and deals with whitespace.

locateDef

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. Either gets the element defined by its "id" in the current SVGDocument, or if the uri reference is to an external document it loads the document and returns the element.


Copyright © 1999-2001 Apache Software Foundation. All Rights Reserved.