Class StaticContentLayoutManager

All Implemented Interfaces:
PercentBaseContext, Constants, BlockLevelLayoutManager, LayoutManager

public class StaticContentLayoutManager extends BlockStackingLayoutManager
LayoutManager for an fo:flow object. Its parent LM is the PageSequenceLayoutManager. This LM is responsible for getting columns of the appropriate size and filling them with block-level areas generated by its children.
  • Constructor Details

    • StaticContentLayoutManager

      public StaticContentLayoutManager(PageSequenceLayoutManager pslm, StaticContent node, SideRegion reg)
      Creates a new StaticContentLayoutManager.
      Parameters:
      pslm - PageSequenceLayoutManager this layout manager belongs to
      node - static-content FO
      reg - side region to layout into
    • StaticContentLayoutManager

      public StaticContentLayoutManager(PageSequenceLayoutManager pslm, StaticContent node, Block block)
      Creates a new StaticContentLayoutManager.
      Parameters:
      pslm - PageSequenceLayoutManager this layout manager belongs to
      node - static-content FO
      block - the block to layout into
  • Method Details

    • getNextKnuthElements

      public 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
    • 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
    • addChildArea

      public void addChildArea(Area childArea)
      Add child area to a the correct container, depending on its area class. A Flow can fill at most one area container of any class at any one time. The actual work is done by BlockStackingLM. 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.
    • 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 for which the parent area is wanted
      Returns:
      the parent area for the given child
    • doLayout

      public void doLayout()
      Does the layout for a side region. Called by PageSequenceLayoutManager.
    • getStaticContentFO

      protected StaticContent getStaticContentFO()
      Convenience method that returns the Static Content node.
      Returns:
      the static content node
    • getContentAreaIPD

      public int getContentAreaIPD()
      Returns the IPD of the content area
      Specified by:
      getContentAreaIPD in interface LayoutManager
      Overrides:
      getContentAreaIPD in class BlockStackingLayoutManager
      Returns:
      the IPD of the content area
    • setContentAreaIPD

      protected void setContentAreaIPD(int contentAreaIPD)
      Sets the IPD of the content area
      Overrides:
      setContentAreaIPD in class BlockStackingLayoutManager
      Parameters:
      contentAreaIPD - the IPD of the content area
    • getContentAreaBPD

      public int getContentAreaBPD()
      Returns the BPD of the content area
      Specified by:
      getContentAreaBPD in interface LayoutManager
      Overrides:
      getContentAreaBPD in class BlockStackingLayoutManager
      Returns:
      the BPD of the content area
    • getKeepTogether

      public Keep getKeepTogether()
      Returns the keep-together strength for this element.
      Specified by:
      getKeepTogether in interface BlockLevelLayoutManager
      Overrides:
      getKeepTogether in class BlockStackingLayoutManager
      Returns:
      the keep-together strength
    • getKeepWithNext

      public Keep getKeepWithNext()
      Returns the keep-with-next strength for this element.
      Specified by:
      getKeepWithNext in interface BlockLevelLayoutManager
      Overrides:
      getKeepWithNext in class BlockStackingLayoutManager
      Returns:
      the keep-with-next strength
    • getKeepWithPrevious

      public Keep getKeepWithPrevious()
      Returns the keep-with-previous strength for this element.
      Specified by:
      getKeepWithPrevious in interface BlockLevelLayoutManager
      Overrides:
      getKeepWithPrevious in class BlockStackingLayoutManager
      Returns:
      the keep-with-previous strength