This adds one missing method in GraphicsConfiguration and provides a
default impl for another one.

2007-02-10  Roman Kennke  <[EMAIL PROTECTED]>

        * java/awt/GraphicsConfiguration.java
        (createCompatibleVolatileImage(int,int,ImageCapabilities): Provide
        default implementation that delegates to
        createCompatibleVolatileImage(int,int).
        (createCompatibleVolatileImage(int,int,ImageCapabilities,int):
        New method from JDK5 spec. Default implementation by delegating to
        (createCompatibleVolatileImage(int,int,int).

/Roman

Index: java/awt/GraphicsConfiguration.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/awt/GraphicsConfiguration.java,v
retrieving revision 1.10
diff -u -1 -5 -r1.10 GraphicsConfiguration.java
--- java/awt/GraphicsConfiguration.java	17 May 2006 16:42:28 -0000	1.10
+++ java/awt/GraphicsConfiguration.java	10 Feb 2007 13:23:38 -0000
@@ -26,32 +26,30 @@
 As a special exception, the copyright holders of this library give you
 permission to link this library with independent modules to produce an
 executable, regardless of the license terms of these independent
 modules, and to copy and distribute the resulting executable under
 terms of your choice, provided that you also meet, for each linked
 independent module, the terms and conditions of the license of that
 module.  An independent module is a module which is not derived from
 or based on this library.  If you modify this library, you may extend
 this exception to your version of the library, but you are not
 obligated to do so.  If you do not wish to do so, delete this
 exception statement from your version. */
 
 
 package java.awt;
 
-import gnu.classpath.NotImplementedException;
-
 import java.awt.geom.AffineTransform;
 import java.awt.image.BufferedImage;
 import java.awt.image.ColorModel;
 import java.awt.image.VolatileImage;
 
 /**
  * This class describes the configuration of various graphics devices, such
  * as a monitor or printer. Different configurations may exist for the same
  * device, according to the different native modes supported.
  *
  * <p>Virtual devices are supported (for example, in a multiple screen
  * environment, a virtual device covers all screens simultaneously); the
  * configuration will have a non-zero relative coordinate system in such
  * a case.
  *
@@ -119,49 +117,76 @@
    * given capabilities, so that blitting can be supported in the buffered
    * image. Because the buffer is volatile, it can be optimized by native
    * graphics accelerators.
    *
    * @param w the width of the buffer
    * @param h the height of the buffer
    * @param caps the desired capabilities of the image buffer
    * @return the buffered image, or null if none is supported
    * @throws AWTException if the capabilities cannot be met
    * @since 1.4
    */
   public VolatileImage createCompatibleVolatileImage(int w, int h,
                                                      ImageCapabilities caps)
     throws AWTException
   {
-    throw new AWTException("not implemented");
+    // Must be overridden by implementations to check caps.
+    return createCompatibleVolatileImage(w, h);
   }
 
   /**
    * Returns a buffered volatile image optimized to this device, and
    * with the given transparency. Because the buffer is volatile, it
    * can be optimized by native graphics accelerators.
    *
    * @param width the width of the buffer
    * @param height the height of the buffer
    * @param transparency the transparency value for the buffer
    * @return the buffered image, or null if none is supported
    * @since 1.5
    */
   public abstract VolatileImage createCompatibleVolatileImage(int width,
                                                               int height,
                                                               int transparency);
 
   /**
+   * Creates a volatile image with the specified capabilities and transparency.
+   * If the backend cannot meet the requested capabilities and transparency,
+   * an AWTException is thrown.
+   *
+   * @param width the width of the image
+   * @param height the height of the image
+   * @param caps the requested capabilities
+   * @param transparency the required transparency
+   *
+   * @return a volatile image with the specified capabilites and transparency
+   *
+   * @throws AWTException if the required capabilities and transparency cannot
+   *         be met
+   *
+   * @since 1.5
+   */
+  public VolatileImage createCompatibleVolatileImage(int width, int height,
+                                                     ImageCapabilities caps,
+                                                     int transparency)
+    throws AWTException
+  {
+    // Must be overridden by implementations to check caps.
+    return createCompatibleVolatileImage(width, height, transparency);
+  }
+
+  /**
    * Returns a buffered image optimized to this device, and with the specified
    * transparency, so that blitting can be supported in the buffered image.
    *
    * @param w the width of the buffer
    * @param h the height of the buffer
    * @param transparency the transparency of the buffer
    * @return the buffered image, or null if none is supported
    * @see Transparency#OPAQUE
    * @see Transparency#BITMASK
    * @see Transparency#TRANSLUCENT
    */
   public abstract BufferedImage createCompatibleImage(int w, int h,
                                                       int transparency);
 
   /**

Reply via email to