public class DataStream
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected static org.apache.commons.logging.Log |
log
Static logging instance
|
Constructor and Description |
---|
DataStream(Factory factory,
AFPPaintingState paintingState,
java.io.OutputStream outputStream)
Default constructor for the AFPDocumentStream.
|
Modifier and Type | Method and Description |
---|---|
void |
addFontsToCurrentPage(java.util.Map pageFonts)
Creates the given page fonts in the current page
|
void |
createFont(int fontReference,
AFPFont font,
int size)
Helper method to create a map coded font object on the current page, this
method delegates the construction of the map coded font object to the
active environment group on the current page.
|
void |
createIncludePageOverlay(java.lang.String name,
int x,
int y)
Helper method which allows creation of the MPO object, via the AEG.
|
void |
createIncludePageSegment(java.lang.String name,
int x,
int y,
int width,
int height)
Creates an IncludePageSegment on the current page.
|
void |
createInvokeMediumMap(java.lang.String name)
Helper method which allows creation of the IMM object.
|
void |
createLine(AFPLineDataInfo lineDataInfo)
Method to create a line on the current page.
|
void |
createNoOperation(java.lang.String content)
Creates a NoOperation item
|
void |
createPageGroupTagLogicalElement(TagLogicalElementBean[] attributes)
Creates a TagLogicalElement on the current page group.
|
void |
createPageTagLogicalElement(TagLogicalElementBean[] attributes)
Creates a TagLogicalElement on the current page.
|
void |
createShading(int x,
int y,
int w,
int h,
java.awt.Color col)
This method will create shading on the page using the specified
coordinates (the shading contrast is controlled via the red, green, blue
parameters, by converting this to grey scale).
|
void |
createTagLogicalElement(java.lang.String name,
java.lang.String value)
Creates a TagLogicalElement on the current page or page group
|
void |
createText(AFPTextDataInfo textDataInfo,
int letterSpacing,
int wordSpacing,
Font font,
CharacterSet charSet)
Helper method to create text on the current page, this method delegates
to the current presentation text object in order to construct the text.
|
void |
endDocument()
Helper method to mark the end of the current document.
|
void |
endOverlay()
Helper method to mark the end of the current overlay.
|
void |
endPage()
Helper method to mark the end of the current page.
|
void |
endPageGroup()
Helper method to mark the end of the page group.
|
AbstractPageObject |
getCurrentPage()
Returns the current page
|
PageGroup |
getCurrentPageGroup()
Returns the current page group
|
InterchangeSet |
getInterchangeSet()
Returns the MO:DCA interchange set in use
|
java.io.OutputStream |
getOutputStream()
Returns the outputstream
|
ResourceGroup |
getResourceGroup(AFPResourceLevel level)
Returns the resource group for a given resource info
|
void |
restorePage(PageObject pageObject)
Helper method to restore the current page.
|
PageObject |
savePage()
Helper method to save the current page.
|
void |
setDocumentName(java.lang.String name)
The document is started by invoking this method which creates an instance
of the AFP Document object.
|
void |
setInterchangeSet(InterchangeSet interchangeSet)
Sets the MO:DCA interchange set to use
|
void |
startDocument()
Start a new document.
|
void |
startOverlay(int x,
int y,
int width,
int height,
int widthRes,
int heightRes,
int overlayRotation)
Start a new overlay.
|
void |
startPage(int pageWidth,
int pageHeight,
int pageRotation,
int pageWidthRes,
int pageHeightRes)
Start a new page.
|
void |
startPageGroup()
Start a new page group.
|
public DataStream(Factory factory, AFPPaintingState paintingState, java.io.OutputStream outputStream)
factory
- the resource factorypaintingState
- the AFP painting stateoutputStream
- the outputstream to write topublic java.io.OutputStream getOutputStream()
public AbstractPageObject getCurrentPage()
public void setDocumentName(java.lang.String name)
name
- the name of this document.public void endDocument() throws java.io.IOException
java.io.IOException
- thrown if an I/O exception of some sort has occurredpublic void startPage(int pageWidth, int pageHeight, int pageRotation, int pageWidthRes, int pageHeightRes)
endPage()
method must be invoked to mark the page ending.pageWidth
- the width of the pagepageHeight
- the height of the pagepageRotation
- the rotation of the pagepageWidthRes
- the width resolution of the pagepageHeightRes
- the height resolution of the pagepublic void startOverlay(int x, int y, int width, int height, int widthRes, int heightRes, int overlayRotation)
endOverlay()
method must be invoked to mark the overlay
ending.x
- the x position of the overlay on the pagey
- the y position of the overlay on the pagewidth
- the width of the overlayheight
- the height of the overlaywidthRes
- the width resolution of the overlayheightRes
- the height resolution of the overlayoverlayRotation
- the rotation of the overlaypublic void endOverlay() throws java.io.IOException
java.io.IOException
- thrown if an I/O exception of some sort has occurredpublic PageObject savePage()
public void restorePage(PageObject pageObject)
pageObject
- page objectpublic void endPage() throws java.io.IOException
java.io.IOException
- thrown if an I/O exception of some sort has occurredpublic void addFontsToCurrentPage(java.util.Map pageFonts)
pageFonts
- a collection of AFP font attributespublic void createFont(int fontReference, AFPFont font, int size)
fontReference
- the font number used as the resource identifierfont
- the fontsize
- the point size of the fontpublic void createText(AFPTextDataInfo textDataInfo, int letterSpacing, int wordSpacing, Font font, CharacterSet charSet) throws java.io.UnsupportedEncodingException
textDataInfo
- the afp text dataletterSpacing
- letter spacing to draw text withwordSpacing
- word Spacing to draw text withfont
- is the font to draw text withcharSet
- is the AFP Character Set to use with the textjava.io.UnsupportedEncodingException
- thrown if character encoding is not supportedpublic void createLine(AFPLineDataInfo lineDataInfo)
lineDataInfo
- the line data information.public void createShading(int x, int y, int w, int h, java.awt.Color col)
x
- the x coordinate of the shadingy
- the y coordinate of the shadingw
- the width of the shaded areah
- the height of the shaded areacol
- the shading colorpublic void createIncludePageOverlay(java.lang.String name, int x, int y)
name
- the name of the static overlayx
- x-coordinatey
- y-coordinatepublic void createInvokeMediumMap(java.lang.String name)
name
- the name of the medium mappublic void createIncludePageSegment(java.lang.String name, int x, int y, int width, int height)
name
- the name of the include page segmentx
- the x coordinate for the overlayy
- the y coordinate for the overlaywidth
- the width of the imageheight
- the height of the imagepublic void createPageTagLogicalElement(TagLogicalElementBean[] attributes)
attributes
- the array of key value pairs.public void createPageGroupTagLogicalElement(TagLogicalElementBean[] attributes)
attributes
- the array of key value pairs.public void createTagLogicalElement(java.lang.String name, java.lang.String value)
name
- The tag namevalue
- The tag valuepublic void createNoOperation(java.lang.String content)
content
- byte datapublic PageGroup getCurrentPageGroup()
public void startDocument() throws java.io.IOException
java.io.IOException
- thrown if an I/O exception of some sort has occurredpublic void startPageGroup() throws java.io.IOException
endPageGroup()
method must be invoked to mark the page
group ending.java.io.IOException
- thrown if an I/O exception of some sort has occurredpublic void endPageGroup() throws java.io.IOException
java.io.IOException
- thrown if an I/O exception of some sort has occurredpublic void setInterchangeSet(InterchangeSet interchangeSet)
interchangeSet
- the MO:DCA interchange setpublic InterchangeSet getInterchangeSet()
public ResourceGroup getResourceGroup(AFPResourceLevel level)
level
- a resource levelCopyright 1999-2010 The Apache Software Foundation. All Rights Reserved.