public interface IRenderer extends IPropertyContainer
Image
for its ImageRenderer
.
Renderers are designed to be extensible, and custom implementations can be
seeded to layout objects (or their custom subclasses) at runtime.Modifier and Type | Method and Description |
---|---|
void |
addChild(IRenderer renderer)
Adds a child to the current renderer
|
void |
draw(DrawContext drawContext)
Flushes the renderer subtree contents, i.e.
|
List<IRenderer> |
getChildRenderers()
Gets the child
IRenderer s. |
IPropertyContainer |
getModelElement()
Gets the model element associated with this renderer.
|
IRenderer |
getNextRenderer()
Gets a new instance of this class to be used as a next renderer, after this renderer is used, if
layout(LayoutContext) is called more than once. |
LayoutArea |
getOccupiedArea()
Gets the resultant occupied area after the last call to the
layout(LayoutContext) method. |
IRenderer |
getParent()
Gets the parent
IRenderer . |
<T1> T1 |
getProperty(int property,
T1 defaultValue)
Gets a property from this entity or one of its hierarchical parents.
|
boolean |
isFlushed()
Indicates whether this renderer is flushed or not, i.e.
|
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 dx,
float dy)
Moves the renderer subtree by the specified offset.
|
IRenderer |
setParent(IRenderer parent)
Explicitly sets this object as the child of another
IRenderer in
the renderer hierarchy. |
deleteOwnProperty, getDefaultProperty, getOwnProperty, getProperty, hasOwnProperty, hasProperty, setProperty
void addChild(IRenderer renderer)
renderer
- a child to be addedLayoutResult layout(LayoutContext layoutContext)
LayoutResult
, 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 draw(DrawContext)
, to prepare the renderer to be flushed to the output stream.layoutContext
- the description of layout area and any other additional informationvoid draw(DrawContext drawContext)
PdfDocument
etc.drawContext
- 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 drawingLayoutArea getOccupiedArea()
layout(LayoutContext)
method.LayoutArea
instance<T1> T1 getProperty(int property, T1 defaultValue)
defaultValue
will be returned.T1
- the return type associated with the propertyproperty
- the property to be retrieveddefaultValue
- a fallback valueIRenderer setParent(IRenderer parent)
IRenderer
in
the renderer hierarchy. Some implementations also use this method
internally to create a consistent hierarchy tree.parent
- the object to place higher in the renderer hierarchyIRenderer getParent()
IRenderer
.renderer
of this instanceIPropertyContainer getModelElement()
container of properties
List<IRenderer> getChildRenderers()
IRenderer
s.renderers
of this instanceboolean isFlushed()
draw(DrawContext)
has already
been called.void move(float dx, float dy)
dx
- the x-axis offset in points. Positive value will move the renderer subtree to the right.dy
- the y-axis offset in points. Positive value will move the renderer subtree to the top.IRenderer getNextRenderer()
layout(LayoutContext)
is called more than once.Copyright © 1998–2017 iText Group NV. All rights reserved.