class ImageResource extends Object
Modifier and Type | Field and Description |
---|---|
static Dimension |
DEFAULT_DIMENSION |
private Map<Dimension,Image> |
imgCache
Caches the image data for resized versions of the same image.
|
private SVGDiagram |
svg |
Constructor and Description |
---|
ImageResource(Image img) |
ImageResource(SVGDiagram svg) |
Modifier and Type | Method and Description |
---|---|
ImageIcon |
getImageIcon() |
ImageIcon |
getImageIcon(Dimension dim)
Get an ImageIcon object for the image of this resource
|
ImageIcon |
getImageIconBounded(Dimension maxSize)
Get image icon with a certain maximum size.
|
private Map<Dimension,Image> imgCache
private SVGDiagram svg
public static final Dimension DEFAULT_DIMENSION
public ImageResource(Image img)
public ImageResource(SVGDiagram svg)
public ImageIcon getImageIcon()
public ImageIcon getImageIcon(Dimension dim)
dim
- The requested dimensions. Use (-1,-1) for the original size
and (width, -1) to set the width, but otherwise scale the image
proportionally.public ImageIcon getImageIconBounded(Dimension maxSize)
maxSize
- The maximum size. One of the dimensions (widht or height) can be -1,
which means it is not bounded.