Package org.vanted.scaling.resources
Class ScaledIcon
java.lang.Object
org.vanted.scaling.resources.ScaledIcon
- All Implemented Interfaces:
Icon
public class ScaledIcon extends Object implements Icon
Given a regular
Icon
this would produce a scaled clone of it.
Note: The idea was that resources are only visible to the relevant Scalers, which use them. It would have meant package-protected visibility. This, however, comes firstly in with JAVA 9, due to Project Jigsaw. Until then the modifier is public.
- Author:
- D. Garkov
-
Constructor Summary
Constructors Constructor Description ScaledIcon(Icon oldIcon, float scaleFactor)
Calling this would initialize an Icon Object clone of the passedoldIcon
, but painted in a scaled environment, determined by thescaleFactor
. -
Method Summary
Modifier and Type Method Description int
getIconHeight()
int
getIconWidth()
void
paintIcon(Component c, Graphics g, int x, int y)
-
Constructor Details
-
ScaledIcon
Calling this would initialize an Icon Object clone of the passedoldIcon
, but painted in a scaled environment, determined by thescaleFactor
. For more information, check out thepaintIcon()
method.- Parameters:
oldIcon
- icon to be scaledscaleFactor
- the respective factor of scaling
-
-
Method Details
-
paintIcon
-
getIconWidth
public int getIconWidth()- Specified by:
getIconWidth
in interfaceIcon
-
getIconHeight
public int getIconHeight()- Specified by:
getIconHeight
in interfaceIcon
-