|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectfi.hut.tml.xsmiles.mlfc.xslfo.render.jdk12.AWTRenderer2
Modified by Mark Lillywhite mark-fop@inomial.com. Did lots of cleaning up and made the class implement the new Renderer interface. This class could also do with a general audit, and I suspect it's not swing-thread-safe either.
| Field Summary | |
protected int |
currentAreaContainerXPosition
The horizontal position of the current area container |
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 java.awt.Graphics2D |
graphics
|
protected org.apache.fop.datatypes.IDReferences |
idReferences
|
protected java.util.Hashtable |
options
options |
protected int |
pageHeight
|
protected java.util.Vector |
pageList
|
protected int |
pageNumber
|
protected int |
pageWidth
|
protected java.awt.Component |
parent
The parent component, used to set up the font. |
protected org.apache.fop.viewer.ProgressListener |
progressListener
|
protected org.apache.fop.viewer.Translator |
res
|
protected java.awt.Color |
saveColor
|
protected double |
scaleFactor
|
| Fields inherited from interface java.awt.print.Printable |
NO_SUCH_PAGE, PAGE_EXISTS |
| Fields inherited from interface java.awt.print.Pageable |
UNKNOWN_NUMBER_OF_PAGES |
| 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,
boolean drawAsOutline)
draw a filled rectangle in the current color |
protected void |
addRect(int x,
int y,
int w,
int h,
float r,
float g,
float b)
draw a 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.geom.Rectangle2D |
getBounds(org.apache.fop.layout.Area a)
|
java.awt.image.BufferedImage |
getLastRenderedPage()
|
int |
getNumberOfPages()
|
int |
getPageCount()
Retrieve the number of pages in this document. |
java.awt.print.PageFormat |
getPageFormat(int pageIndex)
|
int |
getPageNumber()
|
java.awt.print.Printable |
getPrintable(int pageIndex)
|
double |
getScaleFactor()
|
int |
print(java.awt.Graphics g,
java.awt.print.PageFormat pageFormat,
int pageIndex)
|
void |
removePage(int page)
|
void |
render(int aPageNumber)
|
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)
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)
render leader area into AWT |
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)
|
protected void |
renderSVGDocument(org.w3c.dom.Document doc,
int x,
int y)
|
void |
renderWordArea(org.apache.fop.layout.inline.WordArea area)
|
void |
setComponent(java.awt.Component parent)
Sets parent component which is used to set up the font. |
void |
setOptions(java.util.Hashtable options)
set up renderer options |
void |
setPageNumber(int aValue)
|
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)
|
void |
transform(java.awt.Graphics2D g2d,
double zoomPercent,
double angle)
To configure before print. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected int pageWidth
protected int pageHeight
protected double scaleFactor
protected int pageNumber
protected java.util.Vector pageList
protected org.apache.fop.viewer.ProgressListener progressListener
protected org.apache.fop.viewer.Translator res
protected java.util.Hashtable fontNames
protected java.util.Hashtable fontStyles
protected java.awt.Color saveColor
protected org.apache.fop.datatypes.IDReferences idReferences
protected java.awt.Graphics2D graphics
protected java.lang.String currentFontName
protected int currentFontSize
protected float currentRed
protected float currentGreen
protected float currentBlue
protected java.awt.Component parent
protected int currentYPosition
protected int currentXPosition
protected int currentAreaContainerXPosition
protected java.util.Hashtable options
| Constructor Detail |
public AWTRenderer2(org.apache.fop.viewer.Translator aRes)
| Method Detail |
public void setOptions(java.util.Hashtable options)
setOptions in interface org.apache.fop.render.Rendererpublic void setComponent(java.awt.Component parent)
parent - the live AWT component referencepublic int getPageNumber()
public void setPageNumber(int aValue)
public void setScaleFactor(double newScaleFactor)
public double getScaleFactor()
public java.awt.image.BufferedImage getLastRenderedPage()
protected void addLine(int x1,
int y1,
int x2,
int y2,
int th,
float r,
float g,
float b)
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 component
protected void addRect(int x,
int y,
int w,
int h,
float r,
float g,
float b)
x - the x position of left edge in millipointsy - the y position of top edge in millipointsw - the width in millipointsh - the height in millipointsr - the red componentg - the green componentb - the blue component
protected void addRect(int x,
int y,
int w,
int h,
float r,
float g,
float b,
float fr,
float fg,
float fb)
x - the x position of left edge in millipointsy - the y position of top edge in millipointsw - the width in millipointsh - the height in millipointsr - the red component of edgesg - the green component of edgesb - the blue component of edgesfr - the red component of the fillfg - the green component of the fillfb - the blue component of the fill
protected void addRect(int x,
int y,
int w,
int h,
boolean drawAsOutline)
x - the x position of left edge in millipointsy - the y position of top edge in millipointsw - the width in millipointsh - the height in millipointsdrawAsOutline - true for draw, false for fill
public void transform(java.awt.Graphics2D g2d,
double zoomPercent,
double angle)
protected void drawFrame()
public int getPageCount()
public void removePage(int page)
public void render(int aPageNumber)
public void render(org.apache.fop.layout.Page page,
java.io.OutputStream stream)
throws java.io.IOException
render in interface org.apache.fop.render.Rendererjava.io.IOException
public void render(org.apache.fop.layout.Page page)
throws java.io.IOException
java.io.IOExceptionpublic void renderPage(org.apache.fop.layout.Page page)
renderPage in interface org.apache.fop.render.Rendererpublic void renderAreaContainer(org.apache.fop.layout.AreaContainer area)
renderAreaContainer in interface org.apache.fop.render.Rendererpublic void renderBodyAreaContainer(org.apache.fop.layout.BodyAreaContainer area)
renderBodyAreaContainer in interface org.apache.fop.render.Rendererpublic void renderSpanArea(org.apache.fop.layout.SpanArea area)
renderSpanArea in interface org.apache.fop.render.Rendererprotected java.awt.geom.Rectangle2D getBounds(org.apache.fop.layout.Area a)
public void renderBlockArea(org.apache.fop.layout.BlockArea area)
renderBlockArea in interface org.apache.fop.render.Rendererpublic void setupFontInfo(org.apache.fop.layout.FontInfo fontInfo)
setupFontInfo in interface org.apache.fop.render.Rendererpublic void renderDisplaySpace(org.apache.fop.layout.DisplaySpace space)
renderDisplaySpace in interface org.apache.fop.render.Rendererpublic void renderImageArea(org.apache.fop.image.ImageArea area)
renderImageArea in interface org.apache.fop.render.Rendererpublic void renderWordArea(org.apache.fop.layout.inline.WordArea area)
renderWordArea in interface org.apache.fop.render.Rendererpublic void renderInlineSpace(org.apache.fop.layout.inline.InlineSpace space)
renderInlineSpace in interface org.apache.fop.render.Rendererpublic void renderLineArea(org.apache.fop.layout.LineArea area)
renderLineArea in interface org.apache.fop.render.Rendererpublic void renderLeaderArea(org.apache.fop.layout.inline.LeaderArea area)
renderLeaderArea in interface org.apache.fop.render.Rendererarea - area to renderpublic void renderSVGArea(org.apache.fop.svg.SVGArea area)
renderSVGArea in interface org.apache.fop.render.Renderer
protected void renderSVGDocument(org.w3c.dom.Document doc,
int x,
int y)
public void setProducer(java.lang.String producer)
setProducer in interface org.apache.fop.render.Renderer
public int print(java.awt.Graphics g,
java.awt.print.PageFormat pageFormat,
int pageIndex)
throws java.awt.print.PrinterException
print in interface java.awt.print.Printablejava.awt.print.PrinterExceptionpublic int getNumberOfPages()
getNumberOfPages in interface java.awt.print.Pageable
public java.awt.print.PageFormat getPageFormat(int pageIndex)
throws java.lang.IndexOutOfBoundsException
getPageFormat in interface java.awt.print.Pageablejava.lang.IndexOutOfBoundsException
public java.awt.print.Printable getPrintable(int pageIndex)
throws java.lang.IndexOutOfBoundsException
getPrintable in interface java.awt.print.Pageablejava.lang.IndexOutOfBoundsExceptionpublic void setProgressListener(org.apache.fop.viewer.ProgressListener l)
public static java.awt.Color colorType2Color(org.apache.fop.datatypes.ColorType ct)
public void renderForeignObjectArea(org.apache.fop.layout.inline.ForeignObjectArea area)
renderForeignObjectArea in interface org.apache.fop.render.Renderer
public void startRenderer(java.io.OutputStream outputStream)
throws java.io.IOException
startRenderer in interface org.apache.fop.render.Rendererjava.io.IOException
public void stopRenderer(java.io.OutputStream outputStream)
throws java.io.IOException
stopRenderer in interface org.apache.fop.render.Rendererjava.io.IOException
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||