Class AbstractMultiResolutionImage
java.lang.Object
java.awt.Image
java.awt.image.AbstractMultiResolutionImage
- All Implemented Interfaces:
- MultiResolutionImage
- Direct Known Subclasses:
- BaseMultiResolutionImage
This class provides default implementations of several 
Image methods
 for classes that want to implement the MultiResolutionImage
 interface.
 For example,
  
 public class CustomMultiResolutionImage extends AbstractMultiResolutionImage {
     final Image[] resolutionVariants;
     public CustomMultiResolutionImage(Image... resolutionVariants) {
          this.resolutionVariants = resolutionVariants;
     }
     public Image getResolutionVariant(
             double destImageWidth, double destImageHeight) {
         // return a resolution variant based on the given destination image size
     }
     public List<Image> getResolutionVariants() {
         return Collections.unmodifiableList(Arrays.asList(resolutionVariants));
     }
     protected Image getBaseImage() {
         return resolutionVariants[0];
     }
 }
  - Since:
- 9
- See Also:
- 
Field SummaryFields declared in class java.awt.ImageaccelerationPriority, SCALE_AREA_AVERAGING, SCALE_DEFAULT, SCALE_FAST, SCALE_REPLICATE, SCALE_SMOOTH, UndefinedProperty
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedConstructor for subclasses to call.
- 
Method SummaryModifier and TypeMethodDescriptionprotected abstract ImageReturn the base image representing the best version of the image for rendering at the default width and height.As per the contract of the baseImage#getGraphics()method, this implementation will always throwUnsupportedOperationExceptionsince only off-screen images can return aGraphicsobject.intgetHeight(ImageObserver observer) This method simply delegates to the same method on the base image and it is equivalent to:getBaseImage().getHeight(observer).getProperty(String name, ImageObserver observer) This method simply delegates to the same method on the base image and it is equivalent to:getBaseImage().getProperty(name, observer).This method simply delegates to the same method on the base image and it is equivalent to:getBaseImage().getSource().intgetWidth(ImageObserver observer) This method simply delegates to the same method on the base image and it is equivalent to:getBaseImage().getWidth(observer).Methods declared in class java.awt.Imageflush, getAccelerationPriority, getCapabilities, getScaledInstance, setAccelerationPriorityMethods declared in class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods declared in interface java.awt.image.MultiResolutionImagegetResolutionVariant, getResolutionVariants
- 
Constructor Details- 
AbstractMultiResolutionImageprotected AbstractMultiResolutionImage()Constructor for subclasses to call.
 
- 
- 
Method Details- 
getWidthThis method simply delegates to the same method on the base image and it is equivalent to:getBaseImage().getWidth(observer).
- 
getHeightThis method simply delegates to the same method on the base image and it is equivalent to:getBaseImage().getHeight(observer).
- 
getSourceThis method simply delegates to the same method on the base image and it is equivalent to:getBaseImage().getSource().
- 
getGraphicsAs per the contract of the baseImage#getGraphics()method, this implementation will always throwUnsupportedOperationExceptionsince only off-screen images can return aGraphicsobject.- Specified by:
- getGraphicsin class- Image
- Returns:
- throws UnsupportedOperationException
- Throws:
- UnsupportedOperationException- this method is not supported
- See Also:
 
- 
getPropertyThis method simply delegates to the same method on the base image and it is equivalent to:getBaseImage().getProperty(name, observer).- Specified by:
- getPropertyin class- Image
- Parameters:
- name- a property name.
- observer- an object waiting for this image to be loaded.
- Returns:
- the value of the named property in the base image
- Since:
- 9
- See Also:
 
- 
getBaseImageReturn the base image representing the best version of the image for rendering at the default width and height.- Returns:
- the base image of the set of multi-resolution images
- Since:
- 9
 
 
-