private class AbstractReportBuilder.ReportDirector
extends java.lang.Object
implements java.util.function.Consumer<TRowObject>
Modifier and Type | Field and Description |
---|---|
(package private) AbstractReportBuilder.DefaultCellRenderer |
cellRenderer
The cell renderer.
|
(package private) AbstractReportBuilder.DefaultColumnHeaderRenderer |
columnHeaderRenderer
The column header renderer.
|
(package private) java.util.List<AbstractReportBuilder.ColumnInfo<TRowObject>> |
columns
The columns.
|
(package private) int |
currentPageIndex
zero based index
|
(package private) TFooterObject |
footer
The footer.
|
(package private) THeaderObject |
header
The header.
|
(package private) java.util.LinkedHashMap<java.lang.Integer,AbstractReportBuilder.IPageCanvas> |
linkedPages
The linked pages.
|
(package private) boolean |
previewOrSelfPrintedMode
The preview or self printed mode.
|
(package private) boolean |
requiredToRefreshDoc
The required to refresh doc.
|
(package private) boolean |
selfPrinted
The self printed.
|
Constructor and Description |
---|
ReportDirector(java.lang.String documentTitle,
PdfReportBuilder.PdfReportSettings parameters,
boolean previewMode,
boolean selfPrinted)
Instantiates a new report director.
|
Modifier and Type | Method and Description |
---|---|
void |
accept(TRowObject t) |
(package private) AbstractReportBuilder.IPageCanvas |
addNewPage()
Adds the new page.
|
private AbstractReportBuilder.IPageCanvas |
buildHeaderAndFooterTemplate(AbstractReportBuilder.IPageCanvas canvas)
Builds the header and footer template.
|
java.util.function.Consumer<TRowObject> |
columnWidthAccumulator()
Column width accumulator.
|
void |
createReport(THeaderObject header,
TFooterObject footer)
Creates the report.
|
(package private) void |
drawFinalSection()
Draw final section.
|
(package private) void |
drawReportFooter(TFooterObject footer,
AbstractReportBuilder.IPageCanvas canvas)
Draw report footer.
|
(package private) void |
drawReportHeader(THeaderObject header,
AbstractReportBuilder.IPageCanvas canvas)
Draw report header.
|
(package private) void |
drawTableHeader(AbstractReportBuilder.IPageCanvas canvas)
Draw table header.
|
(package private) void |
drawTableRow(TRowObject t,
AbstractReportBuilder.IPageCanvas canvas)
Draw table row.
|
void |
fixColumns(AbstractReportBuilder.IPageCanvas canvas)
Fix columns.
|
(package private) AbstractReportBuilder.IPageCanvas |
getFirstAvailablePageForRow(TRowObject t)
Gets the first available page for the given row.
|
(package private) AbstractReportBuilder.IPageCanvas |
getFirstAvailablePageForSection(AbstractReportBuilder.SectionRenderer<TRowObject> r)
Gets the first available page for the given section.
|
(package private) AbstractReportBuilder.IPageCanvas |
getNextPage(TRowObject t,
AbstractReportBuilder.IPageCanvas c,
AbstractReportBuilder.ColumnInfo<?> columnInfo)
Gets the next page.
|
(package private) boolean |
isColumnTextFittedThisPage(float stringWidth,
float fontSize,
float x,
float y,
float widthLimit,
float heightLimit)
Checks if the column text is fitted this page.
|
private void |
splitDocAndReleaseResources()
Split doc and release resources.
|
java.util.List<AbstractReportBuilder.ColumnInfo<TRowObject>> columns
java.util.LinkedHashMap<java.lang.Integer,AbstractReportBuilder.IPageCanvas> linkedPages
AbstractReportBuilder.DefaultColumnHeaderRenderer columnHeaderRenderer
AbstractReportBuilder.DefaultCellRenderer cellRenderer
THeaderObject extends AbstractReportBuilder.Header header
TFooterObject extends AbstractReportBuilder.Footer footer
boolean requiredToRefreshDoc
boolean previewOrSelfPrintedMode
boolean selfPrinted
int currentPageIndex
public ReportDirector(java.lang.String documentTitle, PdfReportBuilder.PdfReportSettings parameters, boolean previewMode, boolean selfPrinted)
documentTitle
- The document titleparameters
- The parameterspreviewMode
- The preview modeselfPrinted
- The self printedpublic void fixColumns(AbstractReportBuilder.IPageCanvas canvas)
canvas
- The canvaspublic void createReport(THeaderObject header, TFooterObject footer)
header
- The headerfooter
- The footerprivate AbstractReportBuilder.IPageCanvas buildHeaderAndFooterTemplate(AbstractReportBuilder.IPageCanvas canvas) throws java.io.IOException
canvas
- The canvasjava.io.IOException
- The IO exception if there is a failed output operationpublic java.util.function.Consumer<TRowObject> columnWidthAccumulator()
public void accept(TRowObject t)
accept
in interface java.util.function.Consumer<TRowObject>
Consumer.accept(java.lang.Object)
void drawFinalSection() throws java.io.IOException
java.io.IOException
- The IO exception if there is a failed output operationvoid drawTableRow(TRowObject t, AbstractReportBuilder.IPageCanvas canvas) throws java.io.IOException
t
- The rowcanvas
- The canvasjava.io.IOException
- The IO exception if there is a failed output operationvoid drawReportHeader(THeaderObject header, AbstractReportBuilder.IPageCanvas canvas) throws java.io.IOException
header
- The headercanvas
- The canvasjava.io.IOException
- The IO exception if there is a failed output operationvoid drawTableHeader(AbstractReportBuilder.IPageCanvas canvas) throws java.io.IOException
canvas
- The canvasjava.io.IOException
- The IO exception if there is a failed output operationvoid drawReportFooter(TFooterObject footer, AbstractReportBuilder.IPageCanvas canvas) throws java.io.IOException
footer
- The footercanvas
- The canvasjava.io.IOException
- The IO exception if there is a failed output operationboolean isColumnTextFittedThisPage(float stringWidth, float fontSize, float x, float y, float widthLimit, float heightLimit)
stringWidth
- The width of the target column textfontSize
- The font sizex
- The x-axis coordinate of the most left text positiony
- The y-axis coordinate of the most left text positionwidthLimit
- The width limitheightLimit
- The height limitAbstractReportBuilder.IPageCanvas getFirstAvailablePageForSection(AbstractReportBuilder.SectionRenderer<TRowObject> r) throws java.io.IOException
r
- The given section represented by the section rendererjava.io.IOException
- The IO exception if there is a failed output operationAbstractReportBuilder.IPageCanvas getFirstAvailablePageForRow(TRowObject t) throws java.io.IOException
t
- The given rowjava.io.IOException
- The IO exception if there is a failed output operationAbstractReportBuilder.IPageCanvas getNextPage(TRowObject t, AbstractReportBuilder.IPageCanvas c, AbstractReportBuilder.ColumnInfo<?> columnInfo) throws java.io.IOException
t
- The given rowc
- The current page canvascolumnInfo
- The current column infojava.io.IOException
- The IO exception if there is a failed output operationAbstractReportBuilder.IPageCanvas addNewPage() throws java.io.IOException
java.io.IOException
- The IO exception if there is a failed output operationprivate void splitDocAndReleaseResources() throws java.io.IOException
java.io.IOException
- The IO exception if there is a failed output operation