Class SVGPaint

java.lang.Object
org.apache.batik.svggen.SVGPaint
All Implemented Interfaces:
XMLConstants, SVGConverter, SVGSyntax, CSSConstants, SVGConstants

public class SVGPaint extends Object implements SVGConverter
Utility class that converts a Paint object into an SVG element.
Version:
$Id: SVGPaint.java 1733416 2016-03-03 07:07:13Z gadams $
See Also:
  • Field Details

    • svgLinearGradient

      private SVGLinearGradient svgLinearGradient
      All GradientPaint convertions are handed to svgLinearGradient
    • svgTexturePaint

      private SVGTexturePaint svgTexturePaint
      All TexturePaint convertions are handed to svgTextureGradient
    • svgColor

      private SVGColor svgColor
      All Color convertions are handed to svgColor
    • svgCustomPaint

      private SVGCustomPaint svgCustomPaint
      All custom Paint convetions are handed to svgCustomPaint
    • generatorContext

      private SVGGeneratorContext generatorContext
      Used to generate DOM elements
  • Constructor Details

    • SVGPaint

      public SVGPaint(SVGGeneratorContext generatorContext)
      Parameters:
      generatorContext - the context.
  • Method Details

    • getDefinitionSet

      public List getDefinitionSet()
      Specified by:
      getDefinitionSet in interface SVGConverter
      Returns:
      Set of Elements defining the Paints this converter has processed since it was created
    • getTexturePaintConverter

      public SVGTexturePaint getTexturePaintConverter()
    • getGradientPaintConverter

      public SVGLinearGradient getGradientPaintConverter()
    • getCustomPaintConverter

      public SVGCustomPaint getCustomPaintConverter()
    • getColorConverter

      public SVGColor getColorConverter()
    • toSVG

      public SVGDescriptor toSVG(GraphicContext gc)
      Converts part or all of the input GraphicContext into a set of attribute/value pairs and related definitions
      Specified by:
      toSVG in interface SVGConverter
      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:
    • toSVG

      public SVGPaintDescriptor toSVG(Paint paint)
      Parameters:
      paint - Paint to be converted to SVG
      Returns:
      a descriptor of the corresponding SVG paint