Class SVGShape

All Implemented Interfaces:
XMLConstants, SVGSyntax, CSSConstants, SVGConstants

public class SVGShape extends SVGGraphicObjectConverter
Utility class that converts a Shape object into the corresponding SVG element. Note that this class analyzes the input Shape class to generate the most appropriate corresponding SVG element: + Polygon is mapped to polygon + Rectangle2D and RoundRectangle2D are mapped to rect + Ellipse2D is mapped to circle or ellipse + Line2D is mapped to line + Arc2D, CubicCurve2D, Area, GeneralPath and QuadCurve2D are mapped to path. + Any custom Shape implementation is mapped to path as well.
Version:
$Id: SVGShape.java 1733416 2016-03-03 07:07:13Z gadams $
  • Field Details

  • Constructor Details

    • SVGShape

      public SVGShape(SVGGeneratorContext generatorContext)
      Parameters:
      generatorContext - used to build Elements
  • Method Details

    • toSVG

      public Element toSVG(Shape shape)
      Parameters:
      shape - Shape object to be converted