Class SvgIconUtil


  • public class SvgIconUtil
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static org.apache.batik.gvt.GraphicsNode buildGraphicsNode​(org.w3c.dom.svg.SVGDocument doc)  
      static org.w3c.dom.svg.SVGDocument createDocument​(java.lang.String filePath, java.io.InputStream inStream)  
      static javax.swing.Icon getIcon​(java.lang.Class relativeClass, java.lang.String name)  
      static javax.swing.Icon getIcon​(java.lang.Class relativeClass, java.lang.String name, int width, int height)  
      static javax.swing.Icon getIcon​(java.lang.String name)
      Gets the svg matching the supplied name without extension from the 'images/svgicons' resource dir at 16x16.
      static javax.swing.Icon getIcon​(java.lang.String name, int width, int height)
      Gets the svg matching the supplied name without extension from the 'images/svgicons' resource dir at width x height.
      static javax.swing.Icon getSvgIcon​(java.lang.Class relativeClass, java.lang.String path, int width, int height)
      Retrieves an svg icon located in the specified class's *.jar file.
      static java.io.InputStream openFileStream​(java.lang.Class relativeClass, java.lang.String filePath)  
      static java.io.InputStream openFileStream​(java.lang.String filePath)
      Open a stream to the given file path, using SvgIconUtil as the relative class
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getIcon

        public static javax.swing.Icon getIcon​(java.lang.String name)
        Gets the svg matching the supplied name without extension from the 'images/svgicons' resource dir at 16x16.
      • getIcon

        public static javax.swing.Icon getIcon​(java.lang.String name,
                                               int width,
                                               int height)
        Gets the svg matching the supplied name without extension from the 'images/svgicons' resource dir at width x height.
      • getIcon

        public static javax.swing.Icon getIcon​(java.lang.Class relativeClass,
                                               java.lang.String name)
      • getIcon

        public static javax.swing.Icon getIcon​(java.lang.Class relativeClass,
                                               java.lang.String name,
                                               int width,
                                               int height)
      • openFileStream

        public static java.io.InputStream openFileStream​(java.lang.String filePath)
        Open a stream to the given file path, using SvgIconUtil as the relative class
      • openFileStream

        public static java.io.InputStream openFileStream​(java.lang.Class relativeClass,
                                                         java.lang.String filePath)
      • createDocument

        public static org.w3c.dom.svg.SVGDocument createDocument​(java.lang.String filePath,
                                                                 java.io.InputStream inStream)
                                                          throws java.lang.Exception
        Throws:
        java.lang.Exception
      • buildGraphicsNode

        public static org.apache.batik.gvt.GraphicsNode buildGraphicsNode​(org.w3c.dom.svg.SVGDocument doc)
      • getSvgIcon

        public static javax.swing.Icon getSvgIcon​(java.lang.Class relativeClass,
                                                  java.lang.String path,
                                                  int width,
                                                  int height)
        Retrieves an svg icon located in the specified class's *.jar file. It attempts to load the image by looking for it at: "/images/svgicons/path.svg". May return null if the icon does not exist.