class ImageResource extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.awt.Dimension |
DEFAULT_DIMENSION |
private java.util.Map<java.awt.Dimension,java.awt.Image> |
imgCache
Caches the image data for resized versions of the same image.
|
private SVGDiagram |
svg |
Constructor and Description |
---|
ImageResource(java.awt.Image img) |
ImageResource(SVGDiagram svg) |
Modifier and Type | Method and Description |
---|---|
javax.swing.ImageIcon |
getImageIcon() |
javax.swing.ImageIcon |
getImageIcon(java.awt.Dimension dim)
Get an ImageIcon object for the image of this resource
|
javax.swing.ImageIcon |
getImageIconBounded(java.awt.Dimension maxSize)
Get image icon with a certain maximum size.
|
private java.util.Map<java.awt.Dimension,java.awt.Image> imgCache
private SVGDiagram svg
public static final java.awt.Dimension DEFAULT_DIMENSION
public ImageResource(java.awt.Image img)
public ImageResource(SVGDiagram svg)
public javax.swing.ImageIcon getImageIcon()
public javax.swing.ImageIcon getImageIcon(java.awt.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 javax.swing.ImageIcon getImageIconBounded(java.awt.Dimension maxSize)
maxSize
- The maximum size. One of the dimensions (widht or height) can be -1,
which means it is not bounded.