Class SVGBasicStroke

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

public class SVGBasicStroke extends AbstractSVGConverter
Utility class that converts a Java BasicStroke object into a set of SVG style attributes
Version:
$Id: SVGBasicStroke.java 1733416 2016-03-03 07:07:13Z gadams $
  • Constructor Details

    • SVGBasicStroke

      public SVGBasicStroke(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:
    • toSVG

      public final SVGStrokeDescriptor toSVG(BasicStroke stroke)
      Parameters:
      stroke - BasicStroke to convert to a set of SVG attributes
      Returns:
      map of attributes describing the stroke
    • dashArrayToSVG

      private final String dashArrayToSVG(float[] dashArray)
      Parameters:
      dashArray - float array to convert to a string
    • joinToSVG

      private static String joinToSVG(int lineJoin)
      Parameters:
      lineJoin - join style
    • endCapToSVG

      private static String endCapToSVG(int endCap)
      Parameters:
      endCap - cap style