public class VdIcon extends java.lang.Object implements javax.swing.Icon, java.lang.Comparable<VdIcon>
Modifier and Type | Field and Description |
---|---|
static int |
LABEL_GAP
Distance between the icon and the label
|
Constructor and Description |
---|
VdIcon(java.net.URL url) |
VdIcon(java.net.URL url,
int width,
int height) |
VdIcon(VdIcon icon,
java.awt.Color background) |
Modifier and Type | Method and Description |
---|---|
static java.awt.image.BufferedImage |
adjustIconColor(java.awt.Component component,
java.awt.image.BufferedImage image)
Adjust the icon color when the icon is intended to be painted on top of the given
component.
|
int |
compareTo(VdIcon other) |
void |
enableCheckerBoardBackground(boolean enable) |
java.lang.String |
getDisplayName() |
int |
getIconHeight() |
int |
getIconWidth() |
java.lang.String |
getName() |
java.net.URL |
getURL() |
static void |
paintCheckeredBackground(java.awt.Graphics g,
java.awt.Color backgroundColor,
java.awt.Color checkeredColor,
java.awt.Shape clip,
int cellSize)
TODO: Merge this code back with GraphicsUtil in idea.
|
void |
paintIcon(java.awt.Component c,
java.awt.Graphics gc,
int x,
int y) |
void |
setShowName(boolean showName)
Whether we should show the title displayed below the image.
|
public static final int LABEL_GAP
public VdIcon(@NonNull java.net.URL url) throws java.io.IOException
java.io.IOException
public VdIcon(@NonNull java.net.URL url, int width, int height) throws java.io.IOException
java.io.IOException
public VdIcon(VdIcon icon, java.awt.Color background)
@NonNull public java.lang.String getName()
@NonNull public java.lang.String getDisplayName()
public java.net.URL getURL()
public static void paintCheckeredBackground(java.awt.Graphics g, java.awt.Color backgroundColor, java.awt.Color checkeredColor, java.awt.Shape clip, int cellSize)
cellSize
pixels.public void paintIcon(java.awt.Component c, java.awt.Graphics gc, int x, int y)
paintIcon
in interface javax.swing.Icon
@NonNull public static java.awt.image.BufferedImage adjustIconColor(@NonNull java.awt.Component component, @NonNull java.awt.image.BufferedImage image)
component
- the component the icon is intended to be painted on top ofimage
- the icon imagepublic int getIconWidth()
getIconWidth
in interface javax.swing.Icon
public int getIconHeight()
getIconHeight
in interface javax.swing.Icon
public int compareTo(@NonNull VdIcon other)
compareTo
in interface java.lang.Comparable<VdIcon>
public void enableCheckerBoardBackground(boolean enable)
public void setShowName(boolean showName)