org.apache.fop.render
Class AbstractRenderer

java.lang.Object
  extended byorg.apache.fop.render.AbstractRenderer
All Implemented Interfaces:
Renderer
Direct Known Subclasses:
AWTRenderer, MIFRenderer, PrintRenderer, PSRenderer, SVGRenderer

public abstract class AbstractRenderer
extends java.lang.Object
implements Renderer

Abstract base class for all renderers.


Field Summary
protected  int currentAreaContainerXPosition
          the horizontal position of the current area container
protected  int currentXPosition
          the current horizontal position in millipoints from left
protected  int currentYPosition
          the current vertical position in millipoints from bottom
protected  IDReferences idReferences
           
protected  org.apache.avalon.framework.logger.Logger log
           
 
Constructor Summary
AbstractRenderer()
           
 
Method Summary
protected abstract  void addFilledRect(int x, int y, int w, int h, ColorType col)
          Add a filled rectangle to the current stream This default implementation calls addRect using the same color for fill and border.
protected  void doBackground(Area area, int x, int y, int w, int h)
          Renders an area's background.
protected abstract  void doFrame(Area area)
           
protected  void drawImage(int x, int y, FopImage image, FontState fs)
          Renders an image, rendered at the image's intrinsic size.
protected abstract  void drawImageClipped(int x, int y, int clipX, int clipY, int clipW, int clipH, FopImage image, FontState fs)
          Renders an image, clipping it as specified.
protected abstract  void drawImageScaled(int x, int y, int w, int h, FopImage image, FontState fs)
          Renders an image, scaling it to the given width and height.
 IDReferences getIDReferences()
           
 void renderAreaContainer(AreaContainer area)
          render area container
 void renderBlockArea(BlockArea area)
          render block area
 void renderBodyAreaContainer(BodyAreaContainer area)
          render the given area container
 void renderImageArea(ImageArea area)
          Render an image area.
 void renderLineArea(LineArea area)
          render line area
 void renderRegionAreaContainer(AreaContainer area)
          render region area container
 void renderRegions(Page page)
          render region areas
 void renderSpanArea(SpanArea area)
          render the given span area
 void setLogger(org.apache.avalon.framework.logger.Logger logger)
          Set the logger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.fop.render.Renderer
render, renderDisplaySpace, renderForeignObjectArea, renderInlineSpace, renderLeaderArea, renderPage, renderSVGArea, renderWordArea, setOptions, setProducer, setupFontInfo, startRenderer, stopRenderer
 

Field Detail

log

protected org.apache.avalon.framework.logger.Logger log

currentYPosition

protected int currentYPosition
the current vertical position in millipoints from bottom


currentXPosition

protected int currentXPosition
the current horizontal position in millipoints from left


currentAreaContainerXPosition

protected int currentAreaContainerXPosition
the horizontal position of the current area container


idReferences

protected IDReferences idReferences
Constructor Detail

AbstractRenderer

public AbstractRenderer()
Method Detail

setLogger

public void setLogger(org.apache.avalon.framework.logger.Logger logger)
Description copied from interface: Renderer
Set the logger

Specified by:
setLogger in interface Renderer

renderSpanArea

public void renderSpanArea(SpanArea area)
Description copied from interface: Renderer
render the given span area

Specified by:
renderSpanArea in interface Renderer

doFrame

protected abstract void doFrame(Area area)

doBackground

protected void doBackground(Area area,
                            int x,
                            int y,
                            int w,
                            int h)
Renders an area's background.

Parameters:
x - the x position of the left edge in millipoints
y - the y position of top edge in millipoints
w - the width in millipoints
h - the height in millipoints

addFilledRect

protected abstract void addFilledRect(int x,
                                      int y,
                                      int w,
                                      int h,
                                      ColorType col)
Add a filled rectangle to the current stream This default implementation calls addRect using the same color for fill and border.

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

drawImage

protected void drawImage(int x,
                         int y,
                         FopImage image,
                         FontState fs)
Renders an image, rendered at the image's intrinsic size. This by default calls drawImageScaled() with the image's intrinsic width and height, but implementations may override this method if it can provide a more efficient solution.

Parameters:
x - the x position of left edge in millipoints
y - the y position of top edge in millipoints
image - the image to be rendered
fs - the font state to use when rendering text in non-bitmapped images.

drawImageScaled

protected abstract void drawImageScaled(int x,
                                        int y,
                                        int w,
                                        int h,
                                        FopImage image,
                                        FontState fs)
Renders an image, scaling it to the given width and height. If the scaled width and height is the same intrinsic size of the image, the image is not scaled.

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
image - the image to be rendered
fs - the font state to use when rendering text in non-bitmapped images.

drawImageClipped

protected abstract void drawImageClipped(int x,
                                         int y,
                                         int clipX,
                                         int clipY,
                                         int clipW,
                                         int clipH,
                                         FopImage image,
                                         FontState fs)
Renders an image, clipping it as specified.

Parameters:
x - the x position of left edge in millipoints.
y - the y position of top edge in millipoints.
clipX - the left edge of the clip in millipoints
clipY - the top edge of the clip in millipoints
clipW - the clip width in millipoints
clipH - the clip height in millipoints
fs - the font state to use when rendering text in non-bitmapped images.

renderImageArea

public void renderImageArea(ImageArea area)
Render an image area.

Specified by:
renderImageArea in interface Renderer
Parameters:
area - the image area to render

renderBodyAreaContainer

public void renderBodyAreaContainer(BodyAreaContainer area)
Description copied from interface: Renderer
render the given area container

Specified by:
renderBodyAreaContainer in interface Renderer

renderRegionAreaContainer

public void renderRegionAreaContainer(AreaContainer area)
render region area container

Specified by:
renderRegionAreaContainer in interface Renderer
Parameters:
area - the region area container to render

renderAreaContainer

public void renderAreaContainer(AreaContainer area)
render area container

Specified by:
renderAreaContainer in interface Renderer
Parameters:
area - the area container to render

renderBlockArea

public void renderBlockArea(BlockArea area)
render block area

Specified by:
renderBlockArea in interface Renderer
Parameters:
area - the block area to render

renderLineArea

public void renderLineArea(LineArea area)
render line area

Specified by:
renderLineArea in interface Renderer
Parameters:
area - area to render

renderRegions

public void renderRegions(Page page)
render region areas

Parameters:
page - the page whose regions to render

getIDReferences

public IDReferences getIDReferences()
Specified by:
getIDReferences in interface Renderer


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