Package com.nomagic.ui
Class ResizableIconAdapter
- java.lang.Object
-
- com.nomagic.ui.ResizableIconAdapter
-
- All Implemented Interfaces:
ResizableIcon
,java.lang.Cloneable
,javax.swing.Icon
@OpenApiAll public final class ResizableIconAdapter extends java.lang.Object implements ResizableIcon
An adapter of simpleIcon
to aResizableIcon
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
clone()
Returns cloned instance of this icon.int
getIconHeight()
int
getIconWidth()
void
paintIcon(java.awt.Component c, java.awt.Graphics g, int x, int y)
void
paintIcon(java.awt.Component c, java.awt.Graphics g, int x, int y, int w, int h)
Draw the icon in the given bounds.static ResizableIcon
toResizableIcon(javax.swing.Icon icon)
Create an adapter for a given icon.
-
-
-
Method Detail
-
toResizableIcon
public static ResizableIcon toResizableIcon(javax.swing.Icon icon)
Create an adapter for a given icon.- Parameters:
icon
- icon- Returns:
- adapted icon
-
paintIcon
public void paintIcon(java.awt.Component c, java.awt.Graphics g, int x, int y)
- Specified by:
paintIcon
in interfacejavax.swing.Icon
-
paintIcon
public void paintIcon(@CheckForNull java.awt.Component c, java.awt.Graphics g, int x, int y, int w, int h)
Description copied from interface:ResizableIcon
Draw the icon in the given bounds. Icon implementations may use the Component argument to get properties useful for painting, e.g. the foreground or background color.- Specified by:
paintIcon
in interfaceResizableIcon
- Parameters:
c
- the given component.g
- the graphics to paint on.x
- x coordinate.y
- y coordinate.w
- width to paint.h
- height to paint.
-
clone
public java.lang.Object clone()
Description copied from interface:ResizableIcon
Returns cloned instance of this icon.- Specified by:
clone
in interfaceResizableIcon
- Overrides:
clone
in classjava.lang.Object
- Returns:
- cloned instance.
-
getIconWidth
public int getIconWidth()
- Specified by:
getIconWidth
in interfacejavax.swing.Icon
-
getIconHeight
public int getIconHeight()
- Specified by:
getIconHeight
in interfacejavax.swing.Icon
-
-