class AbstractReportBuilder.DefaultCellRenderer extends java.lang.Object implements AbstractReportBuilder.CellValueRenderer<TRowObject>
Modifier and Type | Field and Description |
---|---|
private float |
currentRowHeight
The current row height.
|
private AbstractReportBuilder.ReportDirector |
reportDirector
The report director.
|
private int |
rowsNumber
The rows number.
|
Constructor and Description |
---|
DefaultCellRenderer(AbstractReportBuilder.ReportDirector reportDirector)
Instantiates a new default cell renderer.
|
Modifier and Type | Method and Description |
---|---|
float |
calculateCellHeight(TRowObject t,
AbstractReportBuilder.ColumnInfo<TRowObject> column)
Calculate an outer cell height including its margin and padding
|
int |
calculateRowsNumber(TRowObject t,
AbstractReportBuilder.ColumnInfo<TRowObject> column)
Calculate the number of rows in this cell.
|
private int |
getAvailableRows(float availableSpace)
Gets the available rows.
|
float |
getHeight()
Returns an outer row height including margin and padding.
|
int |
getRowsNumber()
Gets the rows number.
|
void |
render(TRowObject t,
AbstractReportBuilder.ColumnInfo<TRowObject> column,
AbstractReportBuilder.IPageCanvas canvas)
Draws the table cell for the given data row and column.
|
void |
setHeight(float currentRowHeight)
Sets the height.
|
void |
setRowsNumber(int rowsNumber)
Sets the rows number.
|
(package private) java.util.List<java.lang.String> |
wrapValue(AbstractReportBuilder.ColumnInfo<TRowObject> column,
java.lang.String value)
Wraps the given text into multiple lines of text to fit the column width.
|
private AbstractReportBuilder.ReportDirector reportDirector
private float currentRowHeight
private int rowsNumber
public DefaultCellRenderer(AbstractReportBuilder.ReportDirector reportDirector)
reportDirector
- The report directorpublic void render(TRowObject t, AbstractReportBuilder.ColumnInfo<TRowObject> column, AbstractReportBuilder.IPageCanvas canvas) throws java.io.IOException
render
in interface AbstractReportBuilder.CellValueRenderer<TRowObject>
t
- The data rowcolumn
- The column infocanvas
- The canvasjava.io.IOException
- The IO exception if there is a failed output operationAbstractReportBuilder.CellValueRenderer.render(java.lang.Object, com.goldencode.p2j.admin.server.reports.AbstractReportBuilder.ColumnInfo, com.goldencode.p2j.admin.server.reports.AbstractReportBuilder.IPageCanvas)
public void setHeight(float currentRowHeight)
currentRowHeight
- The heightpublic float getHeight()
getHeight
in interface AbstractReportBuilder.CellValueRenderer<TRowObject>
public int getRowsNumber()
public void setRowsNumber(int rowsNumber)
rowsNumber
- The rows numberjava.util.List<java.lang.String> wrapValue(AbstractReportBuilder.ColumnInfo<TRowObject> column, java.lang.String value) throws java.io.IOException
column
- The columnvalue
- The given textjava.io.IOException
- The IO exception if there is a failed output operationpublic float calculateCellHeight(TRowObject t, AbstractReportBuilder.ColumnInfo<TRowObject> column) throws java.io.IOException
t
- The row object that holds its valuescolumn
- The current columnjava.io.IOException
- The IO exception iff the IO operation is failed.public int calculateRowsNumber(TRowObject t, AbstractReportBuilder.ColumnInfo<TRowObject> column) throws java.io.IOException
t
- The row object that holds its valuescolumn
- The current columnjava.io.IOException
- The IO exception iff the IO operation is failed.private int getAvailableRows(float availableSpace)
availableSpace
- The available space