Really commit the files.
authorSascha Brawer <brawer@dandelis.ch>
Thu, 25 Sep 2003 18:35:44 +0000 (18:35 +0000)
committerMichael Koch <mkoch@gcc.gnu.org>
Thu, 25 Sep 2003 18:35:44 +0000 (18:35 +0000)
From-SVN: r71790

libjava/java/awt/image/BufferedImage.java
libjava/java/awt/image/Raster.java
libjava/java/awt/image/WritableRaster.java

index 8c6ead242a566814c65fc81bbd372548b2b2e835..52006c099c14ccb698ded1bccab7414be17620aa 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2002  Free Software Foundation
+/* Copyright (C) 2000, 2002, 2003  Free Software Foundation
 
 This file is part of GNU Classpath.
 
@@ -589,10 +589,22 @@ public class BufferedImage extends Image
     
   public String toString()
   {
-    // FIXME: implement:
-    return super.toString();
+    StringBuffer buf;
+
+    buf = new StringBuffer(/* estimated length */ 120);
+    buf.append("BufferedImage@");
+    buf.append(Integer.toHexString(hashCode()));
+    buf.append(": type=");
+    buf.append(type);
+    buf.append(' ');
+    buf.append(colorModel);
+    buf.append(' ');
+    buf.append(raster);
+
+    return buf.toString();
   }
 
+
   /**
    * Adds a tile observer. If the observer is already present, it receives
    * multiple notifications.
index 1b3d2f03ddf37e723fe7e59ef6cd112e6fd9abad..ff6033a6a036b147629f9affb0a667caa301c7c3 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2002  Free Software Foundation
+/* Copyright (C) 2000, 2002, 2003  Free Software Foundation
 
 This file is part of GNU Classpath.
 
@@ -81,8 +81,15 @@ public class Raster
     this.minY = aRegion.y;
     this.width = aRegion.width;
     this.height = aRegion.height;
-    this.sampleModelTranslateX = sampleModelTranslate.x;
-    this.sampleModelTranslateY = sampleModelTranslate.y;
+    
+    // If sampleModelTranslate is null, use (0,0).  Methods such as
+    // Raster.createRaster are specified to allow for a null argument.
+    if (sampleModelTranslate != null)
+    {
+      this.sampleModelTranslateX = sampleModelTranslate.x;
+      this.sampleModelTranslateY = sampleModelTranslate.y;
+    }
+
     this.numBands = sampleModel.getNumBands();
     this.numDataElements = sampleModel.getNumDataElements();
     this.parent = parent;
index a8864408e706a2fab92e02b1be9e856d26ce9536..f735001e91596d4713e13407f4a2580cf43d79d1 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2002  Free Software Foundation
+/* Copyright (C) 2000, 2002, 2003  Free Software Foundation
 
 This file is part of GNU Classpath.
 
@@ -54,7 +54,8 @@ public class WritableRaster extends Raster
                           DataBuffer dataBuffer, Point origin)
   {
     this(sampleModel, dataBuffer,
-        new Rectangle(origin.x, origin.y,
+        new Rectangle(origin != null ? origin.x : 0,
+                       origin != null ? origin.y : 0,
                       sampleModel.getWidth(), sampleModel.getHeight()),
         origin,
         null);