Class InlineLayoutManager

All Implemented Interfaces:
PercentBaseContext, Constants, BreakOpportunity, InlineLevelLayoutManager, LayoutManager
Direct Known Subclasses:
BasicLinkLayoutManager, BidiLayoutManager

public class InlineLayoutManager extends InlineStackingLayoutManager
LayoutManager for objects which stack children in the inline direction, such as Inline or Line
  • Field Details

    • alignmentAdjust

      protected Length alignmentAdjust
      The alignment adjust property
    • alignmentBaseline

      protected int alignmentBaseline
      The alignment baseline property
    • baselineShift

      protected Length baselineShift
      The baseline shift property
    • dominantBaseline

      protected int dominantBaseline
      The dominant baseline property
    • lineHeight

      protected SpaceProperty lineHeight
      The line height property
  • Constructor Details

    • InlineLayoutManager

      public InlineLayoutManager(InlineLevel node)
      Create an inline layout manager. This is used for fo's that create areas that contain inline areas.
      Parameters:
      node - the formatting object that creates the area
  • Method Details

    • initialize

      public void initialize()
      initialize the layout manager. Allows each layout manager to calculate often used values.
      Specified by:
      initialize in interface LayoutManager
      Overrides:
      initialize in class AbstractLayoutManager
    • getExtraIPD

      protected MinOptMax getExtraIPD(boolean isNotFirst, boolean isNotLast)
      Returns the extra IPD needed for any leading or trailing fences for the current area.
      Overrides:
      getExtraIPD in class InlineStackingLayoutManager
      Parameters:
      isNotFirst - true if not the first area for this layout manager
      isNotLast - true if not the last area for this layout manager
      Returns:
      the extra IPD as a MinOptMax spec
    • hasLeadingFence

      protected boolean hasLeadingFence(boolean isNotFirst)
      Indication if the current area has a leading fence.
      Overrides:
      hasLeadingFence in class InlineStackingLayoutManager
      Parameters:
      isNotFirst - true if not the first area for this layout manager
      Returns:
      the leading fence flag
    • hasTrailingFence

      protected boolean hasTrailingFence(boolean isNotLast)
      Indication if the current area has a trailing fence.
      Overrides:
      hasTrailingFence in class InlineStackingLayoutManager
      Parameters:
      isNotLast - true if not the last area for this layout manager
      Returns:
      the trailing fence flag
    • getSpaceStart

      protected SpaceProperty getSpaceStart()
      Get the space at the start of the inline area.
      Overrides:
      getSpaceStart in class InlineStackingLayoutManager
      Returns:
      the space property describing the space
    • getSpaceEnd

      protected SpaceProperty getSpaceEnd()
      Get the space at the end of the inline area.
      Overrides:
      getSpaceEnd in class InlineStackingLayoutManager
      Returns:
      the space property describing the space
    • createArea

      protected InlineArea createArea(boolean isInline)
      Create and initialize an InlineArea
      Parameters:
      isInline - true if the parent is an inline
      Returns:
      the area
    • createInlineParent

      protected InlineParent createInlineParent()
      Creates the inline area that will contain the areas returned by the children of this layout manager.
      Returns:
      a new inline area
    • setTraits

      protected void setTraits(boolean isNotFirst, boolean isNotLast)
      Trait setter to be overridden by subclasses.
      Overrides:
      setTraits in class InlineStackingLayoutManager
      Parameters:
      isNotFirst - true if this is not the first child area added
      isNotLast - true if this is not the last child area added
    • mustKeepTogether

      public boolean mustKeepTogether()
      Returns:
      true if this element must be kept together
    • 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 AbstractLayoutManager
      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 context)
      Generate and add areas to parent area. Set size of each area. This should only create and return one inline area for any inline parent area.
      Specified by:
      addAreas in interface LayoutManager
      Overrides:
      addAreas in class AbstractLayoutManager
      Parameters:
      parentIter - Iterator over Position information returned by this LayoutManager.
      context - layout context.
    • addChildArea

      public void addChildArea(Area childArea)
      Add a child area to the current area. If this causes the maximum dimension of the current area to be exceeded, the parent LM is called to add it.
      Specified by:
      addChildArea in interface LayoutManager
      Overrides:
      addChildArea in class AbstractLayoutManager
      Parameters:
      childArea - the child area to be added
    • getChangedKnuthElements

      public List getChangedKnuthElements(List oldList, int alignment, int depth)
      Get a sequence of KnuthElements representing the content of the node assigned to the LM, after changes have been applied
      Specified by:
      getChangedKnuthElements in interface InlineLevelLayoutManager
      Overrides:
      getChangedKnuthElements in class InlineStackingLayoutManager
      Parameters:
      oldList - the elements to replace
      alignment - the desired text alignment
      depth - the depth at which the Positions for this LM in oldList are found
      Returns:
      the updated list of KnuthElements
    • addKnuthElementsForBorderPaddingStart

      protected void addKnuthElementsForBorderPaddingStart(List returnList)
      Creates Knuth elements for start border padding and adds them to the return list.
      Parameters:
      returnList - return list to add the additional elements to
    • addKnuthElementsForBorderPaddingEnd

      protected void addKnuthElementsForBorderPaddingEnd(List returnList)
      Creates Knuth elements for end border padding and adds them to the return list.
      Parameters:
      returnList - return list to add the additional elements to
    • getAuxiliaryPosition

      protected Position getAuxiliaryPosition()
      Returns:
      an auxiliary Position instance used for things like spaces.