Class AreaBreakRenderer

  • All Implemented Interfaces:
    IPropertyContainer, IRenderer

    public class AreaBreakRenderer
    extends java.lang.Object
    implements IRenderer
    Renderer for the AreaBreak layout element. Will terminate the current content area and initialize a new one.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addChild​(IRenderer renderer)
      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.
      java.util.List<IRenderer> getChildRenderers()
      Gets the child IRenderers.
      <T1> T1 getDefaultProperty​(int property)
      Gets the default property from this entity.
      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 IRenderer.layout(LayoutContext) is called more than once.
      LayoutArea getOccupiedArea()
      Throws an UnsupportedOperationException because instances of this class are only used for terminating the current content area.
      <T1> T1 getOwnProperty​(int property)
      Gets own property from this entity.
      IRenderer getParent()
      Gets the parent IRenderer.
      <T1> T1 getProperty​(int key)
      Gets the property from this entity.
      <T1> 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 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)
      Throws an UnsupportedOperationException because instances of this class are only used for terminating the current content area.
      IRenderer setParent​(IRenderer parent)
      Explicitly sets this object as the child of another IRenderer in the renderer hierarchy.
      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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

    • Constructor Detail

      • AreaBreakRenderer

        public AreaBreakRenderer​(AreaBreak areaBreak)
        Creates an AreaBreakRenderer.
        Parameters:
        areaBreak - the AreaBreak that will be rendered by this object
    • 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.
        Specified by:
        addChild in interface IRenderer
        Parameters:
        renderer - a child to be added
      • layout

        public LayoutResult layout​(LayoutContext layoutContext)
        Description copied from interface: IRenderer
        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. 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.
        Specified by:
        layout in interface IRenderer
        Parameters:
        layoutContext - the description of layout area and any other additional information
        Returns:
        result of the layout process
      • 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:
        draw in interface IRenderer
        Parameters:
        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 drawing
      • getOccupiedArea

        public LayoutArea getOccupiedArea()
        Throws an UnsupportedOperationException because instances of this class are only used for terminating the current content area.
        Specified by:
        getOccupiedArea in interface IRenderer
        Returns:
        LayoutArea instance
      • hasProperty

        public boolean hasProperty​(int property)
        Description copied from interface: IPropertyContainer
        Checks if this entity has the specified property. Compared to IPropertyContainer.hasOwnProperty(int), this method can check parent's properties, styles, etc, depending on the origin of the instance
        Specified by:
        hasProperty in interface IPropertyContainer
        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 interface IPropertyContainer
        Parameters:
        property - the property to be checked
        Returns:
        true if this instance has given own property, false otherwise
      • getProperty

        public <T1> T1 getProperty​(int key)
        Description copied from interface: IPropertyContainer
        Gets the property from this entity. Compared to IPropertyContainer.getOwnProperty(int), this method can check parent's properties, styles, etc, depending on the origin of the instance
        Specified by:
        getProperty in interface IPropertyContainer
        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

        public <T1> T1 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 interface IPropertyContainer
        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

        public <T1> T1 getDefaultProperty​(int property)
        Description copied from interface: IPropertyContainer
        Gets the default property from this entity.
        Specified by:
        getDefaultProperty in interface IPropertyContainer
        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

        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:
        getProperty in interface IRenderer
        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

        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:
        setProperty in interface IPropertyContainer
        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 interface IPropertyContainer
        Parameters:
        property - the property to be deleted
      • setParent

        public IRenderer setParent​(IRenderer parent)
        Description copied from interface: IRenderer
        Explicitly sets this object as the child of another IRenderer in the renderer hierarchy. Some implementations also use this method internally to create a consistent hierarchy tree.
        Specified by:
        setParent in interface IRenderer
        Parameters:
        parent - the object to place higher in the renderer hierarchy
        Returns:
        by default, this object
      • isFlushed

        public boolean isFlushed()
        Description copied from interface: IRenderer
        Indicates whether this renderer is flushed or not, i.e. if IRenderer.draw(DrawContext) has already been called.
        Specified by:
        isFlushed in interface IRenderer
        Returns:
        whether the renderer has been flushed
      • 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.
        Specified by:
        move in interface IRenderer
        Parameters:
        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.