|
fop 2.0 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.fop.afp.DataStream
public class DataStream
A data stream is a continuous ordered stream of data elements and objects conforming to a given format. Application programs can generate data streams destined for a presentation service, archive library, presentation device or another application program. The strategic presentation data stream architectures used is Mixed Object Document Content Architecture (MO:DCA). The MO:DCA architecture defines the data stream used by applications to describe documents and object envelopes for interchange with other applications and application services. Documents defined in the MO:DCA format may be archived in a database, then later retrieved, viewed, annotated and printed in local or distributed systems environments. Presentation fidelity is accommodated by including resource objects in the documents that reference them.
Field Summary | |
---|---|
protected static org.apache.commons.logging.Log |
LOG
Static logging instance |
Constructor Summary | |
---|---|
DataStream(Factory factory,
AFPPaintingState paintingState,
java.io.OutputStream outputStream)
Default constructor for the AFPDocumentStream. |
Method Summary | |
---|---|
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(TagLogicalElement.State[] attributes)
Creates a TagLogicalElement on the current page group. |
void |
createPageTagLogicalElement(TagLogicalElement.State[] 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,
int encoding)
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final org.apache.commons.logging.Log LOG
Constructor Detail |
---|
public DataStream(Factory factory, AFPPaintingState paintingState, java.io.OutputStream outputStream)
factory
- the resource factorypaintingState
- the AFP painting stateoutputStream
- the outputstream to write toMethod Detail |
---|
public 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 text
java.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(TagLogicalElement.State[] attributes)
attributes
- the array of key value pairs.public void createPageGroupTagLogicalElement(TagLogicalElement.State[] attributes)
attributes
- the array of key value pairs.public void createTagLogicalElement(java.lang.String name, java.lang.String value, int encoding)
name
- The tag namevalue
- The tag valueencoding
- The CCSID character set encodingpublic 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 level
|
fop 2.0 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |