Class BlockContainerLayoutManager

    • Field Detail

      • log

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

        private Block referenceArea
      • absoluteCTM

        private CTM absoluteCTM
      • height

        private Length height
      • vpContentBPD

        private int vpContentBPD
      • autoHeight

        private boolean autoHeight
      • inlineElementList

        private boolean inlineElementList
      • foBlockSpaceBefore

        private MinOptMax foBlockSpaceBefore
      • foBlockSpaceAfter

        private MinOptMax foBlockSpaceAfter
      • horizontalOverflow

        private int horizontalOverflow
      • contentRectOffsetX

        private double contentRectOffsetX
      • contentRectOffsetY

        private double contentRectOffsetY
    • Constructor Detail

      • BlockContainerLayoutManager

        public BlockContainerLayoutManager​(BlockContainer node)
        Create a new block container layout manager.
        Parameters:
        node - block-container node to create the layout manager for.
    • Method Detail

      • resetSpaces

        private void resetSpaces()
      • getRotatedIPD

        protected int getRotatedIPD()
        Returns:
        the content IPD
      • needClip

        private boolean needClip()
      • getBPIndents

        private int getBPIndents()
      • isAbsoluteOrFixed

        protected boolean isAbsoluteOrFixed()
      • isFixed

        private boolean isFixed()
      • 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
      • getNextKnuthElements

        public java.util.List getNextKnuthElements​(LayoutContext context,
                                                   int alignment,
                                                   java.util.Stack lmStack,
                                                   Position restartPosition,
                                                   LayoutManager restartAtLM)
        Returns an updated list of Knuth elements corresponding to this layout manager, after a change of IPD has been detected.
        Specified by:
        getNextKnuthElements in interface LayoutManager
        Overrides:
        getNextKnuthElements in class BlockStackingLayoutManager
        Parameters:
        context - the layout context
        alignment - the alignment
        lmStack - the stack of LMs that are active at the IPD change
        restartPosition - the position corresponding to the element finishing the page before the IPD change
        restartAtLM - if not null, the layout manager from which to restart. That is, the IPD change occurs between two block elements and not inside a paragraph
        Returns:
        an updated list of elements, taking the new IPD into account
      • setupAreaDimensions

        private void setupAreaDimensions​(LayoutContext context)
      • generateNonInlinedBox

        private KnuthBox generateNonInlinedBox()
      • blockProgressionDirectionChanges

        private boolean blockProgressionDirectionChanges()
      • isRestartable

        public boolean isRestartable()
        Returns true if this layout manager is able to re-generate its Knuth elements after an IPD change.
        Specified by:
        isRestartable in interface LayoutManager
        Overrides:
        isRestartable in class AbstractBaseLayoutManager
        Returns:
        true if this layout manager can be restarted after an IPD change
      • getNextKnuthElementsAbsolute

        private java.util.List<ListElement> getNextKnuthElementsAbsolute​(LayoutContext context)
      • updateRelDims

        private void updateRelDims()
      • getAbsOffset

        private java.awt.Point getAbsOffset()
      • addAreas

        public void addAreas​(PositionIterator parentIter,
                             LayoutContext layoutContext)
        Tell the layout manager to add all the child areas implied by Position objects which will be returned by the Iterator.
        Specified by:
        addAreas in interface LayoutManager
        Overrides:
        addAreas in class AbstractLayoutManager
        Parameters:
        parentIter - the position iterator
        layoutContext - the context
      • getParentArea

        public Area getParentArea​(Area childArea)
        Get the parent area for children of this block container. This returns the current block container area and creates it if required. 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 for which the parent area is wanted
        Returns:
        the parent area for the given child
      • addChildArea

        public void addChildArea​(Area childArea)
        Add the child to the block container. Add the childArea to the current area. Called by child LayoutManager when it has filled one of its areas. The LM should already have an Area in which to put the child. See if the area will fit in the current area. If so, add it. Otherwise initiate breaking.
        Specified by:
        addChildArea in interface LayoutManager
        Overrides:
        addChildArea in class BlockStackingLayoutManager
        Parameters:
        childArea - the area to add: will be some block-stacked Area.
      • flush

        protected void flush()
        Force current area to be added to parent area. Force current area to be added to parent area.
        Overrides:
        flush in class BlockStackingLayoutManager
      • getBlockContainerFO

        protected BlockContainer getBlockContainerFO()
        Returns:
        the BlockContainer node
      • handleOverflow

        public boolean handleOverflow​(int milliPoints)
        Whether this LM can handle horizontal overflow error messages (only a BlockContainerLayoutManager can).
        Overrides:
        handleOverflow in class BlockStackingLayoutManager
        Parameters:
        milliPoints - horizontal overflow
        Returns:
        true if handled by a BlockContainerLayoutManager