public abstract class IconListObject extends IconObject implements IIcon.ImageList
IIcon.ImageList, IIcon.SizedIcon
Modifier and Type | Field and Description |
---|---|
protected static int |
RAW_IMAGE_ALWAYS_FREE
This is an action for getScaleAndCacheFor.
|
protected static int |
RAW_IMAGE_DO_NOT_FREE
This is an action for getScaleAndCacheFor.
|
protected static int |
RAW_IMAGE_FREE_IF_NOT_RETURNED
This is an action for getScaleAndCacheFor.
|
allowedSizes, defaultIconSizes, oldWindowsDefaultIconSizes
MATCH_EXACT, MATCH_SCALE_DOWN, MATCH_SCALE_HEIGHT_PRIORITY, MATCH_SCALE_UP, MATCH_SCALE_WIDTH_PRIORITY
OPTION_DONT_LIMIT_TO_ALLOWED_SIZES, OPTION_GET_DIMENSIONS_ONLY, OPTION_SCALE_DOWN_ONLY, OPTION_SCALE_UP_ONLY
Constructor and Description |
---|
IconListObject() |
Modifier and Type | Method and Description |
---|---|
protected int |
addedImage(int width,
int height,
int flags) |
protected void |
clear() |
int |
countImages()
Count the number of images in the ImageList.
|
protected int |
getBestScaledIcon(int forWidth,
int forHeight,
int iconOptions,
int matchOptions) |
Dimension |
getDimensionsFor(int requestedWidth,
int requestedHeight,
Dimension dest,
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.
|
protected int |
getHeightFor(int index) |
Dimension |
getImageDimension(int imageIndex,
Dimension dest)
Get the dimensions of the specified image.
|
int |
getImageFlags(int imageIndex)
The flags for the images.
|
int |
getMatchFor(int width,
int height,
int matchOptions)
Get the index of the image matching the specified dimensions.
|
protected IImage |
getScaleAndCacheFor(int width,
int height,
int options)
Convert a raw ImageData to a Picture.
|
PixelBuffer |
getScaled(int width,
int height,
int matchOptions,
boolean keepAspect,
PixelBuffer dest)
Get the best scaled version of the image as a PixelBuffer.
|
protected int |
getWidthFor(int index) |
boolean |
hasExactMatchFor(int width,
int height)
Returns true if this IIcons considers itself to have an exact match for the requested size.
|
boolean |
hasMixedTransparencyImages()
Returns if any of the images have mixed transparencies, that is any image where there are pixels
where the alpha value is not completely opaque or completely transparent.
|
void |
setImageModifier(ImageModifier modifier)
Set an ImageModifier that will modify images when getScaled() is called.
|
adjustHeight, adjustWidth, cacheDimension, cacheImage, draw, getAllowedSizeFor, getCachedDimension, getCachedImage, getDrawableFor, releaseDrawable
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getImage, releaseGetImage
getDrawableFor
protected static final int RAW_IMAGE_DO_NOT_FREE
protected static final int RAW_IMAGE_ALWAYS_FREE
protected static final int RAW_IMAGE_FREE_IF_NOT_RETURNED
public void setImageModifier(ImageModifier modifier)
modifier
- the modifier which may be null.public boolean hasMixedTransparencyImages()
IIcon.ImageList
hasMixedTransparencyImages
in interface IIcon.ImageList
public int countImages()
IIcon.ImageList
countImages
in interface IIcon.ImageList
public Dimension getImageDimension(int imageIndex, Dimension dest)
IIcon.ImageList
getImageDimension
in interface IIcon.ImageList
dest
- the destination Dimension or null to create and return a new one.public int getImageFlags(int imageIndex)
IIcon.ImageList
getImageFlags
in interface IIcon.ImageList
imageIndex
- the index of the image.protected int getWidthFor(int index)
protected int getHeightFor(int index)
protected int addedImage(int width, int height, int flags)
protected void clear()
clear
in class IconObject
protected int getBestScaledIcon(int forWidth, int forHeight, int iconOptions, int matchOptions)
public PixelBuffer getScaled(int width, int height, int matchOptions, boolean keepAspect, PixelBuffer dest)
IIcon.ImageList
getScaled
in interface IIcon.ImageList
width
- the requested width, or zero to indicate that it is not specified, in which case height must not be zero.height
- the requested height, or zero to indicate that it is not specified, in which case width must not be zero.matchOptions
- any combination of the MATCH_XXX options.keepAspect
- true to keep the aspect ratio of the icon. The ImageList may choose to keep the aspect ratio even
if this parameter is false.dest
- an optional destination PixelBuffer.public boolean hasExactMatchFor(int width, int height)
IIcon
hasExactMatchFor
in interface IIcon
width
- the width to match or 0 to match only the height.height
- the height to match or 0 to match only the width.public int getMatchFor(int width, int height, int matchOptions)
IIcon.ImageList
getMatchFor
in interface IIcon.ImageList
width
- the width to match or 0 to match only the height.height
- the height to match or 0 to match only the width.matchOptions
- one of the MATCH_XXX options.public Dimension getDimensionsFor(int requestedWidth, int requestedHeight, Dimension dest, int options)
IIcon
getDimensionsFor
in interface IIcon
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.dest
- 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.protected IImage getScaleAndCacheFor(int width, int height, int options)
data
- the image to convert to a Picture.rawImageFreeAction
- ONE of the RAW_IMAGE_XXX values.