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 simpleIconto aResizableIcon
-
-
Field Summary
Fields Modifier and Type Field Description private javax.swing.Iconicon
-
Constructor Summary
Constructors Modifier Constructor Description privateResizableIconAdapter(javax.swing.Icon icon)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectclone()Returns cloned instance of this icon.intgetIconHeight()intgetIconWidth()voidpaintIcon(java.awt.Component c, java.awt.Graphics g, int x, int y)voidpaintIcon(java.awt.Component c, java.awt.Graphics g, int x, int y, int w, int h)Draw the icon in the given bounds.static ResizableIcontoResizableIcon(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:
paintIconin 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:ResizableIconDraw 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:
paintIconin 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:ResizableIconReturns cloned instance of this icon.- Specified by:
clonein interfaceResizableIcon- Overrides:
clonein classjava.lang.Object- Returns:
- cloned instance.
-
getIconWidth
public int getIconWidth()
- Specified by:
getIconWidthin interfacejavax.swing.Icon
-
getIconHeight
public int getIconHeight()
- Specified by:
getIconHeightin interfacejavax.swing.Icon
-
-