public abstract class AutosizedIcon extends ScalableIcon
Modifier and Type | Class and Description |
---|---|
static interface |
AutosizedIcon.IconSizeProvider
Alternate supplier of icon size.
|
Constructor and Description |
---|
AutosizedIcon()
Creates a new AutosizedIcon with a 1/1 width to height ratio.
|
AutosizedIcon(double ratioIn)
Creates a new AutosizedIcon.
|
Modifier and Type | Method and Description |
---|---|
int |
getIconHeight()
Returns the icon's height.
|
int |
getIconWidth()
Returns the icon's width.
|
static int |
getMaxSize()
Gets the maximum icon size.
|
static int |
getUnitSize(Component c,
Graphics g)
Gets the default icon size.
|
void |
paintIcon(Component c,
Graphics graphics,
int x,
int y)
Draw the icon at the specified location.
|
void |
paintIconWithoutResizing(Component c,
Graphics graphics,
int x,
int y) |
static void |
setIconSizeProvider(AutosizedIcon.IconSizeProvider iconSizeProviderIn)
Sets the alternate icon size provider.
|
void |
setManual(boolean manualIn)
Sets manual mode.
|
static void |
setSizeMode(grasp.util.IconSizeMode mode)
Sets the size mode.
|
void |
setup()
Sets the icon size.
|
getImage, paintImage, setup
public AutosizedIcon()
public AutosizedIcon(double ratioIn)
ratioIn
- the ratio of width to height.public static int getMaxSize()
public static int getUnitSize(Component c, Graphics g)
c
- the component on which the icon will be displayed. This may be
null.g
- the graphics which will be used to paint the icon. This
may be null.public static void setSizeMode(grasp.util.IconSizeMode mode)
mode
- the new size mode.public void paintIcon(Component c, Graphics graphics, int x, int y)
paintIcon
in interface Icon
paintIcon
in class ScalableIcon
public int getIconWidth()
getIconWidth
in interface Icon
getIconWidth
in class ScalableIcon
public int getIconHeight()
getIconHeight
in interface Icon
getIconHeight
in class ScalableIcon
public void paintIconWithoutResizing(Component c, Graphics graphics, int x, int y)
public void setup()
public void setManual(boolean manualIn)
manualIn
- the new manual mode.public static void setIconSizeProvider(AutosizedIcon.IconSizeProvider iconSizeProviderIn)
iconSizeProviderIn
- the new alternate icon size provider.