Package org.openpnp.gui.support
Class SvgIcon
- java.lang.Object
-
- org.openpnp.gui.support.SvgIcon
-
- All Implemented Interfaces:
javax.swing.Icon
public class SvgIcon extends java.lang.Object implements javax.swing.Icon
A Swing Icon that draws an SVG image.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
SvgIcon.BufferedImageTranscoder
A transcoder that generates a BufferedImage.
-
Field Summary
Fields Modifier and Type Field 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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
generateBufferedImage(org.apache.batik.transcoder.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.
-
-
-
Field Detail
-
bufferedImage
protected java.awt.image.BufferedImage bufferedImage
The BufferedImage generated from the SVG document.
-
bufferedImageDisabled
protected java.awt.Image bufferedImageDisabled
-
width
protected int width
The width of the rendered image.
-
height
protected int height
The height of the rendered image.
-
-
Method Detail
-
generateBufferedImage
protected void generateBufferedImage(org.apache.batik.transcoder.TranscoderInput in, int w, int h) throws org.apache.batik.transcoder.TranscoderException
Generate the BufferedImage.- Throws:
org.apache.batik.transcoder.TranscoderException
-
getIconWidth
public int getIconWidth()
Returns the icon's width.- Specified by:
getIconWidth
in interfacejavax.swing.Icon
-
getIconHeight
public int getIconHeight()
Returns the icon's height.- Specified by:
getIconHeight
in interfacejavax.swing.Icon
-
paintIcon
public void paintIcon(java.awt.Component c, java.awt.Graphics g, int x, int y)
Draw the icon at the specified location.- Specified by:
paintIcon
in interfacejavax.swing.Icon
-
-