Class CellRenderer

    • Constructor Detail

      • CellRenderer

        public CellRenderer​(Cell modelElement)
        Creates a CellRenderer from its corresponding layout object.
        Parameters:
        modelElement - the Cell which this object should manage
    • Method Detail

      • drawBorder

        public void drawBorder​(DrawContext drawContext)
        Performs the drawing operation for the border of this renderer, if defined by any of the Property.BORDER values in either the layout element or this IRenderer itself.
        Overrides:
        drawBorder in class AbstractRenderer
        Parameters:
        drawContext - the context (canvas, document, etc) of this drawing operation.
      • applyBorderBox

        protected Rectangle applyBorderBox​(Rectangle rect,
                                           Border[] borders,
                                           boolean reverse)
        Description copied from class: AbstractRenderer
        Applies the given border box (borders) on the given rectangle
        Overrides:
        applyBorderBox in class AbstractRenderer
        Parameters:
        rect - a rectangle paddings will be applied on.
        borders - the borders to be applied on the given rectangle
        reverse - indicates whether the border box will be applied inside (in case of false) or outside (in case of false) the rectangle.
        Returns:
        a border box of the renderer
      • applyMargins

        protected Rectangle applyMargins​(Rectangle rect,
                                         UnitValue[] margins,
                                         boolean reverse)
        Description copied from class: AbstractRenderer
        Applies given margins on the given rectangle
        Overrides:
        applyMargins in class AbstractRenderer
        Parameters:
        rect - a rectangle margins will be applied on.
        margins - the margins to be applied on the given rectangle
        reverse - indicates whether margins will be applied inside (in case of false) or outside (in case of true) the rectangle.
        Returns:
        a border box of the renderer
      • applySpacings

        protected Rectangle applySpacings​(Rectangle rect,
                                          boolean reverse)
        Applies spacings on the given rectangle.
        Parameters:
        rect - a rectangle spacings will be applied on
        reverse - indicates whether spacings will be applied inside (in case of false) or outside (in case of true) the rectangle.
        Returns:
        a border box of the renderer
      • applySpacings

        protected Rectangle applySpacings​(Rectangle rect,
                                          float[] spacings,
                                          boolean reverse)
        Applies given spacings on the given rectangle.
        Parameters:
        rect - a rectangle spacings will be applied on
        spacings - the spacings to be applied on the given rectangle
        reverse - indicates whether spacings will be applied inside (in case of false) or outside (in case of true) the rectangle.
        Returns:
        a border box of the renderer
      • getNextRenderer

        public IRenderer getNextRenderer()
        Gets a new instance of this class to be used as a next renderer, after this renderer is used, if BlockRenderer.layout(LayoutContext) is called more than once.

        If a renderer overflows to the next area, iText uses this method to create a renderer for the overflow part. So if one wants to extend CellRenderer, one should override this method: otherwise the default method will be used and thus the default rather than the custom renderer will be created.

        Returns:
        new renderer instance