OSDN Git Service

Merged gcj-eclipse branch to trunk.
[pf3gnuchains/gcc-fork.git] / libjava / classpath / java / awt / GraphicsConfiguration.java
index 069d741..792b2cc 100644 (file)
@@ -38,6 +38,8 @@ 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;
@@ -63,6 +65,13 @@ import java.awt.image.VolatileImage;
  */
 public abstract class GraphicsConfiguration
 {
+  
+  /** The cached image capabilities. */
+  private ImageCapabilities imageCapabilities;
+  
+  /** The cached buffer capabilities. */
+  private BufferCapabilities bufferCapabilities;
+  
   /**
    * The default constructor.
    *
@@ -130,11 +139,10 @@ public abstract class GraphicsConfiguration
    * with the given transparency. 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 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
-   * @throws AWTException if the capabilities cannot be met
    * @since 1.5
    */
   public abstract VolatileImage createCompatibleVolatileImage(int width,
@@ -218,7 +226,13 @@ public abstract class GraphicsConfiguration
    */
   public BufferCapabilities getBufferCapabilities()
   {
-    throw new Error("not implemented");
+    if (imageCapabilities == null)
+      getImageCapabilities();
+    
+    if (bufferCapabilities == null)
+      bufferCapabilities = new BufferCapabilities(imageCapabilities,
+                                                  imageCapabilities, null);
+    return bufferCapabilities;
   }
 
   /**
@@ -229,6 +243,8 @@ public abstract class GraphicsConfiguration
    */
   public ImageCapabilities getImageCapabilities()
   {
-    throw new Error("not implemented");
+    if (imageCapabilities == null)
+      imageCapabilities = new ImageCapabilities(false);
+    return imageCapabilities;
   }
 } // class GraphicsConfiguration