Class RtfCell

java.lang.Object
com.lowagie.text.Rectangle
com.lowagie.text.TableRectangle
com.lowagie.text.Cell
com.lowagie.text.rtf.table.RtfCell
All Implemented Interfaces:
com.lowagie.text.alignment.WithHorizontalAlignment, com.lowagie.text.alignment.WithVerticalAlignment, com.lowagie.text.Element, RtfBasicElement, RtfExtendedElement, com.lowagie.text.TextElementArray

public class RtfCell extends com.lowagie.text.Cell implements RtfExtendedElement
The RtfCell wraps a Cell, but can also be added directly to a Table. The RtfCell is an extension of Cell, that supports a multitude of different borderstyles.
Version:
$Id: RtfCell.java 3580 2008-08-06 15:52:00Z howard_s $
Author:
Mark Hall (Mark.Hall@mail.room3b.eu), Steffen Stundzig, Benoit Wiart, Thomas Bickel (tmb99@inode.at)
See Also:
  • Field Summary

    Fields inherited from class com.lowagie.text.Cell

    arrayList, colspan, groupChange, header, horizontalAlignment, maxLines, percentage, rowspan, useAscender, useBorderPadding, useDescender, verticalAlignment, width

    Fields inherited from class com.lowagie.text.Rectangle

    border, borderColor, borderColorBottom, borderColorLeft, borderColorRight, borderColorTop, borderWidth, borderWidthBottom, borderWidthLeft, borderWidthRight, borderWidthTop, BOTTOM, BOX, LEFT, llx, lly, NO_BORDER, offsetToTop, RIGHT, rotation, TOP, UNDEFINED, urx, ury, useVariableBorders

    Fields inherited from interface com.lowagie.text.Element

    ALIGN_BASELINE, ALIGN_BOTTOM, ALIGN_CENTER, ALIGN_JUSTIFIED, ALIGN_JUSTIFIED_ALL, ALIGN_LEFT, ALIGN_MIDDLE, ALIGN_RIGHT, ALIGN_TOP, ALIGN_UNDEFINED, ANCHOR, ANNOTATION, AUTHOR, CCITT_BLACKIS1, CCITT_ENCODEDBYTEALIGN, CCITT_ENDOFBLOCK, CCITT_ENDOFLINE, CCITTG3_1D, CCITTG3_2D, CCITTG4, CELL, CHAPTER, CHUNK, CREATIONDATE, CREATOR, FOOTNOTE, HEADER, IMGRAW, IMGTEMPLATE, JBIG2, JPEG, JPEG2000, KEYWORDS, LIST, LISTITEM, MARKED, MODIFICATIONDATE, MULTI_COLUMN_TEXT, PARAGRAPH, PHRASE, PRODUCER, PTABLE, RECTANGLE, ROW, SECTION, SUBJECT, TABLE, TITLE, YMARK
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
     
    Constructs an empty RtfCell
    protected
    RtfCell(boolean deleted)
    Constructs a deleted RtfCell.
     
    RtfCell(com.lowagie.text.Element element)
    Constructs a RtfCell based upon an Element
    protected
    RtfCell(RtfDocument doc, RtfRow row, com.lowagie.text.Cell cell)
    Constructs a RtfCell based on a Cell.
    protected
    RtfCell(RtfDocument doc, RtfRow row, com.lowagie.text.pdf.PdfPCell cell)
    Constructs a RtfCell based on a Cell.
     
    RtfCell(String content)
    Constructs a RtfCell based upon a String
  • Method Summary

    Modifier and Type
    Method
    Description
    protected RtfBorderGroup
    Gets the borders of this RtfCell
    protected int
    Gets the cell padding of this RtfCell
    protected int
    Gets the right margin of this RtfCell
    protected int
    Gets the cell width of this RtfCell
    protected RtfColor
    Get the background color of this RtfCell
    boolean
    Checks whether this RtfCell is a placeholder for a table cell that has been removed due to col/row spanning.
    boolean
    Gets whether this RtfCell is in a header
    void
    Set the borders of this RtfCell
    protected void
    Merge this cell into the parent cell.
    protected void
    setCellRight(int cellRight)
    Sets the right margin of this cell.
    protected void
    setCellWidth(int cellWidth)
    Sets the cell width of this RtfCell.
    void
    setInHeader(boolean inHeader)
    Sets whether this RtfCell is in a header
    void
    setInTable(boolean inTable)
    Unused
    void
    Sets the RtfDocument this RtfCell belongs to
    void
    Write the content of this RtfCell
    void
    Write the cell definition part of this RtfCell

    Methods inherited from class com.lowagie.text.Cell

    add, addElement, bottom, clear, createPdfPCell, getBottom, getChunks, getColspan, getElements, getGroupChange, getHorizontalAlignment, getLeading, getLeft, getMaxLines, getRight, getRowspan, getShowTruncation, getTop, getVerticalAlignment, getWidth, getWidthAsString, isEmpty, isHeader, isTable, isUseAscender, isUseBorderPadding, isUseDescender, left, process, right, setBottom, setColspan, setGroupChange, setHeader, setHorizontalAlignment, setLeading, setLeft, setMaxLines, setRight, setRowspan, setShowTruncation, setTop, setUseAscender, setUseBorderPadding, setUseDescender, setVerticalAlignment, setWidth, setWidth, size, top, type

    Methods inherited from class com.lowagie.text.Rectangle

    cloneNonPositionParameters, disableBorderSide, enableBorderSide, getBackgroundColor, getBorder, getBorderColor, getBorderColorBottom, getBorderColorLeft, getBorderColorRight, getBorderColorTop, getBorderWidth, getBorderWidthBottom, getBorderWidthLeft, getBorderWidthRight, getBorderWidthTop, getBottom, getGrayFill, getHeight, getLeft, getRelativeTop, getRight, getRotation, getTop, hasBorder, hasBorders, isContent, isNestable, isUseVariableBorders, normalize, rectangle, rotate, setBackgroundColor, setBorder, setBorderColor, setBorderColorBottom, setBorderColorLeft, setBorderColorRight, setBorderColorTop, setBorderWidth, setBorderWidthBottom, setBorderWidthLeft, setBorderWidthRight, setBorderWidthTop, setBottom, setGrayFill, setLeft, setRelativeTop, setRight, setRotation, setTop, setUseVariableBorders, softCloneNonPositionParameters, toString

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface com.lowagie.text.Element

    isContent, isNestable, toString
  • Constructor Details

    • RtfCell

      public RtfCell()
      Constructs an empty RtfCell
    • RtfCell

      public RtfCell(String content)
      Constructs a RtfCell based upon a String
      Parameters:
      content - The String to base the RtfCell on
    • RtfCell

      public RtfCell(com.lowagie.text.Element element) throws com.lowagie.text.BadElementException
      Constructs a RtfCell based upon an Element
      Parameters:
      element - The Element to base the RtfCell on
      Throws:
      com.lowagie.text.BadElementException - If the Element is not valid
    • RtfCell

      protected RtfCell(boolean deleted)
      Constructs a deleted RtfCell.
      Parameters:
      deleted - Whether this RtfCell is actually deleted.
    • RtfCell

      protected RtfCell(RtfDocument doc, RtfRow row, com.lowagie.text.Cell cell)
      Constructs a RtfCell based on a Cell.
      Parameters:
      doc - The RtfDocument this RtfCell belongs to
      row - The RtfRow this RtfCell lies in
      cell - The Cell to base this RtfCell on
    • RtfCell

      protected RtfCell(RtfDocument doc, RtfRow row, com.lowagie.text.pdf.PdfPCell cell)
      Constructs a RtfCell based on a Cell.
      Parameters:
      doc - The RtfDocument this RtfCell belongs to
      row - The RtfRow this RtfCell lies in
      cell - The PdfPCell to base this RtfCell on
      Since:
      2.1.3
  • Method Details

    • writeDefinition

      public void writeDefinition(OutputStream result) throws IOException
      Write the cell definition part of this RtfCell
      Specified by:
      writeDefinition in interface RtfExtendedElement
      Parameters:
      result - The OutputStream to write the element definition to
      Throws:
      IOException
    • writeContent

      public void writeContent(OutputStream result) throws IOException
      Write the content of this RtfCell
      Specified by:
      writeContent in interface RtfBasicElement
      Parameters:
      result - The OutputStream to write the content to
      Throws:
      IOException
    • setCellRight

      protected void setCellRight(int cellRight)
      Sets the right margin of this cell. Used in merge operations
      Parameters:
      cellRight - The right margin to use
    • getCellRight

      protected int getCellRight()
      Gets the right margin of this RtfCell
      Returns:
      The right margin of this RtfCell.
    • setCellWidth

      protected void setCellWidth(int cellWidth)
      Sets the cell width of this RtfCell. Used in merge operations.
      Parameters:
      cellWidth - The cell width to use
    • getCellWidth

      protected int getCellWidth()
      Gets the cell width of this RtfCell
      Returns:
      The cell width of this RtfCell
    • getCellpadding

      protected int getCellpadding()
      Gets the cell padding of this RtfCell
      Returns:
      The cell padding of this RtfCell
    • getBorders

      protected RtfBorderGroup getBorders()
      Gets the borders of this RtfCell
      Returns:
      The borders of this RtfCell
    • setBorders

      public void setBorders(RtfBorderGroup borderGroup)
      Set the borders of this RtfCell
      Parameters:
      borderGroup - The RtfBorderGroup to use as borders
    • getRtfBackgroundColor

      protected RtfColor getRtfBackgroundColor()
      Get the background color of this RtfCell
      Returns:
      The background color of this RtfCell
    • setCellMergeChild

      protected void setCellMergeChild(RtfCell mergeParent)
      Merge this cell into the parent cell.
      Parameters:
      mergeParent - The RtfCell to merge with
    • setRtfDocument

      public void setRtfDocument(RtfDocument doc)
      Sets the RtfDocument this RtfCell belongs to
      Specified by:
      setRtfDocument in interface RtfBasicElement
      Parameters:
      doc - The RtfDocument to use
    • setInTable

      public void setInTable(boolean inTable)
      Unused
      Specified by:
      setInTable in interface RtfBasicElement
      Parameters:
      inTable -
    • setInHeader

      public void setInHeader(boolean inHeader)
      Sets whether this RtfCell is in a header
      Specified by:
      setInHeader in interface RtfBasicElement
      Parameters:
      inHeader - True if this RtfCell is in a header, false otherwise
    • isInHeader

      public boolean isInHeader()
      Gets whether this RtfCell is in a header
      Returns:
      True if this RtfCell is in a header, false otherwise
      Since:
      2.1.0
    • isDeleted

      public boolean isDeleted()
      Checks whether this RtfCell is a placeholder for a table cell that has been removed due to col/row spanning.
      Returns:
      True if this RtfCell is deleted, false otherwise.