From 23f0ecff4a6e9c554e4ddddf59d022e632810a72 Mon Sep 17 00:00:00 2001 From: Michael Koch Date: Tue, 20 Apr 2004 11:13:09 +0000 Subject: [multiple changes] 2004-04-20 Ingo Proetel * java/awt/FontMetrics.java: (charsWidth): fixed accumulation of total_width (getWidth): simple default implementation * java/awt/Polygon.java (getBoundingBox): Use correct y-coordinate in Rectangle constructor. * java/awt/image/Raster.java (toString): Added method. * java/awt/image/SampleModel.java (): Added error cause information to thrown exception. * java/awt/image/SinglePixelPackedSampleModel.java (getDataElements): New method. (setDataElements): New method. (setPixels): New method. (toString): New method. 2004-04-20 Sascha Brawer * java/awt/image/ComponentColorModel.java (createCompatibleSampleModel): Return PixelInterleavedSampleModel for TYPE_BYTE and TYPE_USHORT transferTypes, in order to pass the Mauve tests on this method. Improved documentation. From-SVN: r80894 --- libjava/java/awt/image/SampleModel.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'libjava/java/awt/image/SampleModel.java') diff --git a/libjava/java/awt/image/SampleModel.java b/libjava/java/awt/image/SampleModel.java index 219a871..a5d65ff 100644 --- a/libjava/java/awt/image/SampleModel.java +++ b/libjava/java/awt/image/SampleModel.java @@ -58,7 +58,9 @@ public abstract class SampleModel public SampleModel(int dataType, int w, int h, int numBands) { - if ((w<=0) || (h<=0)) throw new IllegalArgumentException(); + if ((w <= 0) || (h <= 0)) + throw new IllegalArgumentException((w <= 0 ? " width<=0" : " width is ok") + +(h <= 0 ? " height<=0" : " height is ok")); // FIXME: How can an int be greater than Integer.MAX_VALUE? // FIXME: How do we identify an unsupported data type? @@ -68,7 +70,7 @@ public abstract class SampleModel this.height = h; this.numBands = numBands; } - + public final int getWidth() { return width; -- cgit v1.1