public class IconStore extends Object
| Constructor and Description |
|---|
IconStore(Icon defaultIcon)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
static Icon |
createEmptyIcon(int size)
Returns an icon with no content but a given size.
|
static Icon |
createMinimalIcon(int size)
Returns an icon which indicates a shape but doesn't look like much.
|
Icon |
getIcon(Client client)
Returns the icon associated with a given client.
|
Icon |
getIcon(String url)
Returns the icon supplied by the graphic file at a given URL.
|
static Icon |
scaleIcon(Icon icon,
int fixDim,
double maxAspect,
boolean fixVertical)
Icon implementation which is rescaled to so that one dimension
(either width or height) has a fixed value.
|
static Icon |
sizeIcon(Icon icon,
int size)
Return an icon based on an existing one, but drawn to an exact size.
|
public IconStore(Icon defaultIcon)
defaultIcon - icon returned if no client icon is availablepublic Icon getIcon(String url)
url - URL of imagepublic Icon getIcon(Client client)
client - client whose icon is requiredpublic static Icon createEmptyIcon(int size)
size - edge size in pixelspublic static Icon createMinimalIcon(int size)
size - dimension in pixelspublic static Icon sizeIcon(Icon icon, int size)
icon - original icon, or null for blanksize - number of horizontal and vertical pixels in outputiconpublic static Icon scaleIcon(Icon icon, int fixDim, double maxAspect, boolean fixVertical)
icon - input iconfixDim - the fixed dimension in pixelsmaxAspect - maximum aspect ratio (>= 1)fixVertical - true to fix height, false to fix widthCopyright © 2008–2024. All rights reserved.