Package com.itextpdf.layout.renderer
Class AreaBreakRenderer
- java.lang.Object
-
- com.itextpdf.layout.renderer.AreaBreakRenderer
-
- All Implemented Interfaces:
IPropertyContainer,IRenderer
public class AreaBreakRenderer extends java.lang.Object implements IRenderer
Renderer for theAreaBreaklayout element. Will terminate the current content area and initialize a new one.
-
-
Constructor Summary
Constructors Constructor Description AreaBreakRenderer(AreaBreak areaBreak)Creates an AreaBreakRenderer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddChild(IRenderer renderer)Throws an UnsupportedOperationException because instances of this class are only used for terminating the current content area.voiddeleteOwnProperty(int property)Deletes the own property of this entity.voiddraw(DrawContext drawContext)Throws an UnsupportedOperationException because instances of this class are only used for terminating the current content area.java.util.List<IRenderer>getChildRenderers()Gets the childIRenderers.<T1> T1getDefaultProperty(int property)Gets the default property from this entity.IPropertyContainergetModelElement()Gets the model element associated with this renderer.IRenderergetNextRenderer()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.LayoutAreagetOccupiedArea()Throws an UnsupportedOperationException because instances of this class are only used for terminating the current content area.<T1> T1getOwnProperty(int property)Gets own property from this entity.IRenderergetParent()Gets the parentIRenderer.<T1> T1getProperty(int key)Gets the property from this entity.<T1> T1getProperty(int property, T1 defaultValue)Throws an UnsupportedOperationException because instances of this class are only used for terminating the current content area.booleanhasOwnProperty(int property)Checks if this entity has the specified property, i.e.booleanhasProperty(int property)Checks if this entity has the specified property.booleanisFlushed()Indicates whether this renderer is flushed or not, i.e.LayoutResultlayout(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.voidmove(float dx, float dy)Throws an UnsupportedOperationException because instances of this class are only used for terminating the current content area.IRenderersetParent(IRenderer parent)Explicitly sets this object as the child of anotherIRendererin the renderer hierarchy.voidsetProperty(int property, java.lang.Object value)Throws an UnsupportedOperationException because instances of this class are only used for terminating the current content area.
-
-
-
Field Detail
-
areaBreak
protected AreaBreak areaBreak
-
-
Method Detail
-
addChild
public void addChild(IRenderer renderer)
Throws an UnsupportedOperationException because instances of this class are only used for terminating the current content area.
-
layout
public LayoutResult layout(LayoutContext layoutContext)
Description copied from interface:IRendererThis 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.LayoutResultcan be extended to return custom layout results for custom elements, e.g.TextRendererusesTextLayoutResultas 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
public void draw(DrawContext drawContext)
Throws an UnsupportedOperationException because instances of this class are only used for terminating the current content area.- Specified by:
drawin interfaceIRenderer- Parameters:
drawContext- contains thePdfDocumentto which the renderer subtree if flushed, thePdfCanvason which the renderer subtree is drawn and other additional parameters needed to perform drawing
-
getOccupiedArea
public LayoutArea getOccupiedArea()
Throws an UnsupportedOperationException because instances of this class are only used for terminating the current content area.- Specified by:
getOccupiedAreain interfaceIRenderer- Returns:
LayoutAreainstance
-
hasProperty
public boolean hasProperty(int property)
Description copied from interface:IPropertyContainerChecks 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:
hasPropertyin interfaceIPropertyContainer- Parameters:
property- the property to be checked- Returns:
trueif this instance has given property,falseotherwise
-
hasOwnProperty
public boolean hasOwnProperty(int property)
Description copied from interface:IPropertyContainerChecks if this entity has the specified property, i.e. if it was set to this very element earlier- Specified by:
hasOwnPropertyin interfaceIPropertyContainer- Parameters:
property- the property to be checked- Returns:
trueif this instance has given own property,falseotherwise
-
getProperty
public <T1> T1 getProperty(int key)
Description copied from interface:IPropertyContainerGets 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:
getPropertyin 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.
nullwill be returned if the property value was not found
-
getOwnProperty
public <T1> T1 getOwnProperty(int property)
Description copied from interface:IPropertyContainerGets own property from this entity. The property must have been set earlier to this entity. If the property is not found,nullwill be returned.- Specified by:
getOwnPropertyin 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.
nullwill be returned if the property value was not found
-
getDefaultProperty
public <T1> T1 getDefaultProperty(int property)
Description copied from interface:IPropertyContainerGets the default property from this entity.- Specified by:
getDefaultPropertyin 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,
nullwill be returned
-
getProperty
public <T1> T1 getProperty(int property, T1 defaultValue)Throws an UnsupportedOperationException because instances of this class are only used for terminating the current content area.- Specified by:
getPropertyin interfaceIRenderer- Type Parameters:
T1- the return type associated with the property- Parameters:
property- the property to be retrieveddefaultValue- a fallback value- Returns:
- the value of the given property
-
setProperty
public void setProperty(int property, java.lang.Object value)Throws an UnsupportedOperationException because instances of this class are only used for terminating the current content area.- Specified by:
setPropertyin interfaceIPropertyContainer- Parameters:
property- the property to be setvalue- the value of the property
-
deleteOwnProperty
public void deleteOwnProperty(int property)
Description copied from interface:IPropertyContainerDeletes the own property of this entity.- Specified by:
deleteOwnPropertyin interfaceIPropertyContainer- Parameters:
property- the property to be deleted
-
setParent
public IRenderer setParent(IRenderer parent)
Description copied from interface:IRendererExplicitly sets this object as the child of anotherIRendererin the renderer hierarchy. Some implementations also use this method internally to create a consistent hierarchy tree.
-
getModelElement
public IPropertyContainer getModelElement()
Description copied from interface:IRendererGets the model element associated with this renderer.- Specified by:
getModelElementin interfaceIRenderer- Returns:
- the model element, as a
container of properties
-
getParent
public IRenderer getParent()
Description copied from interface:IRendererGets the parentIRenderer.
-
getChildRenderers
public java.util.List<IRenderer> getChildRenderers()
Description copied from interface:IRendererGets the childIRenderers.- Specified by:
getChildRenderersin interfaceIRenderer- Returns:
- a list of direct child
renderersof this instance
-
isFlushed
public boolean isFlushed()
Description copied from interface:IRendererIndicates 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
public IRenderer getNextRenderer()
Description copied from interface:IRendererGets 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:
getNextRendererin interfaceIRenderer- Returns:
- new renderer instance
-
-