Class ConditionalBorder

java.lang.Object
org.apache.fop.fo.flow.table.ConditionalBorder

public class ConditionalBorder extends Object
A class that holds the three possible values for a border-before/after on a table-cell, in the collapsing model. These three values are (for border-before, similar for border-after):
  • normal: common case, when a cell follows the cell before on a same page;
  • leading: when the table is broken and the cell appears at the top of a page, in which case its border must be resolved with the header (or the top of the table) instead of with the previous cell;
  • rest: when a cell is broken over several pages; same as leading but with conditionality taken into account.
  • Field Details

  • Constructor Details

  • Method Details

    • resolve

      void resolve(ConditionalBorder competitor, boolean withNormal, boolean withLeadingTrailing, boolean withRest)
      Resolves and updates the relevant parts of this border as well as the given one.
      Parameters:
      competitor -
      withNormal -
      withLeadingTrailing -
      withRest -
    • integrateCompetingSegment

      void integrateCompetingSegment(ConditionalBorder competitor, boolean withNormal, boolean withLeadingTrailing, boolean withRest)
      Integrates the given segment in this border. Unlike for integrateSegment(ConditionalBorder, boolean, boolean, boolean), this method nicely handles the case where the CollapsingBorderModel returns null, by keeping the components to their old values.
      Parameters:
      competitor -
      withNormal -
      withLeadingTrailing -
      withRest -
    • integrateSegment

      void integrateSegment(ConditionalBorder segment, boolean withNormal, boolean withLeadingTrailing, boolean withRest)
      Updates this border after taking into account the given segment. The CollapsingBorderModel is not expected to return null.
      Parameters:
      segment -
      withNormal -
      withLeadingTrailing -
      withRest -
    • copy

      Returns a shallow copy of this border.
      Returns:
      a copy of this border
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getDefaultBorder

      static ConditionalBorder getDefaultBorder(CollapsingBorderModel collapsingBorderModel)
      Returns a default border specification.
      Parameters:
      collapsingBorderModel - the model that will be used to resolve borders
      Returns:
      a border with style 'none' for all of the three components