Class FontSizePropertyMaker

  • All Implemented Interfaces:
    java.lang.Cloneable, Constants

    public class FontSizePropertyMaker
    extends LengthProperty.Maker
    implements Constants
    This subclass of LengthProperty.Maker handles the special treatment of relative font sizes described in 7.8.4.
    • Constructor Detail

      • FontSizePropertyMaker

        public FontSizePropertyMaker​(int propId)
        Create a length property which can handle relative font sizes
        Parameters:
        propId - the font size property id.
    • Method Detail

      • make

        public Property make​(PropertyList propertyList,
                             java.lang.String value,
                             FObj fo)
                      throws PropertyException
        Create a Property object from an attribute specification. Contrary to basic lengths, percentages for font-size can be resolved here already: if the property evaluates to a PercentLength, it is immediately replaced by the resolved FixedLength.
        Overrides:
        make in class PropertyMaker
        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
      • 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 property. It is overridden by subclasses. Implements the parts of 7.8.4 relevant to relative font sizes
        Overrides:
        convertProperty in class LengthProperty.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