public class SvgIcon extends java.lang.Object implements PaintableSvgIcon
Modifier and Type | Field and Description |
---|---|
protected java.awt.geom.Rectangle2D |
bounds |
protected java.lang.Object |
node |
protected double |
scale |
protected java.lang.Object |
svgDoc |
protected float |
xdelta |
protected float |
ydelta |
Constructor and Description |
---|
SvgIcon() |
SvgIcon(byte[] data,
byte[] orgImage,
java.lang.String orgFormat)
constructor over a buffer.
|
SvgIcon(java.io.InputStream is)
construtor over input stream
|
SvgIcon(java.lang.String url)
constructor over a URL
|
Modifier and Type | Method and Description |
---|---|
int |
getIconHeight() |
int |
getIconWidth() |
java.lang.String |
getOrgFormat()
return original format such as: image/x-wmf, image/x-emf
|
byte[] |
getOrgImage()
return original image data
|
java.lang.String |
getSrcUrl() |
java.lang.String |
getSvgData()
return SVG data as string
|
java.lang.String |
getSvgData(boolean omitXMLDecleration)
return SVG data as string
|
protected void |
init()
initialize the renderer.
|
boolean |
isLinked()
is the icon linked to a url
|
void |
load(java.io.InputStream is)
load svg content from the given stream
|
void |
paintIcon(java.awt.Component c,
java.awt.Graphics g,
int x,
int y) |
void |
paintIcon(java.awt.Graphics2D g2d,
int x,
int y,
int width,
int height)
Paint the icon at the given position and given size.
|
void |
setSrcUrl(java.lang.String srcUrl) |
protected java.awt.geom.Rectangle2D bounds
protected java.lang.Object svgDoc
protected java.lang.Object node
protected double scale
protected float xdelta
protected float ydelta
public SvgIcon(java.lang.String url)
url
- public SvgIcon()
public SvgIcon(byte[] data, byte[] orgImage, java.lang.String orgFormat)
data
- svg dataorgImage
- original imageorgFormat
- original formatpublic SvgIcon(java.io.InputStream is)
is
- public java.lang.String getSrcUrl()
public void setSrcUrl(java.lang.String srcUrl)
protected void init()
public int getIconHeight()
getIconHeight
in interface javax.swing.Icon
public int getIconWidth()
getIconWidth
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
public void paintIcon(java.awt.Graphics2D g2d, int x, int y, int width, int height)
PaintableIcon
paintIcon
in interface PaintableIcon
g2d
- graphics contextx
- x positiony
- y positionwidth
- widthheight
- heightpublic byte[] getOrgImage()
public java.lang.String getOrgFormat()
public java.lang.String getSvgData(boolean omitXMLDecleration) throws javax.xml.transform.TransformerException
omitXMLDecleration
- javax.xml.transform.TransformerException
public java.lang.String getSvgData()
getSvgData
in interface PaintableSvgIcon
public void load(java.io.InputStream is)
PaintableSvgIcon
load
in interface PaintableSvgIcon
public boolean isLinked()
PaintableIcon
isLinked
in interface PaintableIcon