Class SvgLoader


  • public class SvgLoader
    extends Object
    • Constructor Detail

      • SvgLoader

        public SvgLoader()
        Creates a new SVGLoader.
    • Method Detail

      • setAddViewboxRect

        public void setAddViewboxRect​(boolean flag)
        Defines whether the returned JavaFX group shall contain a rectangle in the size of the svg document's viewbox.
        Parameters:
        flag - Flag to determine whether or not to add a rectangle in the size of the drawing's viewbox.
      • setGradientTransformPolicy

        public void setGradientTransformPolicy​(GradientPolicy policy)
        Defines the gradient transformation policy to use when an SVG gradient element contains a gradientTransform attribute.
        Parameters:
        policy - The GradientPolicy to use.
      • loadSvgDocument

        public org.apache.batik.anim.dom.SVGOMDocument loadSvgDocument​(String fileName)
        Parameters:
        fileName - The name of the SVG file to load.
        Returns:
        An XML document with the loaded SVG file.
      • loadSvgDocument

        public org.apache.batik.anim.dom.SVGOMDocument loadSvgDocument​(InputStream svgFile)
                                                                throws IOException
        Loads an SVG document from an input stream.
        Parameters:
        svgFile - The input stream which provides the SVG document.
        Returns:
        A DOM document which represents the SVG file.
        Throws:
        IOException
      • loadSvg

        public javafx.scene.Group loadSvg​(String fileName)
        Loads an SVG file from a file with a specified name and returns a corresponding JavaFX Group node.
        Parameters:
        fileName - The name of the SVG file to load.
        Returns:
        A JavaFX node representing the SVG file.
      • loadSvg

        public javafx.scene.Group loadSvg​(InputStream svgFile)
                                   throws IOException
        Loads an SVG file from an InputStream and returns a corresponding JavaFX Group node.
        Parameters:
        svgFile - A stream which provides the SVG document.
        Returns:
        A JavaFX node representing the SVG file.
        Throws:
        IOException