Package afester.javafx.svg
Class SvgLoader
- java.lang.Object
-
- afester.javafx.svg.SvgLoader
-
public class SvgLoader extends Object
-
-
Constructor Summary
Constructors Constructor Description SvgLoader()Creates a new SVGLoader.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javafx.scene.GrouploadSvg(InputStream svgFile)Loads an SVG file from an InputStream and returns a corresponding JavaFX Group node.javafx.scene.GrouploadSvg(String fileName)Loads an SVG file from a file with a specified name and returns a corresponding JavaFX Group node.org.apache.batik.anim.dom.SVGOMDocumentloadSvgDocument(InputStream svgFile)Loads an SVG document from an input stream.org.apache.batik.anim.dom.SVGOMDocumentloadSvgDocument(String fileName)voidsetAddViewboxRect(boolean flag)Defines whether the returned JavaFX group shall contain a rectangle in the size of the svg document's viewbox.voidsetGradientTransformPolicy(GradientPolicy policy)Defines the gradient transformation policy to use when an SVG gradient element contains a gradientTransform attribute.
-
-
-
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- TheGradientPolicyto 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
-
-