public class TableRenderer extends AbstractRenderer
renderer object for a Table
object. It will delegate its drawing operations on to the CellRenderer
instances associated with the table cells.| Modifier and Type | Field and Description |
|---|---|
protected TableRenderer |
footerRenderer |
protected TableRenderer |
headerRenderer |
protected boolean |
isOriginalNonSplitRenderer
True for newly created renderer.
|
protected Table.RowRange |
rowRange |
protected List<CellRenderer[]> |
rows |
childRenderers, EPS, flushed, INF, isLastRendererForModelElement, modelElement, occupiedArea, parent, positionedRenderers, properties| Constructor and Description |
|---|
TableRenderer(Table modelElement)
Creates a TableRenderer from a
Table. |
TableRenderer(Table modelElement,
Table.RowRange rowRange)
Creates a TableRenderer from a
Table which will partially render
the table. |
| Modifier and Type | Method and Description |
|---|---|
void |
addChild(IRenderer renderer)
Adds a child to the current renderer
|
protected float[] |
calculateScaledColumnWidths(Table tableModel,
float tableWidth) |
protected TableRenderer |
createOverflowRenderer(Table.RowRange rowRange) |
protected TableRenderer |
createSplitRenderer(Table.RowRange rowRange) |
void |
draw(DrawContext drawContext)
Flushes the renderer subtree contents, i.e.
|
protected void |
drawBorders(DrawContext drawContext) |
void |
drawChildren(DrawContext drawContext)
Performs the drawing operation for all
children
of this renderer. |
IRenderer |
getNextRenderer()
Gets a new instance of this class to be used as a next renderer, after this renderer is used, if
IRenderer.layout(LayoutContext) is called more than once. |
LayoutResult |
layout(LayoutContext layoutContext)
This method simulates positioning of the renderer, including all of its children, and returns
the
LayoutResult, representing the layout result, including occupied area, status, i.e. |
void |
move(float dxRight,
float dyUp)
Moves the renderer subtree by the specified offset.
|
protected TableRenderer[] |
split(int row) |
protected TableRenderer[] |
split(int row,
boolean hasContent) |
addAllProperties, alignChildHorizontally, applyAbsolutePositioningTranslation, applyAction, applyBorderBox, applyDestination, applyMargins, applyPaddings, deleteOwnProperty, deleteProperty, drawBackground, drawBorder, getBorderAreaBBox, getBorders, getChildRenderers, getDefaultProperty, getFirstYLineRecursively, getInnerAreaBBox, getModelElement, getOccupiedArea, getOccupiedAreaBBox, getOwnProperties, getOwnProperty, getProperty, getProperty, getPropertyAsBoolean, getPropertyAsColor, getPropertyAsFloat, getPropertyAsFont, getPropertyAsInteger, hasOwnProperty, hasProperty, initElementAreas, isFixedLayout, isFlushed, isNotFittingHeight, isPositioned, retrieveHeight, retrieveUnitValue, retrieveWidth, setBorders, setParent, setProperty, toStringprotected List<CellRenderer[]> rows
protected Table.RowRange rowRange
protected TableRenderer headerRenderer
protected TableRenderer footerRenderer
protected boolean isOriginalNonSplitRenderer
public TableRenderer(Table modelElement, Table.RowRange rowRange)
Table which will partially render
the table.modelElement - the table to be rendered by this rendererrowRange - the table rows to be renderedpublic void addChild(IRenderer renderer)
IRendereraddChild in interface IRendereraddChild in class AbstractRendererrenderer - a child to be addedpublic LayoutResult layout(LayoutContext layoutContext)
IRendererLayoutResult, representing the layout result, including occupied area, status, i.e.
if there was enough place to fit the renderer subtree, etc.
LayoutResult can be extended to return custom layout results for custom elements, e.g.
TextRenderer uses TextLayoutResult as its result.
This method can be called standalone to learn how much area the renderer subtree needs, or can be called
before IRenderer.draw(DrawContext), to prepare the renderer to be flushed to the output stream.layoutContext - the description of layout area and any other additional informationpublic void draw(DrawContext drawContext)
IRendererPdfDocument etc.draw in interface IRendererdraw in class AbstractRendererdrawContext - contains the PdfDocument to which the renderer subtree if flushed,
the PdfCanvas on which the renderer subtree is drawn and other additional parameters
needed to perform drawingpublic void drawChildren(DrawContext drawContext)
AbstractRendererchildren
of this renderer.drawChildren in class AbstractRendererdrawContext - the context (canvas, document, etc) of this drawing operation.public IRenderer getNextRenderer()
IRendererIRenderer.layout(LayoutContext) is called more than once.public void move(float dxRight,
float dyUp)
IRenderermove in interface IRenderermove in class AbstractRendererdxRight - the x-axis offset in points. Positive value will move the renderer subtree to the right.dyUp - the y-axis offset in points. Positive value will move the renderer subtree to the top.protected float[] calculateScaledColumnWidths(Table tableModel, float tableWidth)
protected TableRenderer[] split(int row)
protected TableRenderer[] split(int row, boolean hasContent)
protected TableRenderer createSplitRenderer(Table.RowRange rowRange)
protected TableRenderer createOverflowRenderer(Table.RowRange rowRange)
protected void drawBorders(DrawContext drawContext)
Copyright © 1998–2016 iText Group NV. All rights reserved.