Class ListItemContentLayoutManager

All Implemented Interfaces:
PercentBaseContext, Constants, BlockLevelLayoutManager, BreakOpportunity, LayoutManager

public class ListItemContentLayoutManager extends BlockStackingLayoutManager implements BreakOpportunity
LayoutManager for a list-item-label or list-item-body FO.
  • Constructor Details

    • ListItemContentLayoutManager

      public ListItemContentLayoutManager(ListItemLabel node)
      Create a new Cell layout manager.
      Parameters:
      node - list-item-label node
    • ListItemContentLayoutManager

      public ListItemContentLayoutManager(ListItemBody node)
      Create a new Cell layout manager.
      Parameters:
      node - list-item-body node
  • Method Details

    • getPartFO

      protected AbstractListItemPart getPartFO()
      Convenience method.
      Returns:
      the ListBlock node
    • setXOffset

      public void setXOffset(int off)
      Set the x offset of this list item. This offset is used to set the absolute position of the list item within the parent block area.
      Parameters:
      off - the x offset
    • addAreas

      public void addAreas(PositionIterator parentIter, LayoutContext layoutContext)
      Add the areas for the break points. The list item contains block stacking layout managers that add block areas.
      Specified by:
      addAreas in interface LayoutManager
      Overrides:
      addAreas in class AbstractLayoutManager
      Parameters:
      parentIter - the iterator of the break positions
      layoutContext - the layout context for adding the 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 to get the parent for
      Returns:
      the parent area
    • addChildArea

      public void addChildArea(Area childArea)
      Add the child to the list item area.
      Specified by:
      addChildArea in interface LayoutManager
      Overrides:
      addChildArea in class BlockStackingLayoutManager
      Parameters:
      childArea - the child to add to the cell
    • getKeepTogetherProperty

      public KeepProperty getKeepTogetherProperty()
      Returns the keep-together property specified on the FObj. Default implementation throws a IllegalStateException. Must be implemented by the subclass, if applicable.
      Specified by:
      getKeepTogetherProperty in interface BlockLevelLayoutManager
      Overrides:
      getKeepTogetherProperty in class BlockStackingLayoutManager
      Returns:
      the keep-together property
    • 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
    • getNextKnuthElements

      public List getNextKnuthElements(LayoutContext context, int alignment, 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