diff options
author | Sascha Brawer <brawer@dandelis.ch> | 2003-09-25 18:35:44 +0000 |
---|---|---|
committer | Michael Koch <mkoch@gcc.gnu.org> | 2003-09-25 18:35:44 +0000 |
commit | 864135da898c0f5cfcec8812a3a2f4f8404bd776 (patch) | |
tree | e04f806d40f3612b7ee39b29f06043340429b451 /libjava | |
parent | 2ccba5f0f4ef42e118e11cfa60cac5b8669ee606 (diff) | |
download | gcc-864135da898c0f5cfcec8812a3a2f4f8404bd776.zip gcc-864135da898c0f5cfcec8812a3a2f4f8404bd776.tar.gz gcc-864135da898c0f5cfcec8812a3a2f4f8404bd776.tar.bz2 |
Really commit the files.
From-SVN: r71790
Diffstat (limited to 'libjava')
-rw-r--r-- | libjava/java/awt/image/BufferedImage.java | 18 | ||||
-rw-r--r-- | libjava/java/awt/image/Raster.java | 13 | ||||
-rw-r--r-- | libjava/java/awt/image/WritableRaster.java | 5 |
3 files changed, 28 insertions, 8 deletions
diff --git a/libjava/java/awt/image/BufferedImage.java b/libjava/java/awt/image/BufferedImage.java index 8c6ead2..52006c0 100644 --- a/libjava/java/awt/image/BufferedImage.java +++ b/libjava/java/awt/image/BufferedImage.java @@ -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. diff --git a/libjava/java/awt/image/Raster.java b/libjava/java/awt/image/Raster.java index 1b3d2f0..ff6033a 100644 --- a/libjava/java/awt/image/Raster.java +++ b/libjava/java/awt/image/Raster.java @@ -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; diff --git a/libjava/java/awt/image/WritableRaster.java b/libjava/java/awt/image/WritableRaster.java index a886440..f735001 100644 --- a/libjava/java/awt/image/WritableRaster.java +++ b/libjava/java/awt/image/WritableRaster.java @@ -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); |