< prev index next >

jdk/src/java.desktop/share/classes/java/awt/image/MultiResolutionImage.java

Print this page




  35  * of this interface if it is implemented on the argument {@code Image} object
  36  * in order to choose the best representation to use for each rendering operation.
  37  * <p>
  38  * The {@code MultiResolutionImage} interface should be implemented by any
  39  * subclass of {@code java.awt.Image} whose instances are intended to provide
  40  * image resolution variants according to the given image width and height.
  41  * For convenience, toolkit images obtained from
  42  * {@code Toolkit.getImage(String name)} and {@code Toolkit.getImage(URL url)}
  43  * will implement this interface on platforms that support naming conventions
  44  * for resolution variants of stored image media and the
  45  * {@code AbstractMultiResolutionImage} and {@code BaseMultiResolutionImage}
  46  * classes are provided to facilitate easy construction of custom multi-resolution
  47  * images from a list of related images.
  48  *
  49  * @see java.awt.Image
  50  * @see java.awt.image.AbstractMultiResolutionImage
  51  * @see java.awt.image.BaseMultiResolutionImage
  52  * @see java.awt.Toolkit#getImage(java.lang.String filename)
  53  * @see java.awt.Toolkit#getImage(java.net.URL url)
  54  *
  55  * @since 1.9
  56  */
  57 public interface MultiResolutionImage {
  58 
  59     /**
  60      * Gets a specific image that is the best variant to represent
  61      * this logical image at the indicated size.
  62      *
  63      * @param destImageWidth the width of the destination image, in pixels.
  64      * @param destImageHeight the height of the destination image, in pixels.
  65      * @return image resolution variant.
  66      * @throws IllegalArgumentException if {@code destImageWidth} or
  67      *         {@code destImageHeight} is less than or equal to zero, infinity,
  68      *         or NaN.
  69      *
  70      * @since 1.9
  71      */
  72     Image getResolutionVariant(double destImageWidth, double destImageHeight);
  73 
  74     /**
  75      * Gets a readable list of all resolution variants.
  76      * The list must be nonempty and contain at least one resolution variant.
  77      * <p>
  78      * Note that many implementations might return an unmodifiable list.
  79      * <p>
  80      * @return list of resolution variants.
  81      * @since 1.9
  82      */
  83     public List<Image> getResolutionVariants();


  35  * of this interface if it is implemented on the argument {@code Image} object
  36  * in order to choose the best representation to use for each rendering operation.
  37  * <p>
  38  * The {@code MultiResolutionImage} interface should be implemented by any
  39  * subclass of {@code java.awt.Image} whose instances are intended to provide
  40  * image resolution variants according to the given image width and height.
  41  * For convenience, toolkit images obtained from
  42  * {@code Toolkit.getImage(String name)} and {@code Toolkit.getImage(URL url)}
  43  * will implement this interface on platforms that support naming conventions
  44  * for resolution variants of stored image media and the
  45  * {@code AbstractMultiResolutionImage} and {@code BaseMultiResolutionImage}
  46  * classes are provided to facilitate easy construction of custom multi-resolution
  47  * images from a list of related images.
  48  *
  49  * @see java.awt.Image
  50  * @see java.awt.image.AbstractMultiResolutionImage
  51  * @see java.awt.image.BaseMultiResolutionImage
  52  * @see java.awt.Toolkit#getImage(java.lang.String filename)
  53  * @see java.awt.Toolkit#getImage(java.net.URL url)
  54  *
  55  * @since 9
  56  */
  57 public interface MultiResolutionImage {
  58 
  59     /**
  60      * Gets a specific image that is the best variant to represent
  61      * this logical image at the indicated size.
  62      *
  63      * @param destImageWidth the width of the destination image, in pixels.
  64      * @param destImageHeight the height of the destination image, in pixels.
  65      * @return image resolution variant.
  66      * @throws IllegalArgumentException if {@code destImageWidth} or
  67      *         {@code destImageHeight} is less than or equal to zero, infinity,
  68      *         or NaN.
  69      *
  70      * @since 9
  71      */
  72     Image getResolutionVariant(double destImageWidth, double destImageHeight);
  73 
  74     /**
  75      * Gets a readable list of all resolution variants.
  76      * The list must be nonempty and contain at least one resolution variant.
  77      * <p>
  78      * Note that many implementations might return an unmodifiable list.
  79      * <p>
  80      * @return list of resolution variants.
  81      * @since 9
  82      */
  83     public List<Image> getResolutionVariants();
< prev index next >