org.grinvin.gui.icons

Class SvgIconManager


public class SvgIconManager
extends java.lang.Object

Handles creation of icons from svg files.

Constructor Summary

SvgIconManager()
Default constructor.

Method Summary

SelectUnselectIcon
createSelectUnselectIcon(String iconPath, String selectedIconPath, int size)
ImageIcon
getIcon(String iconPath, int size)
Returns an imageicon with the given size for the svg file given.
ImageIcon
getIcon(String iconPath, int width, int height)
InputStream
getImageAsStream(String imagePath, int width, int height)
static SvgIconManager
getInstance()
Return the sole instance of this class.

Constructor Details

SvgIconManager

protected SvgIconManager()
Default constructor. Can be overridden, but should not be called directly.

Method Details

createSelectUnselectIcon

public SelectUnselectIcon createSelectUnselectIcon(String iconPath,
                                                   String selectedIconPath,
                                                   int size)

getIcon

public ImageIcon getIcon(String iconPath,
                         int size)
Returns an imageicon with the given size for the svg file given.
Parameters:
iconPath - Absolute classpath to the svg file
size - Size in pixels of the resulting icon

getIcon

public ImageIcon getIcon(String iconPath,
                         int width,
                         int height)

getImageAsStream

public InputStream getImageAsStream(String imagePath,
                                    int width,
                                    int height)

getInstance

public static SvgIconManager getInstance()
Return the sole instance of this class.