Class SimpleCell

    • Field Detail

      • ROW

        public static final boolean ROW
        the CellAttributes object represents a row.
        See Also:
        Constant Field Values
      • CELL

        public static final boolean CELL
        the CellAttributes object represents a cell.
        See Also:
        Constant Field Values
      • useAscender

        protected boolean useAscender
        Indicates that the largest ascender height should be used to determine the height of the first line. Note that this only has an effect when rendered to PDF. Setting this to true can help with vertical alignment problems.
      • useDescender

        protected boolean useDescender
        Indicates that the largest descender height should be added to the height of the last line (so characters like y don't dip into the border). Note that this only has an effect when rendered to PDF.
      • useBorderPadding

        protected boolean useBorderPadding
        Adjusts the cell contents to compensate for border widths. Note that this only has an effect when rendered to PDF.
      • content

        private java.util.List<Element> content
        the content of the Cell.
      • width

        private float width
        the width of the Cell.
      • widthpercentage

        private float widthpercentage
        the widthpercentage of the Cell.
      • spacing_left

        private float spacing_left
        an extra spacing variable
      • spacing_right

        private float spacing_right
        an extra spacing variable
      • spacing_top

        private float spacing_top
        an extra spacing variable
      • spacing_bottom

        private float spacing_bottom
        an extra spacing variable
      • padding_left

        private float padding_left
        an extra padding variable
      • padding_right

        private float padding_right
        an extra padding variable
      • padding_top

        private float padding_top
        an extra padding variable
      • padding_bottom

        private float padding_bottom
        an extra padding variable
      • colspan

        private int colspan
        the colspan of a Cell
      • horizontalAlignment

        private int horizontalAlignment
        horizontal alignment inside the Cell.
      • verticalAlignment

        private int verticalAlignment
        vertical alignment inside the Cell.
      • cellgroup

        private boolean cellgroup
        indicates if these are the attributes of a single Cell (false) or a group of Cells (true).
    • Constructor Detail

      • SimpleCell

        public SimpleCell​(boolean row)
        A CellAttributes object is always constructed without any dimensions. Dimensions are defined after creation.
        Parameters:
        row - only true if the CellAttributes object represents a row.
    • Method Detail

      • createCell

        public Cell createCell​(SimpleCell rowAttributes)
                        throws BadElementException
        Creates a Cell with these attributes.
        Parameters:
        rowAttributes - an object of type SimpleCell whose attributes are to be used to create new cell
        Returns:
        a cell based on these attributes.
        Throws:
        BadElementException - on error
      • createPdfPCell

        public PdfPCell createPdfPCell​(SimpleCell rowAttributes)
        Creates a PdfPCell with these attributes.
        Parameters:
        rowAttributes - an object of type SimpleCell whose attributes are to be used to create new cell
        Returns:
        a PdfPCell based on these attributes.
      • cellLayout

        public void cellLayout​(PdfPCell cell,
                               Rectangle position,
                               PdfContentByte[] canvases)
        Description copied from interface: PdfPCellEvent
        This method is called at the end of the cell rendering. The text or graphics are added to one of the 4 PdfContentByte contained in canvases.
        The indexes to canvases are:
        • PdfPTable.BASECANVAS - the original PdfContentByte. Anything placed here will be under the cell.
        • PdfPTable.BACKGROUNDCANVAS - the layer where the background goes to.
        • PdfPTable.LINECANVAS - the layer where the lines go to.
        • PdfPTable.TEXTCANVAS - the layer where the text go to. Anything placed here will be over the cell.
        The layers are placed in sequence on top of each other.

        Specified by:
        cellLayout in interface PdfPCellEvent
        Parameters:
        cell - the cell
        position - the coordinates of the cell
        canvases - an array of PdfContentByte
        See Also:
        PdfPCellEvent.cellLayout(com.lowagie.text.pdf.PdfPCell, com.lowagie.text.Rectangle, com.lowagie.text.pdf.PdfContentByte[])
      • setPadding

        public void setPadding​(float padding)
        Sets the padding parameters if they are undefined.
        Parameters:
        padding - padding that will be set
      • getColspan

        public int getColspan()
        Returns:
        Returns the colspan.
      • setColspan

        public void setColspan​(int colspan)
        Parameters:
        colspan - The colspan to set.
      • getPadding_bottom

        public float getPadding_bottom()
        Returns:
        Returns the padding_bottom.
      • setPadding_bottom

        public void setPadding_bottom​(float padding_bottom)
        Parameters:
        padding_bottom - The padding_bottom to set.
      • getPadding_left

        public float getPadding_left()
        Returns:
        Returns the padding_left.
      • setPadding_left

        public void setPadding_left​(float padding_left)
        Parameters:
        padding_left - The padding_left to set.
      • getPadding_right

        public float getPadding_right()
        Returns:
        Returns the padding_right.
      • setPadding_right

        public void setPadding_right​(float padding_right)
        Parameters:
        padding_right - The padding_right to set.
      • getPadding_top

        public float getPadding_top()
        Returns:
        Returns the padding_top.
      • setPadding_top

        public void setPadding_top​(float padding_top)
        Parameters:
        padding_top - The padding_top to set.
      • getSpacing_left

        public float getSpacing_left()
        Returns:
        Returns the spacing.
      • setSpacing_left

        public void setSpacing_left​(float spacing)
        Parameters:
        spacing - The spacing to set.
      • getSpacing_right

        public float getSpacing_right()
        Returns:
        Returns the spacing.
      • setSpacing_right

        public void setSpacing_right​(float spacing)
        Parameters:
        spacing - The spacing to set.
      • getSpacing_top

        public float getSpacing_top()
        Returns:
        Returns the spacing.
      • setSpacing_top

        public void setSpacing_top​(float spacing)
        Parameters:
        spacing - The spacing to set.
      • getSpacing_bottom

        public float getSpacing_bottom()
        Returns:
        Returns the spacing.
      • setSpacing_bottom

        public void setSpacing_bottom​(float spacing)
        Parameters:
        spacing - The spacing to set.
      • setSpacing

        public void setSpacing​(float spacing)
        Parameters:
        spacing - The spacing to set.
      • isCellgroup

        public boolean isCellgroup()
        Returns:
        Returns the cellgroup.
      • setCellgroup

        public void setCellgroup​(boolean cellgroup)
        Parameters:
        cellgroup - The cellgroup to set.
      • getHorizontalAlignment

        public int getHorizontalAlignment()
        Returns:
        Returns the horizontal alignment.
      • setHorizontalAlignment

        public void setHorizontalAlignment​(int horizontalAlignment)
        Parameters:
        horizontalAlignment - The horizontalAlignment to set.
      • getVerticalAlignment

        public int getVerticalAlignment()
        Returns:
        Returns the vertical alignment.
      • setVerticalAlignment

        public void setVerticalAlignment​(int verticalAlignment)
        Parameters:
        verticalAlignment - The verticalAligment to set.
      • getWidth

        public float getWidth()
        Description copied from class: Rectangle
        Returns the width of the rectangle.
        Overrides:
        getWidth in class Rectangle
        Returns:
        Returns the width.
      • setWidth

        public void setWidth​(float width)
        Parameters:
        width - The width to set.
      • getWidthpercentage

        public float getWidthpercentage()
        Returns:
        Returns the widthpercentage.
      • setWidthpercentage

        public void setWidthpercentage​(float widthpercentage)
        Parameters:
        widthpercentage - The widthpercentage to set.
      • isUseAscender

        public boolean isUseAscender()
        Returns:
        Returns the useAscender.
      • setUseAscender

        public void setUseAscender​(boolean useAscender)
        Parameters:
        useAscender - The useAscender to set.
      • isUseBorderPadding

        public boolean isUseBorderPadding()
        Returns:
        Returns the useBorderPadding.
      • setUseBorderPadding

        public void setUseBorderPadding​(boolean useBorderPadding)
        Parameters:
        useBorderPadding - The useBorderPadding to set.
      • isUseDescender

        public boolean isUseDescender()
        Returns:
        Returns the useDescender.
      • setUseDescender

        public void setUseDescender​(boolean useDescender)
        Parameters:
        useDescender - The useDescender to set.
      • getContent

        java.util.List<Element> getContent()
        Returns:
        Returns the content.