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 aResizableIcon
from the specified URL.ResizableIcon
(Icon icon) Creates aResizableIcon
from the specified Icon. -
Method Summary
Modifier and TypeMethodDescriptionGets the base icon which is resized by this ResizableIcon.int
int
void
void
setFixedSizeFactor
(int factor) Sets a fixed size factor.
-
Constructor Details
-
ResizableIcon
Creates aResizableIcon
from the specified URL.- Parameters:
location
- the URL for the image
-
ResizableIcon
Creates aResizableIcon
from the specified Icon.- Parameters:
the
- icon to resize
-
-
Method Details
-
paintIcon
-
getIconWidth
public int getIconWidth()- Specified by:
getIconWidth
in interfaceIcon
-
getIconHeight
public int getIconHeight()- Specified by:
getIconHeight
in 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
-