Class TableContentLayoutManager

java.lang.Object
org.apache.fop.layoutmgr.table.TableContentLayoutManager
All Implemented Interfaces:
PercentBaseContext

public class TableContentLayoutManager extends Object implements PercentBaseContext
Layout manager for table contents, particularly managing the creation of combined element lists.
  • Field Details

    • LOG

      private static final org.apache.commons.logging.Log LOG
      Logger
    • tableLM

      private TableLayoutManager tableLM
    • bodyIter

      protected TableRowIterator bodyIter
    • headerIter

      private TableRowIterator headerIter
    • footerIter

      private TableRowIterator footerIter
    • headerList

      private LinkedList headerList
    • footerList

      private LinkedList footerList
    • headerNetHeight

      private int headerNetHeight
    • footerNetHeight

      private int footerNetHeight
    • startXOffset

      private int startXOffset
    • usedBPD

      private int usedBPD
    • stepper

      private TableStepper stepper
    • headerIsBeingRepeated

      private boolean headerIsBeingRepeated
    • atLeastOnce

      private boolean atLeastOnce
  • Constructor Details

    • TableContentLayoutManager

      TableContentLayoutManager(TableLayoutManager parent)
      Main constructor
      Parameters:
      parent - Parent layout manager
  • Method Details

    • getTableLM

      TableLayoutManager getTableLM()
      Returns:
      the table layout manager
    • isSeparateBorderModel

      boolean isSeparateBorderModel()
      Returns:
      true if the table uses the separate border model.
    • getColumns

      ColumnSetup getColumns()
      Returns:
      the column setup of this table
    • getHeaderNetHeight

      protected int getHeaderNetHeight()
      Returns:
      the net header height
    • getFooterNetHeight

      protected int getFooterNetHeight()
      Returns:
      the net footer height
    • getHeaderElements

      protected LinkedList getHeaderElements()
      Returns:
      the header element list
    • getFooterElements

      protected LinkedList getFooterElements()
      Returns:
      the footer element list
    • getNextKnuthElements

      public List getNextKnuthElements(LayoutContext context, int alignment)
      Get a sequence of KnuthElements representing the content of the node assigned to the LM.
      Parameters:
      context - the LayoutContext used to store layout information
      alignment - the desired text alignment
      Returns:
      the list of KnuthElements
      See Also:
    • getFootnotesBPD

      private int getFootnotesBPD(List<List<KnuthElement>> footnotes)
    • getKnuthElementsForRowIterator

      private LinkedList getKnuthElementsForRowIterator(TableRowIterator iter, LayoutContext context, int alignment, int bodyType)
      Creates Knuth elements by iterating over a TableRowIterator.
      Parameters:
      iter - TableRowIterator instance to fetch rows from
      context - Active LayoutContext
      alignment - alignment indicator
      bodyType - Indicates what kind of body is being processed (BODY, HEADER or FOOTER)
      Returns:
      An element list
    • getXOffsetOfGridUnit

      protected int getXOffsetOfGridUnit(PrimaryGridUnit gu)
      Returns the X offset of the given grid unit.
      Parameters:
      gu - the grid unit
      Returns:
      the requested X offset
    • getXOffsetOfGridUnit

      protected int getXOffsetOfGridUnit(int colIndex, int nrColSpan)
      Returns the X offset of the grid unit in the given column.
      Parameters:
      colIndex - the column index (zero-based)
      nrColSpan - number columns spanned
      Returns:
      the requested X offset
    • addAreas

      void addAreas(PositionIterator parentIter, LayoutContext layoutContext)
      Adds the areas generated by this layout manager to the area tree.
      Parameters:
      parentIter - the position iterator
      layoutContext - the layout context for adding areas
    • addHeaderFooterAreas

      private void addHeaderFooterAreas(List elements, TablePart part, RowPainter painter, boolean lastOnPage)
    • addBodyAreas

      private void addBodyAreas(Iterator iterator, RowPainter painter, boolean lastOnPage)
      Iterates over the positions corresponding to the table's body (which may contain several table-body elements!) and adds the corresponding areas.
      Parameters:
      iterator - iterator over TableContentPosition elements. Those positions correspond to the elements of the body present on the current page
      painter -
      lastOnPage - true if the table has no footer (then the last line of the table that will be present on the page belongs to the body)
    • addTablePartAreas

      private void addTablePartAreas(List positions, RowPainter painter, TablePart body, boolean isFirstPos, boolean isLastPos, boolean lastInBody, boolean lastOnPage)
      Adds the areas corresponding to a single fo:table-header/footer/body element.
    • setStartXOffset

      void setStartXOffset(int startXOffset)
      Sets the overall starting x-offset. Used for proper placement of cells.
      Parameters:
      startXOffset - starting x-offset (table's start-indent)
    • getUsedBPD

      int getUsedBPD()
      Returns:
      the amount of block-progression-dimension used by the content
    • getBaseLength

      public int getBaseLength(int lengthBase, FObj fobj)
      Returns the base length for the given length base. Length base should be one of the constants defined in LengthBase.
      Specified by:
      getBaseLength in interface PercentBaseContext
      Parameters:
      lengthBase - Indicates which type of the base length value is to be returned
      fobj - The FO object against which the percentage should be evaluated
      Returns:
      The base length value of the given kind