@OpenApiAll public class SquareIcon extends ResizableIconImageIcon
ResizableIconImageIcon.ResizableIconLoaderScalableImageIcon.AbstractImageLoader| Modifier and Type | Method and Description |
|---|---|
(package private) static ResizableIcon |
create(ResizableIcon icon,
int size,
double maxScale)
Convert given icon to a scaled icon which fits to a square of given size.
|
static ResizableIcon |
fit(ResizableIcon icon,
int size)
Convert given icon to a scaled icon which fits to a square of given size.
|
static ResizableIcon |
fitOrCenter(ResizableIcon icon,
int size)
Convert given icon to a scaled icon which fits to a square of given size.
|
int |
getIconHeight() |
int |
getIconWidth() |
java.lang.Double |
getScale() |
static double |
getScale(javax.swing.Icon icon,
int size)
Utility method to calculate a scale factor of given icon if it needs to be fit into a square of given size.
|
static java.awt.Dimension |
getScaleSize(javax.swing.Icon icon,
int size)
Utility method to calculate dimension of given icon if it needs to be fit into a square of given size.
|
void |
paintIcon(java.awt.Component c,
java.awt.Graphics g,
int x,
int y) |
void |
paintIcon(java.awt.Component c,
java.awt.Graphics g,
int x,
int y,
int w,
int h)
Draw the icon in the given bounds.
|
static ResizableIcon |
scale(ResizableIcon icon,
double scale)
Convert given icon to a scaled icon with given scale(zoom) factor.
|
clone, create, doNotScale, getImage, getLocation, getURL, internalGetIcon, internalSetLoader, internalSuperGetImage, setImage, toImageIcon, toImageIcon, toImageIconpublic static ResizableIcon fit(ResizableIcon icon, int size)
icon - iconsize - square sizepublic static ResizableIcon fitOrCenter(ResizableIcon icon, int size)
icon - iconsize - square sizestatic ResizableIcon create(ResizableIcon icon, int size, double maxScale)
icon - iconsize - square sizemaxScale - max icon scale factor.public static ResizableIcon scale(ResizableIcon icon, double scale)
icon - iconscale - scale factorpublic static java.awt.Dimension getScaleSize(javax.swing.Icon icon,
int size)
icon - iconsize - square sizepublic static double getScale(javax.swing.Icon icon,
int size)
icon - iconsize - square sizepublic void paintIcon(@CheckForNull
java.awt.Component c,
java.awt.Graphics g,
int x,
int y,
int w,
int h)
ResizableIconpaintIcon in interface ResizableIconpaintIcon in class ScalableImageIconc - the given component.g - the graphics to paint on.x - x coordinate.y - y coordinate.w - width to paint.h - height to paint.public void paintIcon(java.awt.Component c,
java.awt.Graphics g,
int x,
int y)
paintIcon in interface javax.swing.IconpaintIcon in class ScalableImageIconpublic int getIconWidth()
getIconWidth in interface javax.swing.IcongetIconWidth in class ScalableImageIconpublic int getIconHeight()
getIconHeight in interface javax.swing.IcongetIconHeight in class ScalableImageIconpublic java.lang.Double getScale()