Class TableLayoutManager

    • Field Detail

      • log

        private static org.apache.commons.logging.Log log
        logging instance
      • curBlockArea

        private Block curBlockArea
      • tableUnit

        private double tableUnit
      • oldTableUnit

        private double oldTableUnit
      • autoLayout

        private boolean autoLayout
      • halfBorderSeparationBPD

        private int halfBorderSeparationBPD
      • halfBorderSeparationIPD

        private int halfBorderSeparationIPD
      • auxiliaryPosition

        private Position auxiliaryPosition
      • areAllTCLMsSaved

        private boolean areAllTCLMsSaved
      • tableMarkers

        private Markers tableMarkers
      • tableFragmentMarkers

        private Markers tableFragmentMarkers
      • hasRetrieveTableMarker

        private boolean hasRetrieveTableMarker
      • repeatedHeader

        private boolean repeatedHeader
      • headerFootnotes

        private java.util.List<java.util.List<KnuthElement>> headerFootnotes
      • footerFootnotes

        private java.util.List<java.util.List<KnuthElement>> footerFootnotes
    • Constructor Detail

      • TableLayoutManager

        public TableLayoutManager​(Table node)
        Create a new table layout manager.
        Parameters:
        node - the table FO
    • Method Detail

      • getTable

        public Table getTable()
        Returns:
        the table FO
      • getColumns

        public ColumnSetup getColumns()
        Returns:
        the column setup for this table.
      • resetSpaces

        private void resetSpaces()
      • getHalfBorderSeparationBPD

        public int getHalfBorderSeparationBPD()
        Returns:
        half the value of border-separation.block-progression-dimension, or 0 if border-collapse="collapse".
      • getHalfBorderSeparationIPD

        public int getHalfBorderSeparationIPD()
        Returns:
        half the value of border-separation.inline-progression-dimension, or 0 if border-collapse="collapse".
      • 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
      • registerColumnBackgroundArea

        void registerColumnBackgroundArea​(TableColumn column,
                                          Block backgroundArea,
                                          int xShift)
        Registers the given area, that will be used to render the part of column background covered by a table-cell. If percentages are used to place the background image, the final bpd of the (fraction of) table that will be rendered on the current page must be known. The traits can't then be set when the areas for the cell are created since at that moment this bpd is yet unknown. So they will instead be set in TableLM's addAreas(PositionIterator, LayoutContext) method.
        Parameters:
        column - the table-column element from which the cell gets background informations
        backgroundArea - the block of the cell's dimensions that will hold the column background
        xShift - additional amount by which the image must be shifted to be correctly placed (to counterbalance the cell's start border)
      • addAreas

        public void addAreas​(PositionIterator parentIter,
                             LayoutContext layoutContext)
        The table area is a reference area that contains areas for columns, bodies, rows and the contents are in cells.
        Specified by:
        addAreas in interface LayoutManager
        Overrides:
        addAreas in class AbstractLayoutManager
        Parameters:
        parentIter - the position iterator
        layoutContext - the layout context for adding areas
      • 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
        Returns:
        the parent area of the child
      • addBackgroundArea

        void addBackgroundArea​(Block background)
        Adds the given area to this layout manager's area, without updating the used bpd.
        Parameters:
        background - an area
      • 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
        Overrides:
        getBaseLength in class AbstractBaseLayoutManager
        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
      • saveTableHeaderTableCellLayoutManagers

        protected void saveTableHeaderTableCellLayoutManagers​(TableCellLayoutManager tclm)
        Saves a TableCellLayoutManager for later use.
        Parameters:
        tclm - a TableCellLayoutManager that has a RetrieveTableMarker
      • repeatAddAreasForSavedTableHeaderTableCellLayoutManagers

        protected void repeatAddAreasForSavedTableHeaderTableCellLayoutManagers()
        Calls addAreas() for each of the saved TableCellLayoutManagers.
      • resolveRetrieveTableMarker

        public RetrieveTableMarker resolveRetrieveTableMarker​(RetrieveTableMarker rtm)
        Resolves a RetrieveTableMarker by finding a qualifying Marker to which it is bound to.
        Parameters:
        rtm - the RetrieveTableMarker to be resolved
        Returns:
        a bound RetrieveTableMarker instance or null if no qualifying Marker found
      • registerMarkers

        public void registerMarkers​(java.util.Map<java.lang.String,​Marker> marks,
                                    boolean starting,
                                    boolean isfirst,
                                    boolean islast)
        Register the markers for this table.
        Parameters:
        marks - the map of markers to add
        starting - if the area being added is starting or ending
        isfirst - if the area being added has is-first trait
        islast - if the area being added has is-last trait
      • clearTableFragmentMarkers

        protected void clearTableFragmentMarkers()
        Clears the list of markers in the current table fragment. Should be called just before starting a new header (that belongs to the next table fragment).
      • flagAsHavingRetrieveTableMarker

        public void flagAsHavingRetrieveTableMarker()
      • setHeaderFootnotes

        void setHeaderFootnotes​(java.util.List<java.util.List<KnuthElement>> footnotes)
      • getHeaderFootnotes

        java.util.List<java.util.List<KnuthElement>> getHeaderFootnotes()
      • setFooterFootnotes

        void setFooterFootnotes​(java.util.List<java.util.List<KnuthElement>> footnotes)
      • setRepeateHeader

        public void setRepeateHeader​(boolean repeateHeader)
      • getFooterFootnotes

        java.util.List<java.util.List<KnuthElement>> getFooterFootnotes()