public class DynamicallyScaledIcon extends java.lang.Object implements RecolorableIcon
This makes the size of the icon depend on a UI font resource.
Constructor and Description |
---|
DynamicallyScaledIcon(VectorImage image,
java.lang.String uiFontResource,
double scaling)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
int |
getIconHeight() |
int |
getIconWidth() |
DynamicallyScaledIcon |
getRecoloredIcon(Function1<java.awt.Color,java.awt.Color> recolor)
Get a recolored version of this icon.
|
void |
paintIcon(java.awt.Component c,
java.awt.Graphics g,
int x,
int y) |
public DynamicallyScaledIcon(@NotNull VectorImage image, @NotNull java.lang.String uiFontResource, double scaling)
image
- vector imageuiFontResource
- name of an UI font resourcescaling
- scaling of the icon relative to the font size@NotNull public DynamicallyScaledIcon getRecoloredIcon(@NotNull Function1<java.awt.Color,java.awt.Color> recolor)
getRecoloredIcon
in interface RecolorableIcon
recolor
- recolor function defining the mapping between old and new colorspublic void paintIcon(java.awt.Component c, java.awt.Graphics g, int x, int y)
paintIcon
in interface javax.swing.Icon
public int getIconWidth()
getIconWidth
in interface javax.swing.Icon
public int getIconHeight()
getIconHeight
in interface javax.swing.Icon