|
fop 1.1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.fop.render.AbstractRenderer
org.apache.fop.render.PrintRenderer
org.apache.fop.render.AbstractPathOrientedRenderer
org.apache.fop.render.txt.TXTRenderer
public class TXTRenderer
Renderer that renders areas to plain text.
This work was authored by Art Welch and Mark Lillywhite (mark-fop@inomial.com) [to use the new Renderer interface].
| Field Summary | |
|---|---|
static int |
CHAR_HEIGHT
Height of one symbol in Courier font size of 10pt. |
static int |
CHAR_WIDTH
Width of one symbol in Courier font size of 10pt. |
static int |
LINE_LEADING
Leading of line containing Courier font size of 10pt. |
| Fields inherited from class org.apache.fop.render.AbstractPathOrientedRenderer |
|---|
FOX_TRANSFORM |
| Fields inherited from class org.apache.fop.render.PrintRenderer |
|---|
embedFontInfoList, fontInfo, fontResolver |
| Fields inherited from class org.apache.fop.render.AbstractRenderer |
|---|
containingBPPosition, containingIPPosition, currentBPPosition, currentIPPosition, currentPageViewport, log, userAgent |
| Fields inherited from interface org.apache.fop.render.Renderer |
|---|
ROLE |
| Constructor Summary | |
|---|---|
TXTRenderer(FOUserAgent userAgent)
Constructs a newly allocated TXTRenderer object. |
|
| Method Summary | |
|---|---|
protected void |
addChar(int x,
int y,
char ch,
boolean ischar)
Add char to text buffer. |
protected void |
addString(int row,
int col,
java.lang.String s)
Adds string to text buffer ( charData). |
protected void |
beginTextObject()
Does nothing. |
protected java.util.List |
breakOutOfStateStack()
Does nothing. |
protected void |
clip()
Does nothing. |
protected void |
clipRect(float x,
float y,
float width,
float height)
Does nothing. |
protected void |
closePath()
Does nothing. |
protected void |
concatenateTransformationMatrix(java.awt.geom.AffineTransform at)
Concatenates the current transformation matrix with the given one, therefore establishing a new coordinate system. |
protected void |
drawBackAndBorders(Area area,
float startx,
float starty,
float width,
float height)
Draw the background and borders. |
protected void |
drawBorderLine(float x1,
float y1,
float x2,
float y2,
boolean horz,
boolean startOrBefore,
int style,
java.awt.Color col)
Draw a border segment of an XSL-FO style border. |
protected void |
drawImage(java.lang.String url,
java.awt.geom.Rectangle2D pos,
java.util.Map foreignAttributes)
Draw an image at the indicated location. |
protected void |
endTextObject()
Does nothing. |
protected void |
endVParea()
Signals exit from a viewport area. |
protected void |
fillRect(float x,
float y,
float width,
float height)
Fills a rectangular area with the current filling char. |
java.lang.String |
getMimeType()
Get the MIME type of the renderer. |
boolean |
isLayInside(int x,
int y)
Indicates if point (x, y) lay inside currentPage. |
protected void |
lineTo(float x,
float y)
Does nothing. |
protected void |
moveTo(float x,
float y)
Does nothing. |
protected void |
putChar(int x,
int y,
char ch,
boolean ischar)
Add char to text or background buffer. |
void |
renderImage(Image image,
java.awt.geom.Rectangle2D pos)
Fills image rectangle with a IMAGE_CHAR. |
void |
renderPage(PageViewport page)
Tells the renderer to render a particular page. |
protected void |
renderText(TextArea area)
Render TextArea to Text. |
protected void |
restoreGraphicsState()
Does nothing. |
protected void |
restoreStateStackAfterBreakOut(java.util.List breakOutList)
Does nothing. |
protected void |
saveGraphicsState()
Does nothing. |
void |
setEncoding(java.lang.String encoding)
Sets the encoding of the target file. |
void |
startRenderer(java.io.OutputStream os)
Initiates the rendering phase. |
protected void |
startVParea(CTM ctm,
java.awt.Rectangle clippingRect)
Establishes a new viewport area. |
void |
stopRenderer()
Signals the end of the rendering phase. |
protected int |
toMilli(float x)
Returns the closest integer to the multiplication of a number and 1000. |
protected void |
updateColor(java.awt.Color col,
boolean fill)
Changes current filling char. |
| Methods inherited from class org.apache.fop.render.AbstractPathOrientedRenderer |
|---|
drawBackAndBorders, drawBackground, drawBackground, drawBorders, drawBorders, drawImage, establishTransformationMatrix, handleBlockTraits, handleRegionTraits, renderBlockViewport, renderFlow, renderForeignObject, renderInlineAreaBackAndBorders, renderInlineViewport, renderReferenceArea, renderTextDecoration |
| Methods inherited from class org.apache.fop.render.PrintRenderer |
|---|
addFontList, createRendererContext, getFontFromArea, getFontInfo, getFontList, getFontResolver, getInternalFontNameForArea, instantiateRendererContext, renderDocument, setFontList, setupFontInfo |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int LINE_LEADING
public static final int CHAR_HEIGHT
public static final int CHAR_WIDTH
| Constructor Detail |
|---|
public TXTRenderer(FOUserAgent userAgent)
TXTRenderer object.
userAgent - the user agent that contains configuration details. This cannot be null.| Method Detail |
|---|
public java.lang.String getMimeType()
public void setEncoding(java.lang.String encoding)
encoding - the encoding, null to select the default encoding (UTF-8)
public boolean isLayInside(int x,
int y)
x - x coordinatey - y coordinate
protected void addChar(int x,
int y,
char ch,
boolean ischar)
x - x coordinatey - y coordinatech - char to addischar - boolean, repersenting is character adding to text buffer
protected void putChar(int x,
int y,
char ch,
boolean ischar)
x - x coordinatey - x coordinatech - char to addischar - indicates if it char or background
protected void addString(int row,
int col,
java.lang.String s)
charData). Chars of string map in turn.
row - x coordinatecol - y coordinates - string to addprotected void renderText(TextArea area)
renderText in class AbstractRendererarea - inline area to render
public void renderPage(PageViewport page)
throws java.io.IOException,
FOPException
renderPage in interface RendererrenderPage in class AbstractRendererpage - The page to be rendered
java.io.IOException - if an I/O error occurs
FOPException - if a FOP interal error occurs.
public void startRenderer(java.io.OutputStream os)
throws java.io.IOException
startRenderer in interface RendererstartRenderer in class AbstractRendereros - The OutputStream to use for output
java.io.IOException - If an I/O error occurs
public void stopRenderer()
throws java.io.IOException
stopRenderer in interface RendererstopRenderer in class AbstractRendererjava.io.IOException - If an I/O error occursprotected void restoreStateStackAfterBreakOut(java.util.List breakOutList)
restoreStateStackAfterBreakOut in class AbstractPathOrientedRendererbreakOutList - the state stack to restore.protected java.util.List breakOutOfStateStack()
breakOutOfStateStack in class AbstractPathOrientedRendererprotected void saveGraphicsState()
saveGraphicsState in class AbstractPathOrientedRendererprotected void restoreGraphicsState()
restoreGraphicsState in class AbstractPathOrientedRendererprotected void beginTextObject()
beginTextObject in class AbstractPathOrientedRendererprotected void endTextObject()
endTextObject in class AbstractPathOrientedRendererprotected void clip()
clip in class AbstractPathOrientedRenderer
protected void clipRect(float x,
float y,
float width,
float height)
clipRect in class AbstractPathOrientedRendererx - the x coordinate (in points)y - the y coordinate (in points)width - the width of the rectangle (in points)height - the height of the rectangle (in points)
protected void moveTo(float x,
float y)
moveTo in class AbstractPathOrientedRendererx - x coordinatey - y coordinate
protected void lineTo(float x,
float y)
lineTo in class AbstractPathOrientedRendererx - x coordinatey - y coordinateprotected void closePath()
closePath in class AbstractPathOrientedRenderer
protected void fillRect(float x,
float y,
float width,
float height)
fillRect in class AbstractPathOrientedRendererx - the x coordinatey - the y coordinatewidth - the width of the rectangleheight - the height of the rectangle
protected void updateColor(java.awt.Color col,
boolean fill)
updateColor in class AbstractPathOrientedRenderercol - the color to apply (null skips this operation)fill - true to set the fill color, false for the foreground color
protected void drawImage(java.lang.String url,
java.awt.geom.Rectangle2D pos,
java.util.Map foreignAttributes)
drawImage in class AbstractPathOrientedRendererurl - the URI/URL of the imagepos - the position of the imageforeignAttributes - an optional Map with foreign attributes, may be null
public void renderImage(Image image,
java.awt.geom.Rectangle2D pos)
IMAGE_CHAR.
renderImage in class AbstractRendererimage - the base imagepos - the position of the imageprotected int toMilli(float x)
x - the value of the argument, multiplied by
1000 and rounded
protected void drawBorderLine(float x1,
float y1,
float x2,
float y2,
boolean horz,
boolean startOrBefore,
int style,
java.awt.Color col)
drawBorderLine in class AbstractPathOrientedRendererx1 - starting x coordinatey1 - starting y coordinatex2 - ending x coordinatey2 - ending y coordinatehorz - true for horizontal border segments, false for vertical border segmentsstartOrBefore - true for border segments on the start or before edge,
false for end or after.style - the border style (one of Constants.EN_DASHED etc.)col - the color for the border segment
protected void drawBackAndBorders(Area area,
float startx,
float starty,
float width,
float height)
drawBackAndBorders in class AbstractPathOrientedRendererarea - the area to get the traits fromstartx - the start x positionstarty - the start y positionwidth - the width of the areaheight - the height of the area
protected void startVParea(CTM ctm,
java.awt.Rectangle clippingRect)
startVParea in class AbstractRendererctm - the coordinate transformation matrix to useclippingRect - the clipping rectangle if the viewport should be clipping,
null if no clipping is performed.protected void endVParea()
endVParea in class AbstractRendererprotected void concatenateTransformationMatrix(java.awt.geom.AffineTransform at)
concatenateTransformationMatrix in class AbstractPathOrientedRendererat - the transformation matrix to process (coordinates in points)
|
fop 1.1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||