fi.hut.tml.xsmiles.mlfc.xslfo.render.jdk11
Class AWTRenderer2

java.lang.Object
  extended byfi.hut.tml.xsmiles.mlfc.xslfo.render.jdk11.AWTRenderer2
All Implemented Interfaces:
org.apache.fop.render.Renderer
Direct Known Subclasses:
XSmilesAWTRenderer11

public class AWTRenderer2
extends java.lang.Object
implements org.apache.fop.render.Renderer

This class is a JDK 1.1 compliant version of the AWTRenderer2 class. The main differences between the JDK 1.2 and JDK 1.1 version are - use of Graphics instead of Graphics2 for the Graphics object - use of XCanvas instead of BufferedImage - no SVG support - no image support (yet...) All references to JDK 1.2 classes and packages have been removed - java.awt.print, java.awt.font, java.awt.geom ...


Nested Class Summary
 class AWTRenderer2.XCanvas
           
 
Field Summary
protected  float currentBlue
           
protected  java.lang.String currentFontName
          The current (internal) font name
protected  int currentFontSize
          The current font size in millipoints
protected  float currentGreen
           
protected  float currentRed
          The current colour's red, green and blue component
protected  int currentXPosition
          The current horizontal position in millipoints from left
protected  int currentYPosition
          The current vertical position in millipoints from bottom
protected  java.util.Hashtable fontNames
           
protected  java.util.Hashtable fontStyles
           
protected  org.apache.fop.datatypes.IDReferences idReferences
           
protected  java.util.Hashtable JAVA_FONT_NAMES
           
protected  java.util.Hashtable options
          options
protected  int pageHeight
           
protected  java.util.Vector pageList
           
protected  int pageNumber
           
protected  int pageWidth
           
protected  java.awt.Container parent
           
protected  org.apache.fop.viewer.ProgressListener progressListener
           
protected  org.apache.fop.viewer.Translator res
           
protected  java.awt.Color saveColor
           
protected  double scaleFactor
           
protected  org.apache.fop.layout.AreaTree tree
           
 
Constructor Summary
AWTRenderer2(org.apache.fop.viewer.Translator aRes)
           
 
Method Summary
protected  void addLine(int x1, int y1, int x2, int y2, int th, float r, float g, float b)
          add a line to the current stream
protected  void addRect(int x, int y, int w, int h, float r, float g, float b)
          draw a filled rectangle
protected  void addRect(int x, int y, int w, int h, float r, float g, float b, float fr, float fg, float fb)
          draw a filled rectangle
static java.awt.Color colorType2Color(org.apache.fop.datatypes.ColorType ct)
           
protected  void drawFrame()
           
protected  java.awt.Rectangle getBounds(org.apache.fop.layout.Area a)
           
protected  java.lang.String getJavaFontName(java.lang.String aName)
           
 AWTRenderer2.XCanvas getLastRenderedPage()
           
 int getNumberOfPages()
           
 int getPageCount()
           
 int getPageNumber()
           
 java.awt.Component getRenderedComponent()
           
 double getScaleFactor()
           
 void render(int aPageNumber)
          Retrieve the number of pages in this document.
 void render(org.apache.fop.layout.Page page)
           
 void render(org.apache.fop.layout.Page page, java.io.OutputStream stream)
           
 void renderAreaContainer(org.apache.fop.layout.AreaContainer area)
           
 void renderBlockArea(org.apache.fop.layout.BlockArea area)
           
 void renderBodyAreaContainer(org.apache.fop.layout.BodyAreaContainer area)
           
 void renderDisplaySpace(org.apache.fop.layout.DisplaySpace space)
           
 void renderForeignObjectArea(org.apache.fop.layout.inline.ForeignObjectArea area)
           
 void renderImage(java.lang.String href, float x, float y, float width, float height, java.util.Vector transform)
          Draws an image.
 void renderImageArea(org.apache.fop.image.ImageArea area)
           
 void renderInlineSpace(org.apache.fop.layout.inline.InlineSpace space)
           
 void renderLeaderArea(org.apache.fop.layout.inline.LeaderArea area)
           
 void renderLineArea(org.apache.fop.layout.LineArea area)
           
 void renderPage(org.apache.fop.layout.Page page)
           
 void renderSpanArea(org.apache.fop.layout.SpanArea area)
           
 void renderSVGArea(org.apache.fop.svg.SVGArea area)
          render rule area into PDF
 void renderWordArea(org.apache.fop.layout.inline.WordArea area)
           
 void setOptions(java.util.Hashtable options)
           
 void setPageNumber(int aValue)
           
 void setParent(java.awt.Container container)
           
 void setProducer(java.lang.String producer)
           
 void setProgressListener(org.apache.fop.viewer.ProgressListener l)
           
 void setScaleFactor(double newScaleFactor)
           
 void setupFontInfo(org.apache.fop.layout.FontInfo fontInfo)
           
 void startRenderer(java.io.OutputStream outputStream)
           
 void stopRenderer(java.io.OutputStream outputStream)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pageWidth

protected int pageWidth

pageHeight

protected int pageHeight

scaleFactor

protected double scaleFactor

pageNumber

protected int pageNumber

tree

protected org.apache.fop.layout.AreaTree tree

progressListener

protected org.apache.fop.viewer.ProgressListener progressListener

res

protected org.apache.fop.viewer.Translator res

fontNames

protected java.util.Hashtable fontNames

fontStyles

protected java.util.Hashtable fontStyles

saveColor

protected java.awt.Color saveColor

JAVA_FONT_NAMES

protected java.util.Hashtable JAVA_FONT_NAMES

pageList

protected java.util.Vector pageList

idReferences

protected org.apache.fop.datatypes.IDReferences idReferences

currentFontName

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


currentFontSize

protected int currentFontSize
The current font size in millipoints


options

protected java.util.Hashtable options
options


currentRed

protected float currentRed
The current colour's red, green and blue component


currentGreen

protected float currentGreen

currentBlue

protected float currentBlue

currentYPosition

protected int currentYPosition
The current vertical position in millipoints from bottom


currentXPosition

protected int currentXPosition
The current horizontal position in millipoints from left


parent

protected java.awt.Container parent
Constructor Detail

AWTRenderer2

public AWTRenderer2(org.apache.fop.viewer.Translator aRes)
Method Detail

getRenderedComponent

public java.awt.Component getRenderedComponent()

getPageNumber

public int getPageNumber()

setOptions

public void setOptions(java.util.Hashtable options)
Specified by:
setOptions in interface org.apache.fop.render.Renderer

setPageNumber

public void setPageNumber(int aValue)

setScaleFactor

public void setScaleFactor(double newScaleFactor)

getScaleFactor

public double getScaleFactor()

getLastRenderedPage

public AWTRenderer2.XCanvas getLastRenderedPage()

addLine

protected void addLine(int x1,
                       int y1,
                       int x2,
                       int y2,
                       int th,
                       float r,
                       float g,
                       float b)
add a line to the current stream

Parameters:
x1 - the start x location in millipoints
y1 - the start y location in millipoints
x2 - the end x location in millipoints
y2 - the end y location in millipoints
th - the thickness in millipoints
r - the red component
g - the green component
b - the blue component

setParent

public void setParent(java.awt.Container container)

addRect

protected void addRect(int x,
                       int y,
                       int w,
                       int h,
                       float r,
                       float g,
                       float b)
draw a filled rectangle

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
g - the green component
b - the blue component

addRect

protected void addRect(int x,
                       int y,
                       int w,
                       int h,
                       float r,
                       float g,
                       float b,
                       float fr,
                       float fg,
                       float fb)
draw a filled rectangle

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

drawFrame

protected void drawFrame()

render

public void render(int aPageNumber)
Retrieve the number of pages in this document.

Returns:
the number of pages

render

public void render(org.apache.fop.layout.Page page,
                   java.io.OutputStream stream)
            throws java.io.IOException
Specified by:
render in interface org.apache.fop.render.Renderer
Throws:
java.io.IOException

render

public void render(org.apache.fop.layout.Page page)
            throws java.io.IOException
Throws:
java.io.IOException

renderPage

public void renderPage(org.apache.fop.layout.Page page)
Specified by:
renderPage in interface org.apache.fop.render.Renderer

renderAreaContainer

public void renderAreaContainer(org.apache.fop.layout.AreaContainer area)
Specified by:
renderAreaContainer in interface org.apache.fop.render.Renderer

renderBodyAreaContainer

public void renderBodyAreaContainer(org.apache.fop.layout.BodyAreaContainer area)
Specified by:
renderBodyAreaContainer in interface org.apache.fop.render.Renderer

renderSpanArea

public void renderSpanArea(org.apache.fop.layout.SpanArea area)
Specified by:
renderSpanArea in interface org.apache.fop.render.Renderer

getBounds

protected java.awt.Rectangle getBounds(org.apache.fop.layout.Area a)

renderBlockArea

public void renderBlockArea(org.apache.fop.layout.BlockArea area)
Specified by:
renderBlockArea in interface org.apache.fop.render.Renderer

setupFontInfo

public void setupFontInfo(org.apache.fop.layout.FontInfo fontInfo)
Specified by:
setupFontInfo in interface org.apache.fop.render.Renderer

renderDisplaySpace

public void renderDisplaySpace(org.apache.fop.layout.DisplaySpace space)
Specified by:
renderDisplaySpace in interface org.apache.fop.render.Renderer

renderImageArea

public void renderImageArea(org.apache.fop.image.ImageArea area)
Specified by:
renderImageArea in interface org.apache.fop.render.Renderer

renderWordArea

public void renderWordArea(org.apache.fop.layout.inline.WordArea area)
Specified by:
renderWordArea in interface org.apache.fop.render.Renderer

renderInlineSpace

public void renderInlineSpace(org.apache.fop.layout.inline.InlineSpace space)
Specified by:
renderInlineSpace in interface org.apache.fop.render.Renderer

renderLineArea

public void renderLineArea(org.apache.fop.layout.LineArea area)
Specified by:
renderLineArea in interface org.apache.fop.render.Renderer

renderLeaderArea

public void renderLeaderArea(org.apache.fop.layout.inline.LeaderArea area)
Specified by:
renderLeaderArea in interface org.apache.fop.render.Renderer

renderSVGArea

public void renderSVGArea(org.apache.fop.svg.SVGArea area)
render rule area into PDF

Specified by:
renderSVGArea in interface org.apache.fop.render.Renderer
Parameters:
area - area to render

getJavaFontName

protected java.lang.String getJavaFontName(java.lang.String aName)

setProducer

public void setProducer(java.lang.String producer)
Specified by:
setProducer in interface org.apache.fop.render.Renderer

getNumberOfPages

public int getNumberOfPages()

setProgressListener

public void setProgressListener(org.apache.fop.viewer.ProgressListener l)

colorType2Color

public static java.awt.Color colorType2Color(org.apache.fop.datatypes.ColorType ct)

renderImage

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


renderForeignObjectArea

public void renderForeignObjectArea(org.apache.fop.layout.inline.ForeignObjectArea area)
Specified by:
renderForeignObjectArea in interface org.apache.fop.render.Renderer

startRenderer

public void startRenderer(java.io.OutputStream outputStream)
                   throws java.io.IOException
Specified by:
startRenderer in interface org.apache.fop.render.Renderer
Throws:
java.io.IOException

stopRenderer

public void stopRenderer(java.io.OutputStream outputStream)
                  throws java.io.IOException
Specified by:
stopRenderer in interface org.apache.fop.render.Renderer
Throws:
java.io.IOException

getPageCount

public int getPageCount()


X-Smiles 1.2