public interface IIcon
Modifier and Type | Interface and Description |
---|---|
static interface |
IIcon.ImageList
This may be implemented by entities that maintain a list of images of different sizes that
represent a single icon.
|
static class |
IIcon.SizedIcon |
Modifier and Type | Field and Description |
---|---|
static int |
OPTION_DONT_LIMIT_TO_ALLOWED_SIZES |
static int |
OPTION_GET_DIMENSIONS_ONLY |
static int |
OPTION_SCALE_DOWN_ONLY |
static int |
OPTION_SCALE_UP_ONLY |
Modifier and Type | Method and Description |
---|---|
void |
draw(Graphics g,
int x,
int y,
int width,
int height,
int drawOptions,
int iIconOptions) |
Dimension |
getDimensionsFor(int requestedWidth,
int requestedHeight,
Dimension destination,
int options)
Given a requested width and/or requested height for an IIcon, this returns the dimension that the Drawable
returned by getDrawableFor() will be if called with the same requestedWidth and requestedHeight.
|
Drawable |
getDrawableFor(int requestedWidth,
int requestedHeight,
int options)
Return the best icon for the specified requested width and height, at least one of which must be non-zero.
|
boolean |
hasExactMatchFor(int width,
int height)
Returns true if this IIcons considers itself to have an exact match for the requested size.
|
void |
releaseDrawable(Drawable imageFromGetDrawableFor)
Call this when you no longer need the image returned from getDrawableFor().
|
static final int OPTION_SCALE_UP_ONLY
static final int OPTION_SCALE_DOWN_ONLY
static final int OPTION_DONT_LIMIT_TO_ALLOWED_SIZES
static final int OPTION_GET_DIMENSIONS_ONLY
Dimension getDimensionsFor(int requestedWidth, int requestedHeight, Dimension destination, int options)
requestedWidth
- the requested width. This can be zero to indicate that it is not specified, if requestedHeight is non-zero.requestedHeight
- the requested height. This can be zero to indicate that it is not specified, if requestedWidth is non-zero.destination
- a destination Dimension or null to return a new one.options
- any combination of the OPTION_XXX values - which the IIcon may choose to ignore.Drawable getDrawableFor(int requestedWidth, int requestedHeight, int options)
requestedWidth
- the requested width. This can be zero to indicate that it is not specified, if requestedHeight is non-zero.requestedHeight
- the requested height. This can be zero to indicate that it is not specified, if requestedWidth is non-zero.options
- options for getting the image.void releaseDrawable(Drawable imageFromGetDrawableFor)
imageFromGetDrawableFor
- the image returned by getImageFor().void draw(Graphics g, int x, int y, int width, int height, int drawOptions, int iIconOptions)
boolean hasExactMatchFor(int width, int height)
width
- the width to match or 0 to match only the height.height
- the height to match or 0 to match only the width.