Class TableCellLayoutManager

    • Constructor Detail

      • TableCellLayoutManager

        public TableCellLayoutManager​(TableCell node,
                                      PrimaryGridUnit pgu)
        Create a new Cell layout manager.
        Parameters:
        node - table-cell FO for which to create the LM
        pgu - primary grid unit for the cell
    • Method Detail

      • getTableCell

        public TableCell getTableCell()
        Returns:
        the table-cell FO
      • getTable

        public Table getTable()
        Returns:
        the table owning this cell
      • setHasRepeatedHeader

        public void setHasRepeatedHeader​(boolean hasRepeatedHeader)
      • getNextKnuthElements

        public java.util.List getNextKnuthElements​(LayoutContext context,
                                                   int alignment)
        Get a sequence of KnuthElements representing the content of the node assigned to the LM.
        Specified by:
        getNextKnuthElements in interface LayoutManager
        Overrides:
        getNextKnuthElements in class BlockStackingLayoutManager
        Parameters:
        context - the LayoutContext used to store layout information
        alignment - the desired text alignment
        Returns:
        the list of KnuthElements
      • setYOffset

        public void setYOffset​(int off)
        Set the y offset of this cell. This offset is used to set the absolute position of the cell.
        Parameters:
        off - the y direction offset
      • setXOffset

        public void setXOffset​(int off)
        Set the x offset of this cell (usually the same as its parent row). This offset is used to determine the absolute position of the cell.
        Parameters:
        off - the x offset
      • setContentHeight

        public void setContentHeight​(int h)
        Set the content height for this cell. This method is used during addAreas() stage.
        Parameters:
        h - the height of the contents of this cell
      • setTotalHeight

        public void setTotalHeight​(int h)
        Sets the total height of this cell on the current page. That is, the cell's bpd plus before and after borders and paddings, plus the table's border-separation.
        Parameters:
        h - the height of cell
      • repeatAddAreas

        protected void repeatAddAreas()
        Calls the addAreas() using the original arguments.
      • addAreas

        public void addAreas​(PositionIterator parentIter,
                             LayoutContext layoutContext,
                             int[] spannedGridRowHeights,
                             int startRow,
                             int endRow,
                             int borderBeforeWhich,
                             int borderAfterWhich,
                             boolean firstOnPage,
                             boolean lastOnPage,
                             org.apache.fop.layoutmgr.table.RowPainter painter,
                             int firstRowHeight)
        Add the areas for the break points. The cell contains block stacking layout managers that add block areas.

        In the collapsing-border model, the borders of a cell that spans over several rows or columns are drawn separately for each grid unit. Therefore we must know the height of each grid row spanned over by the cell. Also, if the cell is broken over two pages we must know which spanned grid rows are present on the current page.

        Parameters:
        parentIter - the iterator of the break positions
        layoutContext - the layout context for adding the areas
        spannedGridRowHeights - in collapsing-border model for a spanning cell, height of each spanned grid row
        startRow - first grid row on the current page spanned over by the cell, inclusive
        endRow - last grid row on the current page spanned over by the cell, inclusive
        borderBeforeWhich - one of ConditionalBorder.NORMAL, ConditionalBorder.LEADING_TRAILING or ConditionalBorder.REST
        borderAfterWhich - one of ConditionalBorder.NORMAL, ConditionalBorder.LEADING_TRAILING or ConditionalBorder.REST
        firstOnPage - true if the cell will be the very first one on the page, in which case collapsed before borders must be drawn in the outer mode
        lastOnPage - true if the cell will be the very last one on the page, in which case collapsed after borders must be drawn in the outer mode
        painter - painter
        firstRowHeight - height of the first row spanned by this cell (may be zero if this row is placed on a previous page). Used to calculate the placement of the row's background image if any
      • getParentArea

        public Area getParentArea​(Area childArea)
        Return an Area which can contain the passed childArea. The childArea may not yet have any content, but it has essential traits set. In general, if the LayoutManager already has an Area it simply returns it. Otherwise, it makes a new Area of the appropriate class. It gets a parent area for its area by calling its parent LM. Finally, based on the dimensions of the parent area, it initializes its own area. This includes setting the content IPD and the maximum BPD.
        Specified by:
        getParentArea in interface LayoutManager
        Overrides:
        getParentArea in class AbstractLayoutManager
        Parameters:
        childArea - the child area to get the parent for
        Returns:
        the parent area
      • registerMarkers

        protected void registerMarkers​(boolean isStarting,
                                       boolean isFirst,
                                       boolean isLast)
        Registers the FO's markers on the current PageViewport and parent Table.
        Overrides:
        registerMarkers in class AbstractLayoutManager
        Parameters:
        isStarting - boolean indicating whether the markers qualify as 'starting'
        isFirst - boolean indicating whether the markers qualify as 'first'
        isLast - boolean indicating whether the markers qualify as 'last'