APIdia Launch Partner
Top Inners Fields Constructors Methods
sun.awt.image

public Class MultiResolutionCachedImage

extends AbstractMultiResolutionImage
Class Inheritance
Imports
java.awt.Dimension, .Image, java.awt.geom.Dimension2D, java.awt.image.ImageObserver, .MultiResolutionImage, .AbstractMultiResolutionImage, java.util.Arrays, .List, java.util.function.Function, .BiFunction, java.util.stream.Collectors

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private int
private final int
private final int
private final BiFunction<Integer, Integer, Image>
private final Dimension2D[]

Constructor Summary

AccessConstructor and Description
public
MultiResolutionCachedImage(int baseImageWidth, int baseImageHeight, BiFunction<Integer, Integer, Image> mapper)

public
MultiResolutionCachedImage(int baseImageWidth, int baseImageHeight, Dimension2D[] sizes, BiFunction<Integer, Integer, Image> mapper)

private
MultiResolutionCachedImage(int baseImageWidth, int baseImageHeight, Dimension2D[] sizes, BiFunction<Integer, Integer, Image> mapper, boolean copySizes)

Method Summary

Modifier and TypeMethod and Description
private static void
checkSize(double width, double height)

protected Image
getBaseImage()

Implements abstract java.awt.image.AbstractMultiResolutionImage.getBaseImage.

Return the base image representing the best version of the image for rendering at the default width and height.

public int
getHeight(ImageObserver observer)

Overrides java.awt.image.AbstractMultiResolutionImage.getHeight.

This method simply delegates to the same method on the base image and it is equivalent to: getBaseImage().getHeight(observer).

private static int
getInfo(Image image)

public Object
getProperty(String name, ImageObserver observer)

Overrides java.awt.image.AbstractMultiResolutionImage.getProperty.

This method simply delegates to the same method on the base image and it is equivalent to: getBaseImage().getProperty(name, observer).

public Image
getResolutionVariant(double destWidth, double destHeight)

Implements java.awt.image.MultiResolutionImage.getResolutionVariant.

Gets a specific image that is the best variant to represent this logical image at the indicated size.

public List<Image>
getResolutionVariants()

Implements java.awt.image.MultiResolutionImage.getResolutionVariants.

Gets a readable list of all resolution variants.

public Image
getScaledInstance(int width, int height, int hints)

Overrides java.awt.Image.getScaledInstance.

Creates a scaled version of this image.

public int
getWidth(ImageObserver observer)

Overrides java.awt.image.AbstractMultiResolutionImage.getWidth.

This method simply delegates to the same method on the base image and it is equivalent to: getBaseImage().getWidth(observer).

public MultiResolutionCachedImage
map(Function<Image, Image> mapper)

public static Image
private static void
preload(Image image, int availableInfo)

private void
updateInfo(ImageObserver observer, int info)

Inherited from java.awt.image.AbstractMultiResolutionImage:
getGraphicsgetSource

Field Detail

availableInfoback to summary
private int availableInfo
baseImageHeightback to summary
private final int baseImageHeight
baseImageWidthback to summary
private final int baseImageWidth
mapperback to summary
private final BiFunction<Integer, Integer, Image> mapper
sizesback to summary
private final Dimension2D[] sizes

Constructor Detail

MultiResolutionCachedImageback to summary
public MultiResolutionCachedImage(int baseImageWidth, int baseImageHeight, BiFunction<Integer, Integer, Image> mapper)
MultiResolutionCachedImageback to summary
public MultiResolutionCachedImage(int baseImageWidth, int baseImageHeight, Dimension2D[] sizes, BiFunction<Integer, Integer, Image> mapper)
MultiResolutionCachedImageback to summary
private MultiResolutionCachedImage(int baseImageWidth, int baseImageHeight, Dimension2D[] sizes, BiFunction<Integer, Integer, Image> mapper, boolean copySizes)

Method Detail

checkSizeback to summary
private static void checkSize(double width, double height)
getBaseImageback to summary
protected Image getBaseImage()

Implements abstract java.awt.image.AbstractMultiResolutionImage.getBaseImage.

Doc from java.awt.image.AbstractMultiResolutionImage.getBaseImage.

Return the base image representing the best version of the image for rendering at the default width and height.

Annotations
@Override
getHeightback to summary
public int getHeight(ImageObserver observer)

Overrides java.awt.image.AbstractMultiResolutionImage.getHeight.

Doc from java.awt.image.AbstractMultiResolutionImage.getHeight.

This method simply delegates to the same method on the base image and it is equivalent to: getBaseImage().getHeight(observer).

Annotations
@Override
getInfoback to summary
private static int getInfo(Image image)
getPropertyback to summary
public Object getProperty(String name, ImageObserver observer)

Overrides java.awt.image.AbstractMultiResolutionImage.getProperty.

Doc from java.awt.image.AbstractMultiResolutionImage.getProperty.

This method simply delegates to the same method on the base image and it is equivalent to: getBaseImage().getProperty(name, observer).

Annotations
@Override
getResolutionVariantback to summary
public Image getResolutionVariant(double destWidth, double destHeight)

Implements java.awt.image.MultiResolutionImage.getResolutionVariant.

Doc from java.awt.image.MultiResolutionImage.getResolutionVariant.

Gets a specific image that is the best variant to represent this logical image at the indicated size.

Annotations
@Override
getResolutionVariantsback to summary
public List<Image> getResolutionVariants()

Implements java.awt.image.MultiResolutionImage.getResolutionVariants.

Doc from java.awt.image.MultiResolutionImage.getResolutionVariants.

Gets a readable list of all resolution variants. The list must be nonempty and contain at least one resolution variant.

Note that many implementations might return an unmodifiable list.

Annotations
@Override
getScaledInstanceback to summary
public Image getScaledInstance(int width, int height, int hints)

Overrides java.awt.Image.getScaledInstance.

Doc from java.awt.Image.getScaledInstance.

Creates a scaled version of this image. A new Image object is returned which will render the image at the specified width and height by default. The new Image object may be loaded asynchronously even if the original source image has already been loaded completely.

If either width or height is a negative number then a value is substituted to maintain the aspect ratio of the original image dimensions. If both width and height are negative, then the original image dimensions are used.

Annotations
@Override
getWidthback to summary
public int getWidth(ImageObserver observer)

Overrides java.awt.image.AbstractMultiResolutionImage.getWidth.

Doc from java.awt.image.AbstractMultiResolutionImage.getWidth.

This method simply delegates to the same method on the base image and it is equivalent to: getBaseImage().getWidth(observer).

Annotations
@Override
mapback to summary
public MultiResolutionCachedImage map(Function<Image, Image> mapper)
mapback to summary
public static Image map(MultiResolutionImage mrImage, Function<Image, Image> mapper)
preloadback to summary
private static void preload(Image image, int availableInfo)
updateInfoback to summary
private void updateInfo(ImageObserver observer, int info)
sun.awt.image back to summary

private Class MultiResolutionCachedImage.ImageCacheKey

extends Object
implements PixelsKey
Class Inheritance
All Implemented Interfaces
sun.awt.image.ImageCache.PixelsKey

Field Summary

Modifier and TypeField and Description
private final Image
private final int
h

private final int
private final int
private final int
w

Constructor Summary

AccessConstructor and Description
pack-priv
ImageCacheKey(final Image baseImage, final int w, final int h)

Method Summary

Modifier and TypeMethod and Description
public boolean
equals(Object obj)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

public int
private int
hash()

public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAlltoStringwaitwaitwait

Field Detail

baseImageback to summary
private final Image baseImage
hback to summary
private final int h
hashback to summary
private final int hash
pixelCountback to summary
private final int pixelCount
wback to summary
private final int w

Constructor Detail

ImageCacheKeyback to summary
pack-priv ImageCacheKey(final Image baseImage, final int w, final int h)

Method Detail

equalsback to summary
public boolean equals(Object obj)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Annotations
@Override
getPixelCountback to summary
public int getPixelCount()

Implements sun.awt.image.ImageCache.PixelsKey.getPixelCount.

Annotations
@Override
hashback to summary
private int hash()
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Annotations
@Override