-/* Copyright (C) 2000, 2002 Free Software Foundation
+/* Copyright (C) 2000, 2002, 2003 Free Software Foundation
This file is part of GNU Classpath.
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.
-/* Copyright (C) 2000, 2002 Free Software Foundation
+/* Copyright (C) 2000, 2002, 2003 Free Software Foundation
This file is part of GNU Classpath.
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;
-/* Copyright (C) 2000, 2002 Free Software Foundation
+/* Copyright (C) 2000, 2002, 2003 Free Software Foundation
This file is part of GNU Classpath.
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);