|
fop 0.94 | |||||||||
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.
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. |
Fields inherited from class org.apache.fop.render.PrintRenderer |
---|
fontInfo, fontList, 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()
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 |
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.geom.Rectangle2D 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 |
---|
drawBorders, drawImage, handleBlockTraits, handleRegionTraits, renderBlockViewport, renderForeignObject, renderInlineAreaBackAndBorders, renderTextDecoration, renderViewport |
Methods inherited from class org.apache.fop.render.PrintRenderer |
---|
addFontList, createRendererContext, getFontFromArea, getFontResolver, getInternalFontNameForArea, lightenColor, 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 CHAR_HEIGHT
public static final int CHAR_WIDTH
Constructor Detail |
---|
public TXTRenderer()
TXTRenderer
object.
Method Detail |
---|
public java.lang.String getMimeType()
AbstractRenderer
getMimeType
in interface Renderer
getMimeType
in class AbstractRenderer
AbstractRenderer.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 bufferprotected void putChar(int x, int y, char ch, boolean ischar)
x
- x coordinatey
- x coordinatech
- char to addischar
- indicates if it char or backgroundprotected 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 AbstractRenderer
area
- inline area to renderpublic void renderPage(PageViewport page) throws java.io.IOException, FOPException
Renderer
renderPage
in interface Renderer
renderPage
in class AbstractRenderer
page
- The page to be rendered
java.io.IOException
- if an I/O error occurs
FOPException
- if a FOP interal error occurs.Renderer.renderPage(PageViewport)
public void startRenderer(java.io.OutputStream os) throws java.io.IOException
Renderer
startRenderer
in interface Renderer
startRenderer
in class AbstractRenderer
os
- The OutputStream to use for output
java.io.IOException
- If an I/O error occursRenderer.startRenderer(java.io.OutputStream)
public void stopRenderer() throws java.io.IOException
Renderer
stopRenderer
in interface Renderer
stopRenderer
in class AbstractRenderer
java.io.IOException
- If an I/O error occursRenderer.stopRenderer()
protected void restoreStateStackAfterBreakOut(java.util.List breakOutList)
restoreStateStackAfterBreakOut
in class AbstractPathOrientedRenderer
breakOutList
- the state stack to restore.AbstractPathOrientedRenderer
protected java.util.List breakOutOfStateStack()
breakOutOfStateStack
in class AbstractPathOrientedRenderer
AbstractPathOrientedRenderer
protected void saveGraphicsState()
saveGraphicsState
in class AbstractPathOrientedRenderer
AbstractPathOrientedRenderer
protected void restoreGraphicsState()
restoreGraphicsState
in class AbstractPathOrientedRenderer
AbstractPathOrientedRenderer
protected void beginTextObject()
beginTextObject
in class AbstractPathOrientedRenderer
AbstractPathOrientedRenderer
protected void endTextObject()
endTextObject
in class AbstractPathOrientedRenderer
AbstractPathOrientedRenderer
protected void clip()
clip
in class AbstractPathOrientedRenderer
AbstractPathOrientedRenderer
protected void clipRect(float x, float y, float width, float height)
clipRect
in class AbstractPathOrientedRenderer
x
- the x coordinatey
- the y coordinatewidth
- the width of the rectangleheight
- the height of the rectangleAbstractPathOrientedRenderer
protected void moveTo(float x, float y)
moveTo
in class AbstractPathOrientedRenderer
x
- x coordinatey
- y coordinateAbstractPathOrientedRenderer
protected void lineTo(float x, float y)
lineTo
in class AbstractPathOrientedRenderer
x
- x coordinatey
- y coordinateAbstractPathOrientedRenderer
protected void closePath()
closePath
in class AbstractPathOrientedRenderer
AbstractPathOrientedRenderer
protected void fillRect(float x, float y, float width, float height)
fillRect
in class AbstractPathOrientedRenderer
x
- the x coordinatey
- the y coordinatewidth
- the width of the rectangleheight
- the height of the rectangleAbstractPathOrientedRenderer
protected void updateColor(java.awt.Color col, boolean fill)
updateColor
in class AbstractPathOrientedRenderer
col
- the color to apply (null skips this operation)fill
- true to set the fill color, false for the foreground colorAbstractPathOrientedRenderer
protected void drawImage(java.lang.String url, java.awt.geom.Rectangle2D pos, java.util.Map foreignAttributes)
AbstractPathOrientedRenderer
drawImage
in class AbstractPathOrientedRenderer
url
- the URI/URL of the imagepos
- the position of the imageforeignAttributes
- an optional Map with foreign attributes, may be nullAbstractPathOrientedRenderer.drawImage(
java.lang.String, java.awt.geom.Rectangle2D, java.util.Map)
public void renderImage(Image image, java.awt.geom.Rectangle2D pos)
IMAGE_CHAR
.
renderImage
in class AbstractRenderer
image
- The imagepos
- The target position of the image
(todo) Make renderImage() protectedAbstractPathOrientedRenderer
protected 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)
AbstractPathOrientedRenderer
drawBorderLine
in class AbstractPathOrientedRenderer
x1
- 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 segmentAbstractPathOrientedRenderer
protected void drawBackAndBorders(Area area, float startx, float starty, float width, float height)
AbstractPathOrientedRenderer
drawBackAndBorders
in class AbstractPathOrientedRenderer
area
- the area to get the traits fromstartx
- the start x positionstarty
- the start y positionwidth
- the width of the areaheight
- the height of the areaAbstractPathOrientedRenderer
protected void startVParea(CTM ctm, java.awt.geom.Rectangle2D clippingRect)
AbstractRenderer
startVParea
in class AbstractRenderer
ctm
- the coordinate transformation matrix to useclippingRect
- the clipping rectangle if the viewport should be clipping,
null if no clipping is performed.AbstractRenderer.startVParea(CTM, Rectangle2D)
protected void endVParea()
AbstractRenderer
endVParea
in class AbstractRenderer
AbstractRenderer.endVParea()
|
fop 0.94 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |