Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.jfor.jfor.rtflib.rtfdoc
Class RtfExtraRowSet  view RtfExtraRowSet download RtfExtraRowSet.java

java.lang.Object
  extended byorg.jfor.jfor.rtflib.rtfdoc.RtfElement
      extended byorg.jfor.jfor.rtflib.rtfdoc.RtfContainer
          extended byorg.jfor.jfor.rtflib.rtfdoc.RtfExtraRowSet

public class RtfExtraRowSet
extends RtfContainer

Used to add extra table rows after a row that contains a nested table:

  • created by RtfTableRow before generating RTF code
  • an RtfTableCell that contains a nested table can ask this to put some of its children in extra rows that after the current row
  • once RtfTableRow is done rendering its children, it renders this, causing extra rows to be generated, with content that can come from several RtfTableCells


    Nested Class Summary
    private static class RtfExtraRowSet.PositionedCell
               
     
    Field Summary
    (package private)  int DEFAULT_IDNUM
               
    private  java.util.List m_cells
              While a top-level RtfTableRow is being rendered, we build a list of RtfTableCells that must be rendered in extra rows.
    private  int m_maxRowIndex
              our maximum row index
    private  org.jfor.jfor.interfaces.ITableColumnsInfo parentITableColumnsInfo
              Parent table context (added by Boris Poudérous on july 2002 in order to process nested tables)
     
    Fields inherited from class org.jfor.jfor.rtflib.rtfdoc.RtfContainer
     
    Fields inherited from class org.jfor.jfor.rtflib.rtfdoc.RtfElement
    m_attrib, m_parent, m_writer
     
    Constructor Summary
    (package private) RtfExtraRowSet(java.io.Writer w)
              an RtfExtraRowSet has no parent, it is only used temporary during generation of RTF for an RtfTableRow
     
    Method Summary
    private  void addRow(RtfTableRow row, int rowIndex, int xOffset)
              add all cells of given row to this set
    (package private)  int addTable(RtfTable tbl, int rowIndex, int xOffset)
              Add all cells of given Table to this set for later rendering in extra rows
    private static boolean allCellsEmpty(java.util.List cells)
              true if all cells of given list are empty
    (package private)  RtfTableCell createExtraCell(int rowIndex, int xOffset, int cellWidth, RtfAttributes parentCellAttributes)
              create an extra cell to hold content that comes after a nested table in a cell Modified by Boris Poudérous in order to permit the extra cell to have the attributes of its parent cell
     org.jfor.jfor.interfaces.ITableColumnsInfo getParentITableColumnsInfo()
               
     boolean isEmpty()
              As this contains cells from several rows, we say that it's empty only if we have no cells.
     void setParentITableColumnsInfo(org.jfor.jfor.interfaces.ITableColumnsInfo parentITableColumnsInfo)
               
    private  void writeRow(java.util.List cells)
              write one RtfTableRow containing given PositionedCells
    protected  void writeRtfContent()
              render extra RtfTableRows containing all the extra RtfTableCells that we contain
     
    Methods inherited from class org.jfor.jfor.rtflib.rtfdoc.RtfContainer
    addChild, containsText, dump, getChildCount, getChildren, getOptions, okToWriteRtf, setChildren, setOptions, toString
     
    Methods inherited from class org.jfor.jfor.rtflib.rtfdoc.RtfElement
    close, getParentOfClass, getRtfAttributes, getRtfFile, isClosed, writeAttributes, writeControlWord, writeControlWordNS, writeExceptionInRtf, writeGroupMark, writeOneAttribute, writeOneAttributeNS, writeRtf, writeRtfPrefix, writeRtfSuffix, writeStarControlWord, writeStarControlWordNS
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
     

    Field Detail

    DEFAULT_IDNUM

    final int DEFAULT_IDNUM
    See Also:
    Constant Field Values

    parentITableColumnsInfo

    private org.jfor.jfor.interfaces.ITableColumnsInfo parentITableColumnsInfo
    Parent table context (added by Boris Poudérous on july 2002 in order to process nested tables)


    m_cells

    private final java.util.List m_cells
    While a top-level RtfTableRow is being rendered, we build a list of RtfTableCells that must be rendered in extra rows. This holds a cell with positioning information


    m_maxRowIndex

    private int m_maxRowIndex
    our maximum row index

    Constructor Detail

    RtfExtraRowSet

    RtfExtraRowSet(java.io.Writer w)
             throws java.io.IOException
    an RtfExtraRowSet has no parent, it is only used temporary during generation of RTF for an RtfTableRow

    Method Detail

    addTable

    int addTable(RtfTable tbl,
                 int rowIndex,
                 int xOffset)
    Add all cells of given Table to this set for later rendering in extra rows


    addRow

    private void addRow(RtfTableRow row,
                        int rowIndex,
                        int xOffset)
    add all cells of given row to this set


    createExtraCell

    RtfTableCell createExtraCell(int rowIndex,
                                 int xOffset,
                                 int cellWidth,
                                 RtfAttributes parentCellAttributes)
                           throws java.io.IOException
    create an extra cell to hold content that comes after a nested table in a cell Modified by Boris Poudérous in order to permit the extra cell to have the attributes of its parent cell


    writeRtfContent

    protected void writeRtfContent()
                            throws java.io.IOException
    render extra RtfTableRows containing all the extra RtfTableCells that we contain

    Overrides:
    writeRtfContent in class RtfContainer

    writeRow

    private void writeRow(java.util.List cells)
                   throws java.io.IOException
    write one RtfTableRow containing given PositionedCells


    allCellsEmpty

    private static boolean allCellsEmpty(java.util.List cells)
    true if all cells of given list are empty


    isEmpty

    public boolean isEmpty()
    As this contains cells from several rows, we say that it's empty only if we have no cells. writeRow makes the decision about rendering specific rows

    Overrides:
    isEmpty in class RtfContainer

    getParentITableColumnsInfo

    public org.jfor.jfor.interfaces.ITableColumnsInfo getParentITableColumnsInfo()

    setParentITableColumnsInfo

    public void setParentITableColumnsInfo(org.jfor.jfor.interfaces.ITableColumnsInfo parentITableColumnsInfo)