Class LineHeightPropertyMaker

All Implemented Interfaces:
Cloneable

public class LineHeightPropertyMaker extends SpaceProperty.Maker
A maker which calculates the line-height property. This property maker is special because line-height inherits the specified value, instead of the computed value. So when a line-height is create based on an attribute, the specified value is stored in the property and in compute() the stored specified value of the nearest specified is used to recalculate the line-height.
  • Constructor Details

    • LineHeightPropertyMaker

      public LineHeightPropertyMaker(int propId)
      Create a maker for line-height.
      Parameters:
      propId - the is for linehight.
  • Method Details

    • make

      public Property make(PropertyList propertyList, String value, FObj fo) throws PropertyException
      Create a Property object from an attribute specification.
      Overrides:
      make in class CompoundPropertyMaker
      Parameters:
      propertyList - The PropertyList object being built for this FO.
      value - The attribute value.
      fo - The parent FO for the FO whose property is being made.
      Returns:
      The initialized Property object.
      Throws:
      PropertyException - for invalid or inconsistent FO input
    • compute

      protected Property compute(PropertyList propertyList) throws PropertyException
      Recalculate the line-height value based on the nearest specified value. Return a Property object representing the value of this property, based on other property values for this FO. A special case is properties which inherit the specified value, rather than the computed value.
      Overrides:
      compute in class PropertyMaker
      Parameters:
      propertyList - The PropertyList for the FO.
      Returns:
      Property A computed Property value or null if no rules are specified to compute the value.
      Throws:
      PropertyException - for invalid or inconsistent FO input
    • convertProperty

      public Property convertProperty(Property p, PropertyList propertyList, FObj fo) throws PropertyException
      Return a Property object based on the passed Property object. This method is called if the Property object built by the parser isn't the right type for this compound property.
      Overrides:
      convertProperty in class SpaceProperty.Maker
      Parameters:
      p - The Property object return by the expression parser
      propertyList - The PropertyList object being built for this FO.
      fo - The parent FO for the FO whose property is being made.
      Returns:
      A Property of the correct type or null if the parsed value can't be converted to the correct type.
      Throws:
      PropertyException - for invalid or inconsistent FO input