public class ScaledIcon extends java.lang.Object implements RecolorableIcon
vector image
.Constructor and Description |
---|
ScaledIcon(VectorImage vectorImage,
int width,
int height)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
int |
getIconHeight()
Returns the icon's height.
|
int |
getIconWidth()
Returns the icon's width.
|
RecolorableIcon |
getRecoloredIcon(Function1<java.awt.Color,java.awt.Color> recolorer)
Get a recolored version of this icon.
|
void |
paintIcon(java.awt.Component c,
java.awt.Graphics g,
int x,
int y)
Draw the icon at the specified location.
|
public ScaledIcon(@NotNull VectorImage vectorImage, int width, int height)
vectorImage
- vector image on which this icon is basedwidth
- screen width of icon in pixelheight
- screen height of icon in pixel@NotNull public RecolorableIcon getRecoloredIcon(@NotNull Function1<java.awt.Color,java.awt.Color> recolorer)
RecolorableIcon
getRecoloredIcon
in interface RecolorableIcon
recolorer
- recolor function which maps old colors into new colorspublic void paintIcon(@NotNull java.awt.Component c, @NotNull java.awt.Graphics g, int x, int y)
paintIcon
in interface javax.swing.Icon
c
- component to paint tog
- graphics context to paint tox
- x coordinate to paint toy
- y coordinate to paint topublic int getIconWidth()
getIconWidth
in interface javax.swing.Icon
public int getIconHeight()
getIconHeight
in interface javax.swing.Icon