org.jfree.layouting.output

Class AbstractOutputProcessor

Implemented Interfaces:
OutputProcessor
Known Direct Subclasses:
AbstractPageableProcessor, ExcelOutputProcessor, FlowGraphicsOutputProcessor, FlowHtmlOutputProcessor, StreamingHtmlOutputProcessor, StreamingPlaintextOutputProcessor

public abstract class AbstractOutputProcessor
extends java.lang.Object
implements OutputProcessor

This base class configures the layouter for the normal DOM processing. The display model assumes, that all elements can be nested freely, without imposing any limitations at all.

Using this as base process for text-processing document output (like RTF or OpenOffice-Writer) is a sure way to the hell of funny behaviour.

Author:
Thomas Morgner

Field Summary

protected static int
PROCESSING_CONTENT
protected static int
PROCESSING_GLOBAL_CONTENT
protected static int
PROCESSING_PAGES

Constructor Summary

AbstractOutputProcessor(Configuration configuration)

Method Summary

InputFeed
createInputFeed(LayoutProcess layoutProcess)
protected LogicalPageKey
createLogicalPage(int width, int height)
ModelBuilder
createModelBuilder(LayoutProcess layoutProcess)
The model builder normalizes the input and builds the Display-Model.
Normalizer
createNormalizer(LayoutProcess layoutProcess)
Returns the content normalizer implementation for this OP.
Configuration
getConfiguration()
DocumentContext
getDocumentContext()
LogicalPageKey
getLogicalPage(int page)
int
getLogicalPageCount()
int
getPageCursor()
protected int
getProcessingState()
boolean
isContentGeneratable()
This flag indicates, whether the output processor has collected enough information to start the content generation.
boolean
isGlobalStateComputed()
This flag indicates, whether the global content has been computed.
boolean
isPaginationFinished()
Checks, whether the 'processingFinished' event had been received at least once.
void
processContent(LogicalPageBox logicalPage)
void
processDocumentMetaData(DocumentContext documentContext)
protected abstract void
processPageContent(LogicalPageKey logicalPageKey, LogicalPageBox logicalPage)
protected void
processingContentFinished()
void
processingFinished()
Notifies the output processor, that the processing has been finished and that the input-feed received the last event.
protected void
processingGlobalContentFinished()
protected void
processingPagesFinished()
void
setPageCursor(int pageCursor)

Field Details

PROCESSING_CONTENT

protected static final int PROCESSING_CONTENT
Field Value:
2

PROCESSING_GLOBAL_CONTENT

protected static final int PROCESSING_GLOBAL_CONTENT
Field Value:
0

PROCESSING_PAGES

protected static final int PROCESSING_PAGES
Field Value:
1

Constructor Details

AbstractOutputProcessor

public AbstractOutputProcessor(Configuration configuration)

Method Details

createInputFeed

public InputFeed createInputFeed(LayoutProcess layoutProcess)
Specified by:
createInputFeed in interface OutputProcessor

createLogicalPage

protected LogicalPageKey createLogicalPage(int width,
                                           int height)

createModelBuilder

public ModelBuilder createModelBuilder(LayoutProcess layoutProcess)
The model builder normalizes the input and builds the Display-Model. The DisplayModel enriches and normalizes the logical document model so that it is better suited for rendering.
Specified by:
createModelBuilder in interface OutputProcessor
Returns:

createNormalizer

public Normalizer createNormalizer(LayoutProcess layoutProcess)
Returns the content normalizer implementation for this OP. The content normalizer is responsible for resolving the styles and for initiating the DOM building.
Specified by:
createNormalizer in interface OutputProcessor
Returns:

getConfiguration

public Configuration getConfiguration()
Specified by:
getConfiguration in interface OutputProcessor

getDocumentContext

public DocumentContext getDocumentContext()

getLogicalPage

public LogicalPageKey getLogicalPage(int page)
Specified by:
getLogicalPage in interface OutputProcessor

getLogicalPageCount

public int getLogicalPageCount()
Specified by:
getLogicalPageCount in interface OutputProcessor

getPageCursor

public int getPageCursor()
Specified by:
getPageCursor in interface OutputProcessor

getProcessingState

protected int getProcessingState()

isContentGeneratable

public boolean isContentGeneratable()
This flag indicates, whether the output processor has collected enough information to start the content generation.
Specified by:
isContentGeneratable in interface OutputProcessor
Returns:

isGlobalStateComputed

public boolean isGlobalStateComputed()
This flag indicates, whether the global content has been computed. Global content consists of global counters (except the pages counter) and derived information like table of contents, the global directory of images or tables etc.

The global state must be computed before paginating can be attempted (if the output target is paginating at all).

Specified by:
isGlobalStateComputed in interface OutputProcessor
Returns:
true, if the global state has been computed, false otherwise.

isPaginationFinished

public boolean isPaginationFinished()
Checks, whether the 'processingFinished' event had been received at least once.
Specified by:
isPaginationFinished in interface OutputProcessor
Returns:

processContent

public final void processContent(LogicalPageBox logicalPage)
Specified by:
processContent in interface OutputProcessor

processDocumentMetaData

public void processDocumentMetaData(DocumentContext documentContext)
Specified by:
processDocumentMetaData in interface OutputProcessor

processPageContent

protected abstract void processPageContent(LogicalPageKey logicalPageKey,
                                           LogicalPageBox logicalPage)

processingContentFinished

protected void processingContentFinished()

processingFinished

public void processingFinished()
Notifies the output processor, that the processing has been finished and that the input-feed received the last event.
Specified by:
processingFinished in interface OutputProcessor

processingGlobalContentFinished

protected void processingGlobalContentFinished()

processingPagesFinished

protected void processingPagesFinished()

setPageCursor

public void setPageCursor(int pageCursor)
Specified by:
setPageCursor in interface OutputProcessor