Class UnitProcessor


  • public abstract class UnitProcessor
    extends UnitProcessor
    This class provides methods to convert SVG length and coordinate to float in user units.
    • Constructor Detail

      • UnitProcessor

        public UnitProcessor()
    • Method Detail

      • createContext

        public static UnitProcessor.Context createContext​(BridgeContext ctx,
                                                          org.w3c.dom.Element e)
        Creates a context for the specified element.
        Parameters:
        ctx - the bridge context that contains the user agent and viewport definition
        e - the element interested in its context
      • svgHorizontalCoordinateToObjectBoundingBox

        public static float svgHorizontalCoordinateToObjectBoundingBox​(java.lang.String s,
                                                                       java.lang.String attr,
                                                                       UnitProcessor.Context ctx)
        Returns the specified horizontal coordinate in object bounding box coordinate system.
        Parameters:
        s - the horizontal coordinate
        attr - the attribute name that represents the coordinate
        ctx - the context used to resolve relative value
      • svgVerticalCoordinateToObjectBoundingBox

        public static float svgVerticalCoordinateToObjectBoundingBox​(java.lang.String s,
                                                                     java.lang.String attr,
                                                                     UnitProcessor.Context ctx)
        Returns the specified vertical coordinate in object bounding box coordinate system.
        Parameters:
        s - the vertical coordinate
        attr - the attribute name that represents the coordinate
        ctx - the context used to resolve relative value
      • svgOtherCoordinateToObjectBoundingBox

        public static float svgOtherCoordinateToObjectBoundingBox​(java.lang.String s,
                                                                  java.lang.String attr,
                                                                  UnitProcessor.Context ctx)
        Returns the specified 'other' coordinate in object bounding box coordinate system.
        Parameters:
        s - the 'other' coordinate
        attr - the attribute name that represents the coordinate
        ctx - the context used to resolve relative value
      • svgHorizontalLengthToObjectBoundingBox

        public static float svgHorizontalLengthToObjectBoundingBox​(java.lang.String s,
                                                                   java.lang.String attr,
                                                                   UnitProcessor.Context ctx)
        Returns the specified horizontal length in object bounding box coordinate system. A length must be greater than 0.
        Parameters:
        s - the 'other' length
        attr - the attribute name that represents the length
        ctx - the context used to resolve relative value
      • svgVerticalLengthToObjectBoundingBox

        public static float svgVerticalLengthToObjectBoundingBox​(java.lang.String s,
                                                                 java.lang.String attr,
                                                                 UnitProcessor.Context ctx)
        Returns the specified vertical length in object bounding box coordinate system. A length must be greater than 0.
        Parameters:
        s - the vertical length
        attr - the attribute name that represents the length
        ctx - the context used to resolve relative value
      • svgOtherLengthToObjectBoundingBox

        public static float svgOtherLengthToObjectBoundingBox​(java.lang.String s,
                                                              java.lang.String attr,
                                                              UnitProcessor.Context ctx)
        Returns the specified 'other' length in object bounding box coordinate system. A length must be greater than 0.
        Parameters:
        s - the 'other' length
        attr - the attribute name that represents the length
        ctx - the context used to resolve relative value
      • svgLengthToObjectBoundingBox

        public static float svgLengthToObjectBoundingBox​(java.lang.String s,
                                                         java.lang.String attr,
                                                         short d,
                                                         UnitProcessor.Context ctx)
        Returns the specified length with the specified direction in user units. A length must be greater than 0.
        Parameters:
        s - the length
        attr - the attribute name that represents the length
        d - the direction of the length
        ctx - the context used to resolve relative value
      • svgToObjectBoundingBox

        public static float svgToObjectBoundingBox​(java.lang.String s,
                                                   java.lang.String attr,
                                                   short d,
                                                   UnitProcessor.Context ctx)
        Returns the specified value with the specified direction in objectBoundingBox units.
        Parameters:
        s - the value
        attr - the attribute name that represents the value
        d - the direction of the value
        ctx - the context used to resolve relative value
      • svgHorizontalLengthToUserSpace

        public static float svgHorizontalLengthToUserSpace​(java.lang.String s,
                                                           java.lang.String attr,
                                                           UnitProcessor.Context ctx)
        Returns the specified horizontal length in user units. A length must be greater than 0.
        Parameters:
        s - the horizontal length
        attr - the attribute name that represents the length
        ctx - the context used to resolve relative value
      • svgVerticalLengthToUserSpace

        public static float svgVerticalLengthToUserSpace​(java.lang.String s,
                                                         java.lang.String attr,
                                                         UnitProcessor.Context ctx)
        Returns the specified vertical length in user units. A length must be greater than 0.
        Parameters:
        s - the vertical length
        attr - the attribute name that represents the length
        ctx - the context used to resolve relative value
      • svgOtherLengthToUserSpace

        public static float svgOtherLengthToUserSpace​(java.lang.String s,
                                                      java.lang.String attr,
                                                      UnitProcessor.Context ctx)
        Returns the specified 'other' length in user units. A length must be greater than 0.
        Parameters:
        s - the 'other' length
        attr - the attribute name that represents the length
        ctx - the context used to resolve relative value
      • svgHorizontalCoordinateToUserSpace

        public static float svgHorizontalCoordinateToUserSpace​(java.lang.String s,
                                                               java.lang.String attr,
                                                               UnitProcessor.Context ctx)
        Returns the specified horizontal coordinate in user units.
        Parameters:
        s - the horizontal coordinate
        attr - the attribute name that represents the length
        ctx - the context used to resolve relative value
      • svgVerticalCoordinateToUserSpace

        public static float svgVerticalCoordinateToUserSpace​(java.lang.String s,
                                                             java.lang.String attr,
                                                             UnitProcessor.Context ctx)
        Returns the specified vertical coordinate in user units.
        Parameters:
        s - the vertical coordinate
        attr - the attribute name that represents the length
        ctx - the context used to resolve relative value
      • svgOtherCoordinateToUserSpace

        public static float svgOtherCoordinateToUserSpace​(java.lang.String s,
                                                          java.lang.String attr,
                                                          UnitProcessor.Context ctx)
        Returns the specified 'other' coordinate in user units.
        Parameters:
        s - the 'other' coordinate
        attr - the attribute name that represents the length
        ctx - the context used to resolve relative value
      • svgLengthToUserSpace

        public static float svgLengthToUserSpace​(java.lang.String s,
                                                 java.lang.String attr,
                                                 short d,
                                                 UnitProcessor.Context ctx)
        Returns the specified length with the specified direction in user units. A length must be greater than 0.
        Parameters:
        s - the 'other' coordinate
        attr - the attribute name that represents the length
        d - the direction of the length
        ctx - the context used to resolve relative value
      • svgToUserSpace

        public static float svgToUserSpace​(java.lang.String s,
                                           java.lang.String attr,
                                           short d,
                                           UnitProcessor.Context ctx)
        Returns the specified coordinate with the specified direction in user units.
        Parameters:
        s - the 'other' coordinate
        attr - the attribute name that represents the length
        d - the direction of the coordinate
        ctx - the context used to resolve relative value