Package com.nomagic.ui
Class ResizableIconAdapter
java.lang.Object
com.nomagic.ui.ResizableIconAdapter
- All Implemented Interfaces:
ResizableIcon
,Cloneable
,Icon
An adapter of simple
Icon
to a ResizableIcon
-
Method Summary
Modifier and TypeMethodDescriptionclone()
Returns cloned instance of this icon.int
int
void
void
Draw the icon in the given bounds.static ResizableIcon
toResizableIcon
(Icon icon) Create an adapter for a given icon.
-
Method Details
-
toResizableIcon
Create an adapter for a given icon.- Parameters:
icon
- icon- Returns:
- adapted icon
-
paintIcon
-
paintIcon
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
Description copied from interface:ResizableIcon
Returns cloned instance of this icon.- Specified by:
clone
in interfaceResizableIcon
- Overrides:
clone
in classObject
- Returns:
- cloned instance.
-
getIconWidth
public int getIconWidth()- Specified by:
getIconWidth
in interfaceIcon
-
getIconHeight
public int getIconHeight()- Specified by:
getIconHeight
in interfaceIcon
-