org.apache.fop.render.awt
Class AWTRenderer

Direct Known Subclasses:
PrintCommandLine.PrintRenderer

public class AWTRenderer
implements Pageable, Printable, Renderer


Inner Class Summary
 (package private) classAWTRenderer.DrawingInstruction
           

Constructor Summary
AWTRenderer(Translator aRes)
           

Method Summary
 static ColorcolorType2Color(ColorType ct)
           
 GeneralPathconvertPath(SVGPathElementImpl svgpath, float x, float y)
          Mapps a SVG-Path to a AWT-GeneralPath.
 java.awt.PolygonconvertPolygon(SVGPolygonElementImpl svgpl, int x, int y)
          Mapps a SVG-Polygon to a AWT-Polygon.
 BufferedImagegetLastRenderedPage()
           
 intgetNumberOfPages()
           
 intgetPageCount()
          Retrieve the number of pages in this document.
 PageFormatgetPageFormat(int pageIndex)
           
 intgetPageNumber()
           
 PrintablegetPrintable(int pageIndex)
           
 doublegetScaleFactor()
           
 intprint(Graphics g, PageFormat pageFormat, int pageIndex)
           
 voidrender(int aPageNumber)
           
 voidrender(AreaTree areaTree, OutputStream stream)
           
 voidrender(AreaTree areaTree, int aPageNumber)
           
 voidrenderAreaContainer(AreaContainer area)
           
 voidrenderBlockArea(BlockArea area)
           
 voidrenderBodyAreaContainer(BodyAreaContainer area)
           
 voidrenderDisplaySpace(DisplaySpace space)
           
 voidrenderElement(SVGArea svgarea, GraphicImpl area, int posx, int posy, Vector parentTransforms)
           
 voidrenderForeignObjectArea(ForeignObjectArea area)
           
 voidrenderGArea(SVGArea svgarea, SVGGElementImpl area, int posx, int posy, Vector v)
           
 voidrenderGArea(SVGArea svgarea, SVGGElementImpl area, int posx, int posy)
           
 voidrenderImage(String href, float x, float y, float width, float height, Vector transform)
          Draws an image.
 voidrenderImageArea(ImageArea area)
           
 voidrenderInlineArea(InlineArea area)
           
 voidrenderInlineSpace(InlineSpace space)
           
 voidrenderLeaderArea(LeaderArea area)
          render leader area into AWT
 voidrenderLineArea(LineArea area)
           
 voidrenderPage(Page page)
           
 voidrenderSpanArea(SpanArea area)
           
 voidrenderSVGArea(SVGArea area)
           
 voidsetComponent(Component parent)
          Sets parent component which is used to set up the font.
 voidsetPageNumber(int aValue)
           
 voidsetProducer(String producer)
           
 voidsetProgressListener(ProgressListener l)
           
 voidsetScaleFactor(double newScaleFactor)
           
 voidsetupFontInfo(FontInfo fontInfo)
           
 voidtransform(Graphics2D g2d, double zoomPercent, double angle)
          To configure before print.
 ShapetransformShape(Vector trans, Shape shape)
          Applies SVGTransform to the shape and gets the transformed shape.

Constructor Detail

AWTRenderer

public AWTRenderer(Translator aRes)
Method Detail

colorType2Color

public static Color colorType2Color(ColorType ct)

convertPath

public GeneralPath convertPath(SVGPathElementImpl svgpath, float x, float y)
Mapps a SVG-Path to a AWT-GeneralPath.

convertPolygon

public java.awt.Polygon convertPolygon(SVGPolygonElementImpl svgpl, int x, int y)
Mapps a SVG-Polygon to a AWT-Polygon.

getLastRenderedPage

public BufferedImage getLastRenderedPage()

getNumberOfPages

public int getNumberOfPages()

getPageCount

public int getPageCount()
Retrieve the number of pages in this document.
Returns: the number of pages

getPageFormat

public PageFormat getPageFormat(int pageIndex)
throws java.lang.IndexOutOfBoundsException

getPageNumber

public int getPageNumber()

getPrintable

public Printable getPrintable(int pageIndex)
throws java.lang.IndexOutOfBoundsException

getScaleFactor

public double getScaleFactor()

print

public int print(Graphics g, PageFormat pageFormat, int pageIndex)
throws java.awt.print.PrinterException

render

public void render(int aPageNumber)

render

public void render(AreaTree areaTree, OutputStream stream)
throws java.io.IOException

render

public void render(AreaTree areaTree, int aPageNumber)
throws java.io.IOException

renderAreaContainer

public void renderAreaContainer(AreaContainer area)

renderBlockArea

public void renderBlockArea(BlockArea area)

renderBodyAreaContainer

public void renderBodyAreaContainer(BodyAreaContainer area)

renderDisplaySpace

public void renderDisplaySpace(DisplaySpace space)

renderElement

public void renderElement(SVGArea svgarea, GraphicImpl area, int posx, int posy, Vector parentTransforms)

renderForeignObjectArea

public void renderForeignObjectArea(ForeignObjectArea area)

renderGArea

public void renderGArea(SVGArea svgarea, SVGGElementImpl area, int posx, int posy, Vector v)

renderGArea

public void renderGArea(SVGArea svgarea, SVGGElementImpl area, int posx, int posy)

renderImage

public void renderImage(String href, float x, float y, float width, float height, Vector transform)
Draws an image. TODO: protect other image formats (JIMI)

renderImageArea

public void renderImageArea(ImageArea area)

renderInlineArea

public void renderInlineArea(InlineArea area)

renderInlineSpace

public void renderInlineSpace(InlineSpace space)

renderLeaderArea

public void renderLeaderArea(LeaderArea area)
render leader area into AWT
Parameters:
area - area to render

renderLineArea

public void renderLineArea(LineArea area)

renderPage

public void renderPage(Page page)

renderSpanArea

public void renderSpanArea(SpanArea area)

renderSVGArea

public void renderSVGArea(SVGArea area)

setComponent

public void setComponent(Component parent)
Sets parent component which is used to set up the font. This is needed as FontSetup needs a live AWT component in order to generate valid font measures.
Parameters:
parent - the live AWT component reference

setPageNumber

public void setPageNumber(int aValue)

setProducer

public void setProducer(String producer)

setProgressListener

public void setProgressListener(ProgressListener l)

setScaleFactor

public void setScaleFactor(double newScaleFactor)

setupFontInfo

public void setupFontInfo(FontInfo fontInfo)

transform

public void transform(Graphics2D g2d, double zoomPercent, double angle)
To configure before print. Choose pages Zoom factor Page format / Landscape or Portrait

transformShape

public Shape transformShape(Vector trans, Shape shape)
Applies SVGTransform to the shape and gets the transformed shape. The type of the new shape may be different to the original type.

Association Links

to Class org.apache.fop.layout.AreaTree

to Class org.apache.fop.viewer.ProgressListener

to Class org.apache.fop.viewer.Translator

to Class java.util.Hashtable

to Class java.util.Hashtable

to Class java.awt.Color

to Class java.awt.image.BufferedImage

Image Object and Graphics Object. The Graphics Object is the Graphics object that is contained withing the Image Object.

to Class java.awt.Graphics2D

to Class java.lang.String

The current (internal) font name

to Class java.awt.Component

The parent component, used to set up the font. This is needed as FontSetup needs a live AWT component in order to generate valid font measures.