Class SVGToImageAntTask

  • All Implemented Interfaces:
    java.lang.Cloneable

    public class SVGToImageAntTask
    extends org.apache.tools.ant.Task

    Translates a group of SVG files into images.

    Parameters:

    • destDir - If present, specifies a directory to write SVG files to. Otherwise writes images to directory SVG file was found in verbose - If true, prints processing information to the console
    • format - File format for output images. The java core javax.imageio.ImageIO class is used for creating images, so format strings will depend on what files your system is configured to handle. By default, "gif", "jpg" and "png" files are guaranteed to be present. If omitted, "png" is used by default.
    • backgroundColor - Optional background color. Color can be specified as a standard HTML color. That is, as the name of a standard color such as "blue" or "limegreen", using the # notation as in #ff00ff for magenta, or in rgb format listing the components as in rgb(255, 192, 192) for pink. If omitted, background is transparent.
    • antiAlias - If set, shapes are drawn using anti-aliasing. Defaults to true.
    • interpolation - String describing image interpolation algorithm. Can be one of "nearest neighbor", "bilinear" or "bicubic". Defaults to "bicubic".
    • width - If greater than 0, determines the width of the written image. Otherwise, the width is obtained from the SVG document. Defaults to -1;
    • height - If greater than 0, determines the height of the written image. Otherwise, the height is obtained from the SVG document. Defaults to -1.
    • sizeToFit - If true and the width and height of the output image differ from that of the SVG image, the valid area of the SVG image will be resized to fit the specified size.
    • verbose - If true, prints out diagnostic information about processing. Defaults to false.
    Example: <SVGToImage destDir="${index.java}" format="jpg" verbose="true"> <fileset dir="${dir1}"> <include name="*.svg"/> </fileset> <fileset dir="${dir2}"> <include name="*.svg"/> </fileset> </SVGToImage>
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) boolean antiAlias  
      (package private) java.awt.Color backgroundColor  
      (package private) boolean clipToViewBox  
      (package private) java.io.File destDir  
      private java.util.ArrayList<org.apache.tools.ant.types.FileSet> filesets  
      private java.lang.String format  
      (package private) int height  
      (package private) java.lang.String interpolation  
      (package private) boolean sizeToFit  
      (package private) boolean verbose  
      (package private) int width  
      • Fields inherited from class org.apache.tools.ant.Task

        target, taskName, taskType, wrapper
      • Fields inherited from class org.apache.tools.ant.ProjectComponent

        description, location, project
    • Constructor Summary

      Constructors 
      Constructor Description
      SVGToImageAntTask()
      Creates a new instance of IndexLoadObjectsAntTask
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addFileset​(org.apache.tools.ant.types.FileSet set)
      Adds a set of files.
      void execute()  
      java.lang.String getFormat()  
      void setAntiAlias​(boolean antiAlias)  
      void setBackgroundColor​(java.lang.String bgColor)  
      void setClipToViewBox​(boolean clipToViewBox)  
      void setDestDir​(java.io.File destDir)  
      void setFormat​(java.lang.String format)  
      void setHeight​(int height)  
      void setInterpolation​(java.lang.String interpolation)  
      void setSizeToFit​(boolean sizeToFit)  
      void setVerbose​(boolean verbose)  
      void setWidth​(int width)  
      private void translate​(java.io.File baseDir, java.lang.String shortName)  
      • Methods inherited from class org.apache.tools.ant.Task

        bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
      • Methods inherited from class org.apache.tools.ant.ProjectComponent

        clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • filesets

        private java.util.ArrayList<org.apache.tools.ant.types.FileSet> filesets
      • verbose

        boolean verbose
      • destDir

        java.io.File destDir
      • format

        private java.lang.String format
      • backgroundColor

        java.awt.Color backgroundColor
      • width

        int width
      • height

        int height
      • antiAlias

        boolean antiAlias
      • interpolation

        java.lang.String interpolation
      • clipToViewBox

        boolean clipToViewBox
      • sizeToFit

        boolean sizeToFit
    • Constructor Detail

      • SVGToImageAntTask

        public SVGToImageAntTask()
        Creates a new instance of IndexLoadObjectsAntTask
    • Method Detail

      • getFormat

        public java.lang.String getFormat()
      • setFormat

        public void setFormat​(java.lang.String format)
      • setBackgroundColor

        public void setBackgroundColor​(java.lang.String bgColor)
      • setHeight

        public void setHeight​(int height)
      • setWidth

        public void setWidth​(int width)
      • setAntiAlias

        public void setAntiAlias​(boolean antiAlias)
      • setInterpolation

        public void setInterpolation​(java.lang.String interpolation)
      • setSizeToFit

        public void setSizeToFit​(boolean sizeToFit)
      • setClipToViewBox

        public void setClipToViewBox​(boolean clipToViewBox)
      • setVerbose

        public void setVerbose​(boolean verbose)
      • setDestDir

        public void setDestDir​(java.io.File destDir)
      • addFileset

        public void addFileset​(org.apache.tools.ant.types.FileSet set)
        Adds a set of files.
        Parameters:
        set -
      • execute

        public void execute()
        Overrides:
        execute in class org.apache.tools.ant.Task
      • translate

        private void translate​(java.io.File baseDir,
                               java.lang.String shortName)
                        throws org.apache.tools.ant.BuildException
        Throws:
        org.apache.tools.ant.BuildException