Package com.itextpdf.layout.renderer
Class AreaBreakRenderer
java.lang.Object
com.itextpdf.layout.renderer.AreaBreakRenderer
- All Implemented Interfaces:
-
IPropertyContainer
,IRenderer
Renderer for the
AreaBreak
layout element. Will terminate the current content area and initialize a new one.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Throws an UnsupportedOperationException because instances of this class are only used for terminating the current content area.void
deleteOwnProperty
(int property) Deletes the own property of this entity.void
draw
(DrawContext drawContext) Throws an UnsupportedOperationException because instances of this class are only used for terminating the current content area.Gets the childIRenderer
s.T1 getDefaultProperty
(int property) Gets the default property from this entity.Gets the model element associated with this renderer.Gets a new instance of this class to be used as a next renderer, after this renderer is used, ifIRenderer.layout(LayoutContext)
is called more than once.Throws an UnsupportedOperationException because instances of this class are only used for terminating the current content area.T1 getOwnProperty
(int property) Gets own property from this entity.Gets the parentIRenderer
.T1 getProperty
(int key) Gets the property from this entity.T1 getProperty
(int property, T1 defaultValue) Throws an UnsupportedOperationException because instances of this class are only used for terminating the current content area.boolean
hasOwnProperty
(int property) Checks if this entity has the specified property, i.e.boolean
hasProperty
(int property) Checks if this entity has the specified property.boolean
Indicates whether this renderer is flushed or not, i.e.layout
(LayoutContext layoutContext) This method simulates positioning of the renderer, including all of its children, and returns theLayoutResult
, representing the layout result, including occupied area, status, i.e.void
move
(float dx, float dy) Throws an UnsupportedOperationException because instances of this class are only used for terminating the current content area.Explicitly sets this object as the child of anotherIRenderer
in the renderer hierarchy.void
setProperty
(int property, Object value) Throws an UnsupportedOperationException because instances of this class are only used for terminating the current content area.
-
Field Details
-
areaBreak
-
-
Constructor Details
-
AreaBreakRenderer
Creates an AreaBreakRenderer.- Parameters:
-
areaBreak
- theAreaBreak
that will be rendered by this object
-
-
Method Details
-
addChild
Throws an UnsupportedOperationException because instances of this class are only used for terminating the current content area. -
layout
Description copied from interface:IRenderer
This method simulates positioning of the renderer, including all of its children, and returns theLayoutResult
, 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
usesTextLayoutResult
as its result. This method can be called standalone to learn how much area the renderer subtree needs, or can be called beforeIRenderer.draw(DrawContext)
, to prepare the renderer to be flushed to the output stream. -
draw
Throws an UnsupportedOperationException because instances of this class are only used for terminating the current content area.- Specified by:
-
draw
in interfaceIRenderer
- Parameters:
-
drawContext
- contains thePdfDocument
to which the renderer subtree if flushed, thePdfCanvas
on which the renderer subtree is drawn and other additional parameters needed to perform drawing
-
getOccupiedArea
Throws an UnsupportedOperationException because instances of this class are only used for terminating the current content area.- Specified by:
-
getOccupiedArea
in interfaceIRenderer
- Returns:
-
LayoutArea
instance
-
hasProperty
public boolean hasProperty(int property) Description copied from interface:IPropertyContainer
Checks if this entity has the specified property. Compared toIPropertyContainer.hasOwnProperty(int)
, this method can check parent's properties, styles, etc, depending on the origin of the instance- Specified by:
-
hasProperty
in interfaceIPropertyContainer
- Parameters:
-
property
- the property to be checked - Returns:
-
true
if this instance has given property,false
otherwise
-
hasOwnProperty
public boolean hasOwnProperty(int property) Description copied from interface:IPropertyContainer
Checks if this entity has the specified property, i.e. if it was set to this very element earlier- Specified by:
-
hasOwnProperty
in interfaceIPropertyContainer
- Parameters:
-
property
- the property to be checked - Returns:
-
true
if this instance has given own property,false
otherwise
-
getProperty
publicT1 getProperty (int key) Description copied from interface:IPropertyContainer
Gets the property from this entity. Compared toIPropertyContainer.getOwnProperty(int)
, this method can check parent's properties, styles, etc, depending on the origin of the instance- Specified by:
-
getProperty
in interfaceIPropertyContainer
- Type Parameters:
-
T1
- the return type associated with the property - Parameters:
-
key
- the property to be retrieved - Returns:
-
the value of the given property.
null
will be returned if the property value was not found
-
getOwnProperty
publicT1 getOwnProperty (int property) Description copied from interface:IPropertyContainer
Gets own property from this entity. The property must have been set earlier to this entity. If the property is not found,null
will be returned.- Specified by:
-
getOwnProperty
in interfaceIPropertyContainer
- Type Parameters:
-
T1
- the return type associated with the property - Parameters:
-
property
- the property to be retrieved - Returns:
-
the value of the given own property.
null
will be returned if the property value was not found
-
getDefaultProperty
publicT1 getDefaultProperty (int property) Description copied from interface:IPropertyContainer
Gets the default property from this entity.- Specified by:
-
getDefaultProperty
in interfaceIPropertyContainer
- Type Parameters:
-
T1
- the return type associated with the property - Parameters:
-
property
- the property to be retrieved - Returns:
-
the default property value. If the default property is not defined,
null
will be returned
-
getProperty
publicT1 getProperty (int property, T1 defaultValue) Throws an UnsupportedOperationException because instances of this class are only used for terminating the current content area.- Specified by:
-
getProperty
in interfaceIRenderer
- Type Parameters:
-
T1
- the return type associated with the property - Parameters:
-
property
- the property to be retrieved -
defaultValue
- a fallback value - Returns:
- the value of the given property
-
setProperty
Throws an UnsupportedOperationException because instances of this class are only used for terminating the current content area.- Specified by:
-
setProperty
in interfaceIPropertyContainer
- Parameters:
-
property
- the property to be set -
value
- the value of the property
-
deleteOwnProperty
public void deleteOwnProperty(int property) Description copied from interface:IPropertyContainer
Deletes the own property of this entity.- Specified by:
-
deleteOwnProperty
in interfaceIPropertyContainer
- Parameters:
-
property
- the property to be deleted
-
setParent
Description copied from interface:IRenderer
Explicitly sets this object as the child of anotherIRenderer
in the renderer hierarchy. Some implementations also use this method internally to create a consistent hierarchy tree. -
getModelElement
Description copied from interface:IRenderer
Gets the model element associated with this renderer.- Specified by:
-
getModelElement
in interfaceIRenderer
- Returns:
-
the model element, as a
container of properties
-
getParent
Description copied from interface:IRenderer
Gets the parentIRenderer
. -
getChildRenderers
Description copied from interface:IRenderer
Gets the childIRenderer
s.- Specified by:
-
getChildRenderers
in interfaceIRenderer
- Returns:
-
a list of direct child
renderers
of this instance
-
isFlushed
public boolean isFlushed()Description copied from interface:IRenderer
Indicates whether this renderer is flushed or not, i.e. ifIRenderer.draw(DrawContext)
has already been called. -
move
public void move(float dx, float dy) Throws an UnsupportedOperationException because instances of this class are only used for terminating the current content area. -
getNextRenderer
Description copied from interface:IRenderer
Gets a new instance of this class to be used as a next renderer, after this renderer is used, ifIRenderer.layout(LayoutContext)
is called more than once.- Specified by:
-
getNextRenderer
in interfaceIRenderer
- Returns:
- new renderer instance
-