Class SVGComposite

java.lang.Object
io.sf.carte.echosvg.svggen.SVGComposite
All Implemented Interfaces:
XMLConstants, SVGConverter, SVGSyntax, CSSConstants, SVGConstants

public class SVGComposite extends Object implements SVGConverter
Utility class that converts a Composite object into a set of SVG properties and definitions.

Here is how Composites are mapped to SVG:

  • AlphaComposite.SRC_OVER with extra alpha is mapped to the opacity attribute
  • AlphaComposite's other rules are translated into predefined filter effects.
  • Custom Composite implementations are handled by the extension mechanism.
See Also:
  • Constructor Details

    • SVGComposite

      public SVGComposite(SVGGeneratorContext generatorContext)
      Parameters:
      generatorContext - The generator context used for handling custom and alpha composites
  • Method Details

    • getDefinitionSet

      public List<Element> getDefinitionSet()
      Specified by:
      getDefinitionSet in interface SVGConverter
      Returns:
      Set of filter Elements defining the composites this Converter has processed since it was created.
    • getAlphaCompositeConverter

      public SVGAlphaComposite getAlphaCompositeConverter()
    • getCustomCompositeConverter

      public SVGCustomComposite getCustomCompositeConverter()
    • 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 SVGCompositeDescriptor toSVG(Composite composite)
      Parameters:
      composite - Composite to be converted to SVG
      Returns:
      an SVGCompositeDescriptor mapping the SVG composite equivalent of the input Composite