Class SpaceResolver

java.lang.Object
org.apache.fop.layoutmgr.SpaceResolver

public final class SpaceResolver extends Object
This class resolves spaces and conditional borders and paddings by replacing the UnresolvedListElements descendants by the right combination of KnuthElements on an element list.
  • Field Details

  • Constructor Details

    • SpaceResolver

      private SpaceResolver(List first, BreakElement breakPoss, List second, boolean isFirst, boolean isLast)
      Main constructor.
      Parameters:
      first - Element list before a break (optional)
      breakPoss - Break possibility (optional)
      second - Element list after a break (or if no break possibility in vicinity)
      isFirst - Resolution at the beginning of a (full) element list
      isLast - Resolution at the end of a (full) element list
  • Method Details

    • toString

      private String toString(Object[] arr1, Object[] arr2)
    • removeConditionalBorderAndPadding

      private void removeConditionalBorderAndPadding(UnresolvedListElement[] elems, MinOptMax[] lengths, boolean reverse)
    • performSpaceResolutionRule1

      private void performSpaceResolutionRule1(UnresolvedListElement[] elems, MinOptMax[] lengths, boolean reverse)
    • performSpaceResolutionRules2to3

      private void performSpaceResolutionRules2to3(UnresolvedListElement[] elems, MinOptMax[] lengths, int start, int end)
    • performSpaceResolutionRules2to3

      private void performSpaceResolutionRules2to3(UnresolvedListElement[] elems, MinOptMax[] lengths)
    • hasFirstPart

      private boolean hasFirstPart()
    • hasSecondPart

      private boolean hasSecondPart()
    • resolve

      private void resolve()
    • sum

      private MinOptMax sum(MinOptMax[] lengths)
    • generate

      private void generate(ListIterator iter)
    • resolveElementList

      public static void resolveElementList(List elems)
      Resolves unresolved elements applying the space resolution rules defined in 4.3.1.
      Parameters:
      elems - the element list
    • performConditionalsNotification

      public static void performConditionalsNotification(List effectiveList, int startElementIndex, int endElementIndex, int prevBreak)
      Inspects an effective element list and notifies all layout managers about the state of the spaces and conditional lengths.
      Parameters:
      effectiveList - the effective element list
      startElementIndex - index of the first element in the part to be processed
      endElementIndex - index of the last element in the part to be processed
      prevBreak - index of the the break possibility just before this part (used to identify a break condition, lastBreak <= 0 represents a no-break condition)