public class SvgIcon
extends java.lang.Object
implements javax.swing.Icon
Modifier and Type | Class and Description |
---|---|
protected class |
SvgIcon.BufferedImageTranscoder
A transcoder that generates a BufferedImage.
|
Modifier and Type | Field and Description |
---|---|
protected java.awt.image.BufferedImage |
bufferedImage
The BufferedImage generated from the SVG document.
|
protected java.awt.Image |
bufferedImageDisabled |
protected int |
height
The height of the rendered image.
|
protected int |
width
The width of the rendered image.
|
Constructor and Description |
---|
SvgIcon(java.net.URL url)
Create a new SVGIcon object.
|
SvgIcon(java.net.URL url,
int width,
int height)
Create a new SVGIcon object.
|
Modifier and Type | Method and Description |
---|---|
protected void |
generateBufferedImage(TranscoderInput in,
int w,
int h)
Generate the BufferedImage.
|
int |
getIconHeight()
Returns the icon's height.
|
int |
getIconWidth()
Returns the icon's width.
|
void |
paintIcon(java.awt.Component c,
java.awt.Graphics g,
int x,
int y)
Draw the icon at the specified location.
|
protected java.awt.image.BufferedImage bufferedImage
protected java.awt.Image bufferedImageDisabled
protected int width
protected int height
public SvgIcon(java.net.URL url, int width, int height)
uri
- The URI to read the SVG document from.public SvgIcon(java.net.URL url)
uri
- The URI to read the SVG document from.protected void generateBufferedImage(TranscoderInput in, int w, int h) throws TranscoderException
TranscoderException
public int getIconWidth()
getIconWidth
in interface javax.swing.Icon
public int getIconHeight()
getIconHeight
in interface javax.swing.Icon
public void paintIcon(java.awt.Component c, java.awt.Graphics g, int x, int y)
paintIcon
in interface javax.swing.Icon