Package org.opensourcephysics.display
Class ResizableIcon
java.lang.Object
org.opensourcephysics.display.ResizableIcon
- All Implemented Interfaces:
Icon
An
Icon that can be resized.- Author:
- Doug Brown
-
Constructor Summary
ConstructorsConstructorDescriptionResizableIcon(URL location) Creates aResizableIconfrom the specified URL.ResizableIcon(Icon icon) Creates aResizableIconfrom the specified Icon. -
Method Summary
Modifier and TypeMethodDescriptionGets the base icon which is resized by this ResizableIcon.intintvoidvoidsetFixedSizeFactor(int factor) Sets a fixed size factor.
-
Constructor Details
-
ResizableIcon
Creates aResizableIconfrom the specified URL.- Parameters:
location- the URL for the image
-
ResizableIcon
Creates aResizableIconfrom the specified Icon.- Parameters:
the- icon to resize
-
-
Method Details
-
paintIcon
-
getIconWidth
public int getIconWidth()- Specified by:
getIconWidthin interfaceIcon
-
getIconHeight
public int getIconHeight()- Specified by:
getIconHeightin interfaceIcon
-
getBaseIcon
Gets the base icon which is resized by this ResizableIcon.- Returns:
- the base icon
-
setFixedSizeFactor
public void setFixedSizeFactor(int factor) Sets a fixed size factor. Factors <= 0 unfixes it.- Parameters:
factor- the desired fixed factor
-