Class SVGTransform

All Implemented Interfaces:
XMLConstants, ErrorConstants, SVGConverter, SVGSyntax, CSSConstants, SVGConstants

public class SVGTransform extends AbstractSVGConverter
Utility class that converts a GraphicContext transform stack into an SVG transform attribute.
  • Constructor Details

    • SVGTransform

      public SVGTransform(SVGGeneratorContext generatorContext)
      Parameters:
      generatorContext - used by converter to handle precision or to create elements.
  • Method Details

    • toSVG

      public SVGDescriptor toSVG(GraphicContext gc)
      Converts part or all of the input GraphicContext into a set of attribute/value pairs and related definitions
      Parameters:
      gc - GraphicContext to be converted
      Returns:
      descriptor of the attributes required to represent some or all of the GraphicContext state, along with the related definitions
      See Also:
    • toSVGTransform

      public final String toSVGTransform(GraphicContext gc)
      Parameters:
      gc - GraphicContext whose transform stack should be converted to SVG.
      Returns:
      the value of an SVG attribute equivalent to the input GraphicContext's transform stack.
    • toSVGTransform

      public final String toSVGTransform(TransformStackElement[] transformStack)
      This method tries to collapse the transform stack into an SVG string as compact as possible while still conveying the semantic of the stack. Successive stack elements of the same kind (e.g., two successive transforms or scales) are collapsed into a single element.
      Parameters:
      transformStack - sequence of transform that should be converted to an SVG transform attribute equivalent