Class SVGLinearGradient

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

public class SVGLinearGradient extends AbstractSVGConverter
Utility class that converts a Java GradientPaint into an SVG linear gradient element
Version:
$Id: SVGLinearGradient.java 1733416 2016-03-03 07:07:13Z gadams $
  • Constructor Details

    • SVGLinearGradient

      public SVGLinearGradient(SVGGeneratorContext generatorContext)
      Parameters:
      generatorContext - used to build 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:
    • toSVG

      public SVGPaintDescriptor toSVG(GradientPaint gradient)
      Parameters:
      gradient - the GradientPaint to be converted
      Returns:
      a description of the SVG paint and opacity corresponding to the gradient Paint. The definiton of the linearGradient is put in the linearGradientDefsMap