harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r470895 [3/3] - in /incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt: geom/ im/ image/ image/renderable/ print/
Date Fri, 03 Nov 2006 16:45:03 GMT
Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/image/Raster.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/image/Raster.java?view=diff&rev=470895&r1=470894&r2=470895
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/image/Raster.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/image/Raster.java Fri Nov  3 08:45:01 2006
@@ -24,6 +24,7 @@
 import java.awt.Rectangle;
 
 import org.apache.harmony.awt.gl.image.OrdinaryWritableRaster;
+import org.apache.harmony.awt.internal.nls.Messages;
 
 
 public class Raster {
@@ -55,8 +56,8 @@
             int bandOffsets[], Point location) {
 
         if (w <= 0 || h <= 0) {
-            throw new RasterFormatException("w or h is less than or "
-                    + "equal to zero");
+            // awt.22E=w or h is less than or equal to zero
+            throw new RasterFormatException(Messages.getString("awt.22E")); //$NON-NLS-1$
         }
 
         if (location == null) {
@@ -65,17 +66,18 @@
 
         if ((long) location.x + w > Integer.MAX_VALUE
                 || (long) location.y + h > Integer.MAX_VALUE) {
-            throw new RasterFormatException("location.x + w or "
-                    + "location.y + h results in integer overflow");
+            // awt.276=location.x + w or location.y + h results in integer overflow
+            throw new RasterFormatException(Messages.getString("awt.276")); //$NON-NLS-1$
         }
 
         if (bankIndices == null || bandOffsets == null) {
-            throw new ArrayIndexOutOfBoundsException("bankIndices or "
-                    + "bandOffsets is null");
+            // awt.277=bankIndices or bandOffsets is null
+            throw new ArrayIndexOutOfBoundsException(Messages.getString("awt.277")); //$NON-NLS-1$
         }
 
         if (dataBuffer == null) {
-            throw new NullPointerException("dataBuffer is null");
+            // awt.278=dataBuffer is null
+            throw new NullPointerException(Messages.getString("awt.278")); //$NON-NLS-1$
         }
 
         int dataType = dataBuffer.getDataType();
@@ -83,8 +85,8 @@
         if (dataType != DataBuffer.TYPE_BYTE
                 && dataType != DataBuffer.TYPE_USHORT
                 && dataType != DataBuffer.TYPE_INT) {
-            throw new IllegalArgumentException("dataType is not one "
-                    + "of the supported data types");
+            // awt.230=dataType is not one of the supported data types
+            throw new IllegalArgumentException(Messages.getString("awt.230")); //$NON-NLS-1$
         }
 
         BandedSampleModel sampleModel = new BandedSampleModel(dataType, w, h,
@@ -98,8 +100,8 @@
             Point location) {
 
         if (w <= 0 || h <= 0) {
-            throw new RasterFormatException("w or h is less than or "
-                    + "equal to zero");
+            // awt.22E=w or h is less than or equal to zero
+            throw new RasterFormatException(Messages.getString("awt.22E")); //$NON-NLS-1$
         }
 
         if (location == null) {
@@ -108,20 +110,20 @@
 
         if ((long) location.x + w > Integer.MAX_VALUE
                 || (long) location.y + h > Integer.MAX_VALUE) {
-            throw new RasterFormatException("location.x + w or location.y + "
-                    + "h results in integer overflow");
+            // awt.276=location.x + w or location.y + h results in integer overflow
+            throw new RasterFormatException(Messages.getString("awt.276")); //$NON-NLS-1$
         }
 
         if (bankIndices == null || bandOffsets == null) {
-            throw new ArrayIndexOutOfBoundsException("bankIndices or "
-                    + "bandOffsets is null");
+            // awt.277=bankIndices or bandOffsets is null
+            throw new ArrayIndexOutOfBoundsException(Messages.getString("awt.277")); //$NON-NLS-1$
         }
 
         if (dataType != DataBuffer.TYPE_BYTE
                 && dataType != DataBuffer.TYPE_USHORT
                 && dataType != DataBuffer.TYPE_INT) {
-            throw new IllegalArgumentException("dataType is not one of "
-                    + "the supported data types");
+            // awt.230=dataType is not one of the supported data types
+            throw new IllegalArgumentException(Messages.getString("awt.230")); //$NON-NLS-1$
         }
 
         int maxOffset = bandOffsets[0];
@@ -160,8 +162,8 @@
             int bands, Point location) {
 
         if (w <= 0 || h <= 0) {
-            throw new RasterFormatException("w or h is less than "
-                    + "or equal to zero");
+            // awt.22E=w or h is less than or equal to zero
+            throw new RasterFormatException(Messages.getString("awt.22E")); //$NON-NLS-1$
         }
 
         if (location == null) {
@@ -170,12 +172,13 @@
 
         if ((long) location.x + w > Integer.MAX_VALUE
                 || (long) location.y + h > Integer.MAX_VALUE) {
-            throw new RasterFormatException("location.x + w or location.y + "
-                    + "h results in integer overflow");
+            // awt.276=location.x + w or location.y + h results in integer overflow
+            throw new RasterFormatException(Messages.getString("awt.276")); //$NON-NLS-1$
         }
 
         if (bands < 1) {
-            throw new ArrayIndexOutOfBoundsException("bands is less than 1");
+            // awt.279=bands is less than 1
+            throw new ArrayIndexOutOfBoundsException(Messages.getString("awt.279")); //$NON-NLS-1$
         }
 
         int bandOffsets[] = new int[bands];
@@ -194,8 +197,8 @@
             int bandOffsets[], Point location) {
 
         if (w <= 0 || h <= 0) {
-            throw new RasterFormatException("w or h is less than or "
-                    + "equal to zero");
+            // awt.22E=w or h is less than or equal to zero
+            throw new RasterFormatException(Messages.getString("awt.22E")); //$NON-NLS-1$
         }
 
         if (location == null) {
@@ -204,28 +207,30 @@
 
         if ((long) location.x + w > Integer.MAX_VALUE
                 || (long) location.y + h > Integer.MAX_VALUE) {
-            throw new RasterFormatException("location.x + w or location.y "
-                    + "+ h results in integer overflow");
+            // awt.276=location.x + w or location.y + h results in integer overflow
+            throw new RasterFormatException(Messages.getString("awt.276")); //$NON-NLS-1$
         }
 
         if (dataBuffer == null) {
-            throw new NullPointerException("dataBuffer is null");
+            // awt.278=dataBuffer is null
+            throw new NullPointerException(Messages.getString("awt.278")); //$NON-NLS-1$
         }
 
         int dataType = dataBuffer.getDataType();
         if (dataType != DataBuffer.TYPE_BYTE
                 && dataType != DataBuffer.TYPE_USHORT) {
-            throw new IllegalArgumentException("dataType is not one of "
-                    + "the supported data types");
+            // awt.230=dataType is not one of the supported data types
+            throw new IllegalArgumentException(Messages.getString("awt.230")); //$NON-NLS-1$
         }
 
         if (dataBuffer.getNumBanks() > 1) {
-            throw new RasterFormatException("dataBuffer has more "
-                    + "than one bank");
+            // awt.27A=dataBuffer has more than one bank
+            throw new RasterFormatException(Messages.getString("awt.27A")); //$NON-NLS-1$
         }
 
         if (bandOffsets == null) {
-            throw new NullPointerException("bandOffsets is null");
+            // awt.27B=bandOffsets is null
+            throw new NullPointerException(Messages.getString("awt.27B")); //$NON-NLS-1$
         }
 
         PixelInterleavedSampleModel sampleModel = 
@@ -240,8 +245,8 @@
             Point location) {
 
         if (w <= 0 || h <= 0) {
-            throw new RasterFormatException("w or h is less than or "
-                    + "equal to zero");
+            // awt.22E=w or h is less than or equal to zero
+            throw new RasterFormatException(Messages.getString("awt.22E")); //$NON-NLS-1$
         }
 
         if (location == null) {
@@ -250,18 +255,19 @@
 
         if ((long) location.x + w > Integer.MAX_VALUE
                 || (long) location.y + h > Integer.MAX_VALUE) {
-            throw new RasterFormatException("location.x + w or location.y + "
-                    + "h results in integer overflow");
+            // awt.276=location.x + w or location.y + h results in integer overflow
+            throw new RasterFormatException(Messages.getString("awt.276")); //$NON-NLS-1$
         }
 
         if (dataType != DataBuffer.TYPE_BYTE
                 && dataType != DataBuffer.TYPE_USHORT) {
-            throw new IllegalArgumentException("dataType is not one of "
-                    + "the supported data types");
+            // awt.230=dataType is not one of the supported data types
+            throw new IllegalArgumentException(Messages.getString("awt.230")); //$NON-NLS-1$
         }
 
         if (bandOffsets == null) {
-            throw new NullPointerException("bandOffsets is null");
+            // awt.27B=bandOffsets is null
+            throw new NullPointerException(Messages.getString("awt.27B")); //$NON-NLS-1$
         }
 
         int minOffset = bandOffsets[0];
@@ -290,8 +296,8 @@
             int h, int bands, Point location) {
 
         if (w <= 0 || h <= 0) {
-            throw new RasterFormatException("w or h is less than or "
-                    + "equal to zero");
+            // awt.22E=w or h is less than or equal to zero
+            throw new RasterFormatException(Messages.getString("awt.22E")); //$NON-NLS-1$
         }
 
         if (location == null) {
@@ -300,14 +306,14 @@
 
         if ((long) location.x + w > Integer.MAX_VALUE
                 || (long) location.y + h > Integer.MAX_VALUE) {
-            throw new RasterFormatException("location.x + w or location.y + "
-                    + "h results in integer overflow");
+            // awt.276=location.x + w or location.y + h results in integer overflow
+            throw new RasterFormatException(Messages.getString("awt.276")); //$NON-NLS-1$
         }
 
         if (dataType != DataBuffer.TYPE_BYTE
                 && dataType != DataBuffer.TYPE_USHORT) {
-            throw new IllegalArgumentException("dataType is not one of "
-                    + "the supported data types");
+            // awt.230=dataType is not one of the supported data types
+            throw new IllegalArgumentException(Messages.getString("awt.230")); //$NON-NLS-1$
         }
 
         int bandOffsets[] = new int[bands];
@@ -323,8 +329,8 @@
             int w, int h, int scanlineStride, int bandMasks[], Point location) {
 
         if (w <= 0 || h <= 0) {
-            throw new RasterFormatException("w or h is less than or "
-                    + "equal to zero");
+            // awt.22E=w or h is less than or equal to zero
+            throw new RasterFormatException(Messages.getString("awt.22E")); //$NON-NLS-1$
         }
 
         if (location == null) {
@@ -333,28 +339,31 @@
 
         if ((long) location.x + w > Integer.MAX_VALUE
                 || (long) location.y + h > Integer.MAX_VALUE) {
-            throw new RasterFormatException("location.x + w or location.y + "
-                    + "h results in integer overflow");
+            // awt.276=location.x + w or location.y + h results in integer overflow
+            throw new RasterFormatException(Messages.getString("awt.276")); //$NON-NLS-1$
         }
 
         if (bandMasks == null) {
-            throw new RasterFormatException("bandMasks is null");
+            // awt.27C=bandMasks is null
+            throw new RasterFormatException(Messages.getString("awt.27C")); //$NON-NLS-1$
         }
 
         if (dataBuffer == null) {
-            throw new NullPointerException("dataBuffer is null");
+            // awt.278=dataBuffer is null
+            throw new NullPointerException(Messages.getString("awt.278")); //$NON-NLS-1$
         }
 
         if (dataBuffer.getNumBanks() > 1) {
-            throw new RasterFormatException("dataBuffer has more than one bank");
+            // awt.27A=dataBuffer has more than one bank
+            throw new RasterFormatException(Messages.getString("awt.27A")); //$NON-NLS-1$
         }
 
         int dataType = dataBuffer.getDataType();
         if (dataType != DataBuffer.TYPE_BYTE
                 && dataType != DataBuffer.TYPE_USHORT
                 && dataType != DataBuffer.TYPE_INT) {
-            throw new IllegalArgumentException("dataType is not one of "
-                    + "the supported data types");
+            // awt.230=dataType is not one of the supported data types
+            throw new IllegalArgumentException(Messages.getString("awt.230")); //$NON-NLS-1$
         }
 
         SinglePixelPackedSampleModel sampleModel = 
@@ -368,8 +377,8 @@
             int w, int h, int bitsPerPixel, Point location) {
 
         if (w <= 0 || h <= 0) {
-            throw new RasterFormatException("w or h is less than or "
-                    + "equal to zero");
+            // awt.22E=w or h is less than or equal to zero
+            throw new RasterFormatException(Messages.getString("awt.22E")); //$NON-NLS-1$
         }
 
         if (location == null) {
@@ -378,24 +387,26 @@
 
         if ((long) location.x + w > Integer.MAX_VALUE
                 || (long) location.y + h > Integer.MAX_VALUE) {
-            throw new RasterFormatException("location.x + w or location.y "
-                    + "+ h results in integer overflow");
+            // awt.276=location.x + w or location.y + h results in integer overflow
+            throw new RasterFormatException(Messages.getString("awt.276")); //$NON-NLS-1$
         }
 
         if (dataBuffer == null) {
-            throw new NullPointerException("dataBuffer is null");
+            // awt.278=dataBuffer is null
+            throw new NullPointerException(Messages.getString("awt.278")); //$NON-NLS-1$
         }
 
         if (dataBuffer.getNumBanks() > 1) {
-            throw new RasterFormatException("dataBuffer has more than one bank");
+            // awt.27A=dataBuffer has more than one bank
+            throw new RasterFormatException(Messages.getString("awt.27A")); //$NON-NLS-1$
         }
 
         int dataType = dataBuffer.getDataType();
         if (dataType != DataBuffer.TYPE_BYTE
                 && dataType != DataBuffer.TYPE_USHORT
                 && dataType != DataBuffer.TYPE_INT) {
-            throw new IllegalArgumentException("dataType is not one of "
-                    + "the supported data types");
+            // awt.230=dataType is not one of the supported data types
+            throw new IllegalArgumentException(Messages.getString("awt.230")); //$NON-NLS-1$
         }
 
         MultiPixelPackedSampleModel sampleModel = 
@@ -408,8 +419,8 @@
             int bands, int bitsPerBand, Point location) {
 
         if (w <= 0 || h <= 0) {
-            throw new RasterFormatException("w or h is less than or "
-                    + "equal to zero");
+            // awt.22E=w or h is less than or equal to zero
+            throw new RasterFormatException(Messages.getString("awt.22E")); //$NON-NLS-1$
         }
 
         if (location == null) {
@@ -418,26 +429,25 @@
 
         if ((long) location.x + w > Integer.MAX_VALUE
                 || (long) location.y + h > Integer.MAX_VALUE) {
-            throw new RasterFormatException("location.x + w or location.y + "
-                    + "h results in integer overflow");
+            // awt.276=location.x + w or location.y + h results in integer overflow
+            throw new RasterFormatException(Messages.getString("awt.276")); //$NON-NLS-1$
         }
 
         if (bands < 1 || bitsPerBand < 1) {
-            throw new IllegalArgumentException("bitsPerBand or bands is "
-                    + "not greater than zero");
+            // awt.27D=bitsPerBand or bands is not greater than zero
+            throw new IllegalArgumentException(Messages.getString("awt.27D")); //$NON-NLS-1$
         }
 
         if (dataType != DataBuffer.TYPE_BYTE
                 && dataType != DataBuffer.TYPE_USHORT
                 && dataType != DataBuffer.TYPE_INT) {
-            throw new IllegalArgumentException("dataType is not one of "
-                    + "the supported data types");
+            // awt.230=dataType is not one of the supported data types
+            throw new IllegalArgumentException(Messages.getString("awt.230")); //$NON-NLS-1$
         }
 
         if (bitsPerBand * bands > DataBuffer.getDataTypeSize(dataType)) {
-            throw new IllegalArgumentException("The product of bitsPerBand "
-                    + "and bands is greater than the number of bits held by "
-                    + "dataType ");
+            // awt.27E=The product of bitsPerBand and bands is greater than the number of bits held by dataType
+            throw new IllegalArgumentException(Messages.getString("awt.27E")); //$NON-NLS-1$
         }
 
         if (bands > 1) {
@@ -474,8 +484,8 @@
             int bandMasks[], Point location) {
 
         if (w <= 0 || h <= 0) {
-            throw new RasterFormatException("w or h is less than or "
-                    + "equal to zero");
+            // awt.22E=w or h is less than or equal to zero
+            throw new RasterFormatException(Messages.getString("awt.22E")); //$NON-NLS-1$
         }
 
         if (location == null) {
@@ -484,19 +494,20 @@
 
         if ((long) location.x + w > Integer.MAX_VALUE
                 || (long) location.y + h > Integer.MAX_VALUE) {
-            throw new RasterFormatException("location.x + w or location.y + "
-                    + "h results in integer overflow");
+            // awt.276=location.x + w or location.y + h results in integer overflow
+            throw new RasterFormatException(Messages.getString("awt.276")); //$NON-NLS-1$
         }
 
         if (bandMasks == null) {
-            throw new RasterFormatException("bandMasks is null");
+            // awt.27C=bandMasks is null
+            throw new RasterFormatException(Messages.getString("awt.27C")); //$NON-NLS-1$
         }
 
         if (dataType != DataBuffer.TYPE_BYTE
                 && dataType != DataBuffer.TYPE_USHORT
                 && dataType != DataBuffer.TYPE_INT) {
-            throw new IllegalArgumentException("dataType is not one of "
-                    + "the supported data types");
+            // awt.230=dataType is not one of the supported data types
+            throw new IllegalArgumentException(Messages.getString("awt.230")); //$NON-NLS-1$
         }
 
         DataBuffer data = null;
@@ -520,7 +531,8 @@
             Point location) {
 
         if (sm == null || db == null) {
-            throw new NullPointerException("SampleModel or DataBuffer is null");
+            // awt.27F=SampleModel or DataBuffer is null
+            throw new NullPointerException(Messages.getString("awt.27F")); //$NON-NLS-1$
         }
 
         if (location == null) {
@@ -534,7 +546,8 @@
             DataBuffer db, Point location) {
 
         if (sm == null || db == null) {
-            throw new NullPointerException("SampleModel or DataBuffer is null");
+            // awt.27F=SampleModel or DataBuffer is null
+            throw new NullPointerException(Messages.getString("awt.27F")); //$NON-NLS-1$
         }
 
         if (location == null) {
@@ -548,7 +561,8 @@
             Point location) {
 
         if (sm == null) {
-            throw new NullPointerException("SampleModel is null");
+            // awt.280=SampleModel is null
+            throw new NullPointerException(Messages.getString("awt.280")); //$NON-NLS-1$
         }
 
         if (location == null) {
@@ -570,21 +584,23 @@
 
         if (sampleModel == null || dataBuffer == null || aRegion == null
                 || sampleModelTranslate == null) {
-            throw new NullPointerException("sampleModel, dataBuffer, "
-                    + "aRegion or sampleModelTranslate is null");
+            // awt.281=sampleModel, dataBuffer, aRegion or sampleModelTranslate is null
+            throw new NullPointerException(Messages.getString("awt.281")); //$NON-NLS-1$
         }
 
         if (aRegion.width <= 0 || aRegion.height <= 0) {
-            throw new RasterFormatException("aRegion has width or height "
-                    + "less than or equal to zero");
+            // awt.282=aRegion has width or height less than or equal to zero
+            throw new RasterFormatException(Messages.getString("awt.282")); //$NON-NLS-1$
         }
 
         if ((long) aRegion.x + (long) aRegion.width > Integer.MAX_VALUE) {
-            throw new RasterFormatException("Overflow X coordinate of Raster");
+            // awt.283=Overflow X coordinate of Raster
+            throw new RasterFormatException(Messages.getString("awt.283")); //$NON-NLS-1$
         }
 
         if ((long) aRegion.y + (long) aRegion.height > Integer.MAX_VALUE) {
-            throw new RasterFormatException("Overflow Y coordinate of Raster");
+            // awt.284=Overflow Y coordinate of Raster
+            throw new RasterFormatException(Messages.getString("awt.284")); //$NON-NLS-1$
         }
 
         this.sampleModel = sampleModel;
@@ -610,36 +626,38 @@
     public Raster createChild(int parentX, int parentY, int width, int height,
             int childMinX, int childMinY, int bandList[]) {
         if (width <= 0 || height <= 0) {
-            throw new RasterFormatException("Width or Height of child "
-                    + "Raster is less than or equal to zero");
+            // awt.285=Width or Height of child Raster is less than or equal to zero
+            throw new RasterFormatException(Messages.getString("awt.285")); //$NON-NLS-1$
         }
 
         if (parentX < this.minX || parentX + width > this.minX + this.width) {
-            throw new RasterFormatException("parentX disposes outside Raster");
+            // awt.286=parentX disposes outside Raster
+            throw new RasterFormatException(Messages.getString("awt.286")); //$NON-NLS-1$
         }
 
         if (parentY < this.minY || parentY + height > this.minY + this.height) {
-            throw new RasterFormatException("parentY disposes outside Raster");
+            // awt.287=parentY disposes outside Raster
+            throw new RasterFormatException(Messages.getString("awt.287")); //$NON-NLS-1$
         }
 
         if ((long) parentX + width > Integer.MAX_VALUE) {
-            throw new RasterFormatException("parentX + width results in "
-                    + "integer overflow");
+            // awt.288=parentX + width results in integer overflow
+            throw new RasterFormatException(Messages.getString("awt.288")); //$NON-NLS-1$
         }
 
         if ((long) parentY + height > Integer.MAX_VALUE) {
-            throw new RasterFormatException("parentY + height results in "
-                    + "integer overflow");
+            // awt.289=parentY + height results in integer overflow
+            throw new RasterFormatException(Messages.getString("awt.289")); //$NON-NLS-1$
         }
 
         if ((long) childMinX + width > Integer.MAX_VALUE) {
-            throw new RasterFormatException("childMinX + width results in "
-                    + "integer overflow");
+            // awt.28A=childMinX + width results in integer overflow
+            throw new RasterFormatException(Messages.getString("awt.28A")); //$NON-NLS-1$
         }
 
         if ((long) childMinY + height > Integer.MAX_VALUE) {
-            throw new RasterFormatException("childMinY + height results in "
-                    + "integer overflow");
+            // awt.28B=childMinY + height results in integer overflow
+            throw new RasterFormatException(Messages.getString("awt.28B")); //$NON-NLS-1$
         }
 
         SampleModel childModel;
@@ -679,7 +697,8 @@
 
     public WritableRaster createCompatibleWritableRaster(Rectangle rect) {
         if (rect == null) {
-            throw new NullPointerException("Rect is null");
+            // awt.28C=Rect is null
+            throw new NullPointerException(Messages.getString("awt.28C")); //$NON-NLS-1$
         }
 
         return createCompatibleWritableRaster(rect.x, rect.y, rect.width,

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/image/ReplicateScaleFilter.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/image/ReplicateScaleFilter.java?view=diff&rev=470895&r1=470894&r2=470895
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/image/ReplicateScaleFilter.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/image/ReplicateScaleFilter.java Fri Nov  3 08:45:01 2006
@@ -22,6 +22,8 @@
 
 import java.util.Hashtable;
 
+import org.apache.harmony.awt.internal.nls.Messages;
+
 public class ReplicateScaleFilter extends ImageFilter {
 
     protected int srcWidth;
@@ -40,7 +42,8 @@
 
     public ReplicateScaleFilter(int width, int height) {
         if(width == 0 || height == 0) {
-            throw new IllegalArgumentException("Width or Height equals zero");
+            // awt.234=Width or Height equals zero
+            throw new IllegalArgumentException(Messages.getString("awt.234")); //$NON-NLS-1$
         }
 
         this.destWidth = width;
@@ -56,15 +59,15 @@
         } else {
             fprops = (Hashtable<Object, Object>) props.clone();
         }
-        String propName = "Rescale Filters";
-        String prop = "destWidth=" + destWidth + "; " + 
-        "destHeight=" + destHeight;
+        String propName = "Rescale Filters"; //$NON-NLS-1$
+        String prop = "destWidth=" + destWidth + "; " +  //$NON-NLS-1$ //$NON-NLS-2$
+        "destHeight=" + destHeight; //$NON-NLS-1$
         Object o = fprops.get(propName);
         if(o != null){
             if(o instanceof String){
-                prop = (String)o + "; " + prop;
+                prop = (String)o + "; " + prop; //$NON-NLS-1$
             }else{
-                prop =  o.toString() + "; " + prop;
+                prop =  o.toString() + "; " + prop; //$NON-NLS-1$
             }
         }
         fprops.put(propName, prop);

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/image/RescaleOp.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/image/RescaleOp.java?view=diff&rev=470895&r1=470894&r2=470895
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/image/RescaleOp.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/image/RescaleOp.java Fri Nov  3 08:45:01 2006
@@ -29,6 +29,7 @@
 import java.util.Arrays;
 
 import org.apache.harmony.awt.gl.AwtImageBackdoorAccessor;
+import org.apache.harmony.awt.internal.nls.Messages;
 
 
 public class RescaleOp implements BufferedImageOp, RasterOp {
@@ -45,9 +46,8 @@
         int numFactors = Math.min(scaleFactors.length, offsets.length);
 
         if (numFactors == 0) {
-            throw new IllegalArgumentException(
-                    "The number of scale factors should not be zero"
-            );
+            // awt.21C=The number of scale factors should not be zero 
+            throw new IllegalArgumentException(Messages.getString("awt.21C")); //$NON-NLS-1$
         }
 
         this.scaleFactors = new float[numFactors];
@@ -143,12 +143,9 @@
             dst = createCompatibleDestRaster(src);
         } else {
             if (src.getNumBands() != dst.getNumBands()) {
-                throw new IllegalArgumentException(
-                        "Number of src bands ("+
-                        src.getNumBands()+
-                        ") does not match number of dst bands (" +
-                        dst.getNumBands()+")"
-                );
+                // awt.21D=Number of src bands ({0}) does not match number of dst bands ({1})
+                throw new IllegalArgumentException(Messages.getString("awt.21D", //$NON-NLS-1$
+                        src.getNumBands(), dst.getNumBands()));
             }
         }
 
@@ -156,16 +153,15 @@
                 this.scaleFactors.length != 1 &&
                 this.scaleFactors.length != src.getNumBands()
         ) {
-            throw new IllegalArgumentException(
-                    "Number of scaling constants is not equal " +
-                    "to the number of bands"
-            );
+            // awt.21E=Number of scaling constants is not equal to the number of bands
+            throw new IllegalArgumentException(Messages.getString("awt.21E")); //$NON-NLS-1$
         }
 
         // TODO
         //if (ippFilter(src, dst, BufferedImage.TYPE_CUSTOM, false) != 0)
             if (slowFilter(src, dst, false) != 0) {
-                throw new ImagingOpException ("Unable to transform source");
+                // awt.21F=Unable to transform source
+                throw new ImagingOpException (Messages.getString("awt.21F")); //$NON-NLS-1$
             }
 
         return dst;
@@ -272,7 +268,8 @@
         ColorModel srcCM = src.getColorModel();
 
         if (srcCM instanceof IndexColorModel) {
-            throw new IllegalArgumentException("Source should not have IndexColorModel");
+            // awt.220=Source should not have IndexColorModel
+            throw new IllegalArgumentException(Messages.getString("awt.220")); //$NON-NLS-1$
         }
 
         // Check if the number of scaling factors matches the number of bands
@@ -284,16 +281,14 @@
             } else if (scaleFactors.length == nComponents) {
                 skipAlpha = false;
             } else {
-                throw new IllegalArgumentException(
-                        "Number of scaling constants does not match the number of bands"
-                );
+                // awt.21E=Number of scaling constants is not equal to the number of bands
+                throw new IllegalArgumentException(Messages.getString("awt.21E")); //$NON-NLS-1$
             }
         } else if (scaleFactors.length == 1 || scaleFactors.length == nComponents) {
             skipAlpha = false;
         } else {
-            throw new IllegalArgumentException(
-                    "Number of scaling constants does not match the number of bands"
-            );
+            // awt.21E=Number of scaling constants is not equal to the number of bands
+            throw new IllegalArgumentException(Messages.getString("awt.21E")); //$NON-NLS-1$
         }
 
         BufferedImage finalDst = null;
@@ -316,7 +311,8 @@
         // TODO
         //if (ippFilter(src.getRaster(), dst.getRaster(), src.getType(), skipAlpha) != 0)
             if (slowFilter(src.getRaster(), dst.getRaster(), skipAlpha) != 0) {
-                throw new ImagingOpException ("Unable to transform source");
+                // awt.21F=Unable to transform source
+                throw new ImagingOpException (Messages.getString("awt.21F")); //$NON-NLS-1$
             }
 
         if (finalDst != null) {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/image/SampleModel.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/image/SampleModel.java?view=diff&rev=470895&r1=470894&r2=470895
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/image/SampleModel.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/image/SampleModel.java Fri Nov  3 08:45:01 2006
@@ -20,6 +20,8 @@
  */
 package java.awt.image;
 
+import org.apache.harmony.awt.internal.nls.Messages;
+
 public abstract class SampleModel {
 
     protected int width;
@@ -32,26 +34,26 @@
 
     public SampleModel(int dataType, int w, int h, int numBands) {
         if (w <= 0 || h <= 0) {
-            throw new IllegalArgumentException("Width or Height is not " +
-                    "greater than 0");
+            // awt.22E=w or h is less than or equal to zero
+            throw new IllegalArgumentException(Messages.getString("awt.22E")); //$NON-NLS-1$
         }
 
         double squre = ((double) w) * ((double) h);
         if (squre >= Integer.MAX_VALUE) {
-            throw new IllegalArgumentException("The product of w and h is " +
-                    "greater than Integer.MAX_VALUE ");
+            // awt.22F=The product of w and h is greater than Integer.MAX_VALUE
+            throw new IllegalArgumentException(Messages.getString("awt.22F")); //$NON-NLS-1$
         }
 
         if (dataType < DataBuffer.TYPE_BYTE ||
                 dataType > DataBuffer.TYPE_DOUBLE &&
                 dataType != DataBuffer.TYPE_UNDEFINED) {
-            throw new IllegalArgumentException("dataType is not one " +
-                    "of the supported data types");
+            // awt.230=dataType is not one of the supported data types
+            throw new IllegalArgumentException(Messages.getString("awt.230")); //$NON-NLS-1$
         }
 
         if (numBands < 1) {
-            throw new IllegalArgumentException("Number of bands must " +
-                    "be more then 0");
+            // awt.231=Number of bands must be more then 0
+            throw new IllegalArgumentException(Messages.getString("awt.231")); //$NON-NLS-1$
         }
 
         this.dataType = dataType;
@@ -261,8 +263,8 @@
 
     public int[] getPixel(int x, int y, int iArray[], DataBuffer data) {
         if (x < 0 || y < 0 || x >= this.width || y >= this.height) {
-            throw new ArrayIndexOutOfBoundsException("Coordinates are " +
-                    "not in bounds");
+            // awt.63=Coordinates are not in bounds
+            throw new ArrayIndexOutOfBoundsException(Messages.getString("awt.63")); //$NON-NLS-1$
         }
         int pixel[];
 
@@ -281,8 +283,8 @@
 
     public void setPixel(int x, int y, int iArray[], DataBuffer data) {
         if (x < 0 || y < 0 || x >= this.width || y >= this.height) {
-            throw new ArrayIndexOutOfBoundsException("Coordinates are " +
-                    "not in bounds");
+            // awt.63=Coordinates are not in bounds
+            throw new ArrayIndexOutOfBoundsException(Messages.getString("awt.63")); //$NON-NLS-1$
         }
         for (int i = 0; i < numBands; i++) {
             setSample(x, y, i, iArray[i], data);
@@ -291,8 +293,8 @@
 
     public float[] getPixel(int x, int y, float fArray[], DataBuffer data) {
         if (x < 0 || y < 0 || x >= this.width || y >= this.height) {
-            throw new ArrayIndexOutOfBoundsException("Coordinates are " +
-                    "not in bounds");
+            // awt.63=Coordinates are not in bounds
+            throw new ArrayIndexOutOfBoundsException(Messages.getString("awt.63")); //$NON-NLS-1$
         }
         float pixel[];
 
@@ -311,8 +313,8 @@
 
     public void setPixel(int x, int y, float fArray[], DataBuffer data) {
         if (x < 0 || y < 0 || x >= this.width || y >= this.height) {
-            throw new ArrayIndexOutOfBoundsException("Coordinates are " +
-                    "not in bounds");
+            // awt.63=Coordinates are not in bounds
+            throw new ArrayIndexOutOfBoundsException(Messages.getString("awt.63")); //$NON-NLS-1$
         }
         for (int i = 0; i < numBands; i++) {
             setSample(x, y, i, fArray[i], data);
@@ -321,8 +323,8 @@
 
     public double[] getPixel(int x, int y, double dArray[], DataBuffer data) {
         if (x < 0 || y < 0 || x >= this.width || y >= this.height) {
-            throw new ArrayIndexOutOfBoundsException("Coordinates are " +
-                    "not in bounds");
+            // awt.63=Coordinates are not in bounds
+            throw new ArrayIndexOutOfBoundsException(Messages.getString("awt.63")); //$NON-NLS-1$
         }
         double pixel[];
 
@@ -341,8 +343,8 @@
 
     public void setPixel(int x, int y, double dArray[], DataBuffer data) {
         if (x < 0 || y < 0 || x >= this.width || y >= this.height) {
-            throw new ArrayIndexOutOfBoundsException("Coordinates are " +
-                    "not in bounds");
+            // awt.63=Coordinates are not in bounds
+            throw new ArrayIndexOutOfBoundsException(Messages.getString("awt.63")); //$NON-NLS-1$
         }
         for (int i = 0; i < numBands; i++) {
             setSample(x, y, i, dArray[i], data);
@@ -362,8 +364,8 @@
     public int[] getPixels(int x, int y, int w, int h, int iArray[],
             DataBuffer data) {
         if (x < 0 || y < 0 || x + w > this.width || y + h > this.height) {
-            throw new ArrayIndexOutOfBoundsException("Coordinates are " +
-                    "not in bounds");
+            // awt.63=Coordinates are not in bounds
+            throw new ArrayIndexOutOfBoundsException(Messages.getString("awt.63")); //$NON-NLS-1$
         }
         int pixels[];
         int idx = 0;
@@ -387,8 +389,8 @@
     public void setPixels(int x, int y, int w, int h, int iArray[],
             DataBuffer data) {
         if (x < 0 || y < 0 || x + w > this.width || y + h > this.height) {
-            throw new ArrayIndexOutOfBoundsException("Coordinates are " +
-                    "not in bounds");
+            // awt.63=Coordinates are not in bounds
+            throw new ArrayIndexOutOfBoundsException(Messages.getString("awt.63")); //$NON-NLS-1$
         }
         int idx = 0;
         for (int i = y; i < y + h; i++) {
@@ -403,8 +405,8 @@
     public float[] getPixels(int x, int y, int w, int h, float fArray[],
             DataBuffer data) {
         if (x < 0 || y < 0 || x + w > this.width || y + h > this.height) {
-            throw new ArrayIndexOutOfBoundsException("Coordinates are " +
-                    "not in bounds");
+            // awt.63=Coordinates are not in bounds
+            throw new ArrayIndexOutOfBoundsException(Messages.getString("awt.63")); //$NON-NLS-1$
         }
         float pixels[];
         int idx = 0;
@@ -428,8 +430,8 @@
     public void setPixels(int x, int y, int w, int h, float fArray[],
             DataBuffer data) {
         if (x < 0 || y < 0 || x + w > this.width || y + h > this.height) {
-            throw new ArrayIndexOutOfBoundsException("Coordinates are " +
-                    "not in bounds");
+            // awt.63=Coordinates are not in bounds
+            throw new ArrayIndexOutOfBoundsException(Messages.getString("awt.63")); //$NON-NLS-1$
         }
         int idx = 0;
         for (int i = y; i < y + h; i++) {
@@ -444,8 +446,8 @@
     public double[] getPixels(int x, int y, int w, int h, double dArray[],
             DataBuffer data) {
         if (x < 0 || y < 0 || x + w > this.width || y + h > this.height) {
-            throw new ArrayIndexOutOfBoundsException("Coordinates are " +
-                    "not in bounds");
+            // awt.63=Coordinates are not in bounds
+            throw new ArrayIndexOutOfBoundsException(Messages.getString("awt.63")); //$NON-NLS-1$
         }
         double pixels[];
         int idx = 0;
@@ -469,8 +471,8 @@
     public void setPixels(int x, int y, int w, int h, double dArray[],
             DataBuffer data) {
         if (x < 0 || y < 0 || x + w > this.width || y + h > this.height) {
-            throw new ArrayIndexOutOfBoundsException("Coordinates are " +
-                    "not in bounds");
+            // awt.63=Coordinates are not in bounds
+            throw new ArrayIndexOutOfBoundsException(Messages.getString("awt.63")); //$NON-NLS-1$
         }
         int idx = 0;
         for (int i = y; i < y + h; i++) {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/image/SinglePixelPackedSampleModel.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/image/SinglePixelPackedSampleModel.java?view=diff&rev=470895&r1=470894&r2=470895
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/image/SinglePixelPackedSampleModel.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/image/SinglePixelPackedSampleModel.java Fri Nov  3 08:45:01 2006
@@ -22,6 +22,8 @@
 
 import java.util.Arrays;
 
+import org.apache.harmony.awt.internal.nls.Messages;
+
 public class SinglePixelPackedSampleModel extends SampleModel {
 
     private int bitMasks[];
@@ -47,8 +49,9 @@
         if (dataType != DataBuffer.TYPE_BYTE &&
                 dataType != DataBuffer.TYPE_USHORT &&
                 dataType != DataBuffer.TYPE_INT) {
-            throw new IllegalArgumentException("Unsupported data type:"
-                    + dataType);
+            // awt.61=Unsupported data type: {0}
+            throw new IllegalArgumentException(Messages.getString("awt.61", //$NON-NLS-1$
+                    dataType));
         }
 
         this.scanlineStride = scanlineStride;
@@ -75,8 +78,9 @@
                 }
 
                 if (mask != 0) {
-                    throw new IllegalArgumentException("Wrong mask :"
-                            + bitMasks[i]);
+                    // awt.62=Wrong mask : {0}
+                    throw new IllegalArgumentException(Messages.getString(
+                            "awt.62", bitMasks[i])); //$NON-NLS-1$
                 }
             }
 
@@ -94,8 +98,8 @@
     @Override
     public Object getDataElements(int x, int y, Object obj, DataBuffer data) {
         if (x < 0 || y < 0 || x >= this.width || y >= this.height) {
-            throw new ArrayIndexOutOfBoundsException("Coordinates are " +
-                    "not in bounds");
+            // awt.63=Coordinates are not in bounds
+            throw new ArrayIndexOutOfBoundsException(Messages.getString("awt.63")); //$NON-NLS-1$
         }
         switch (getTransferType()) {
         case DataBuffer.TYPE_BYTE:
@@ -138,8 +142,8 @@
     @Override
     public void setDataElements(int x, int y, Object obj, DataBuffer data) {
         if (x < 0 || y < 0 || x >= this.width || y >= this.height) {
-            throw new ArrayIndexOutOfBoundsException("Coordinates are " +
-                    "not in bounds");
+            // awt.63=Coordinates are not in bounds
+            throw new ArrayIndexOutOfBoundsException(Messages.getString("awt.63")); //$NON-NLS-1$
         }
         switch (getTransferType()) {
         case DataBuffer.TYPE_BYTE:
@@ -174,9 +178,8 @@
     @Override
     public SampleModel createSubsetSampleModel(int bands[]) {
         if (bands.length > this.numBands) {
-            throw new RasterFormatException("The number of the bands " +
-                    "in the subset is greater than the number of bands " +
-                    "in the sample model");
+            // awt.64=The number of the bands in the subset is greater than the number of bands in the sample model
+            throw new RasterFormatException(Messages.getString("awt.64")); //$NON-NLS-1$
         }
 
         int masks[] = new int[bands.length];
@@ -196,8 +199,8 @@
     @Override
     public int[] getPixel(int x, int y, int iArray[], DataBuffer data) {
         if (x < 0 || y < 0 || x >= this.width || y >= this.height) {
-            throw new ArrayIndexOutOfBoundsException("Coordinates are " +
-                    "not in bounds");
+            // awt.63=Coordinates are not in bounds
+            throw new ArrayIndexOutOfBoundsException(Messages.getString("awt.63")); //$NON-NLS-1$
         }
         int pixel[];
         if (iArray == null) {
@@ -216,8 +219,8 @@
     @Override
     public void setPixel(int x, int y, int iArray[], DataBuffer data) {
         if (x < 0 || y < 0 || x >= this.width || y >= this.height) {
-            throw new ArrayIndexOutOfBoundsException("Coordinates are " +
-                    "not in bounds");
+            // awt.63=Coordinates are not in bounds
+            throw new ArrayIndexOutOfBoundsException(Messages.getString("awt.63")); //$NON-NLS-1$
         }
         for (int i = 0; i < this.numBands; i++) {
             setSample(x, y, i, iArray[i], data);
@@ -227,8 +230,8 @@
     @Override
     public int getSample(int x, int y, int b, DataBuffer data) {
         if (x < 0 || y < 0 || x >= this.width || y >= this.height) {
-            throw new ArrayIndexOutOfBoundsException("Coordinates are " +
-                    "not in bounds");
+            // awt.63=Coordinates are not in bounds
+            throw new ArrayIndexOutOfBoundsException(Messages.getString("awt.63")); //$NON-NLS-1$
         }
         int sample = data.getElem(y * scanlineStride + x);
         return ((sample & this.bitMasks[b]) >>> this.bitOffsets[b]);
@@ -238,8 +241,8 @@
     public int[] getPixels(int x, int y, int w, int h, int iArray[],
             DataBuffer data) {
         if (x < 0 || y < 0 || x + w > this.width || y + h > this.height) {
-            throw new ArrayIndexOutOfBoundsException("Coordinates are " +
-                    "not in bounds");
+            // awt.63=Coordinates are not in bounds
+            throw new ArrayIndexOutOfBoundsException(Messages.getString("awt.63")); //$NON-NLS-1$
         }
 
         int pixels[];
@@ -266,8 +269,8 @@
     public void setPixels(int x, int y, int w, int h, int iArray[],
             DataBuffer data) {
         if (x < 0 || y < 0 || x + w > this.width || y + h > this.height) {
-            throw new ArrayIndexOutOfBoundsException("Coordinates are " +
-                    "not in bounds");
+            // awt.63=Coordinates are not in bounds
+            throw new ArrayIndexOutOfBoundsException(Messages.getString("awt.63")); //$NON-NLS-1$
         }
 
         int idx = 0;
@@ -284,8 +287,8 @@
     @Override
     public void setSample(int x, int y, int b, int s, DataBuffer data) {
         if (x < 0 || y < 0 || x >= this.width || y >= this.height) {
-            throw new ArrayIndexOutOfBoundsException("Coordinates are " +
-                    "not in bounds");
+            // awt.63=Coordinates are not in bounds
+            throw new ArrayIndexOutOfBoundsException(Messages.getString("awt.63")); //$NON-NLS-1$
         }
         int tmp = data.getElem(y * scanlineStride + x);
         tmp &= ~this.bitMasks[b];
@@ -297,8 +300,8 @@
     public int[] getSamples(int x, int y, int w, int h, int b, int iArray[],
             DataBuffer data) {
         if (x < 0 || y < 0 || x + w > this.width || y + h > this.height) {
-            throw new ArrayIndexOutOfBoundsException("Coordinates are " +
-                    "not in bounds");
+            // awt.63=Coordinates are not in bounds
+            throw new ArrayIndexOutOfBoundsException(Messages.getString("awt.63")); //$NON-NLS-1$
         }
 
         int samples[];
@@ -323,8 +326,8 @@
     public void setSamples(int x, int y, int w, int h, int b, int iArray[],
             DataBuffer data) {
         if (x < 0 || y < 0 || x + w > this.width || y + h > this.height) {
-            throw new ArrayIndexOutOfBoundsException("Coordinates are " +
-                    "not in bounds");
+            // awt.63=Coordinates are not in bounds
+            throw new ArrayIndexOutOfBoundsException(Messages.getString("awt.63")); //$NON-NLS-1$
         }
 
         int idx = 0;

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/image/WritableRaster.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/image/WritableRaster.java?view=diff&rev=470895&r1=470894&r2=470895
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/image/WritableRaster.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/image/WritableRaster.java Fri Nov  3 08:45:01 2006
@@ -23,6 +23,8 @@
 import java.awt.Point;
 import java.awt.Rectangle;
 
+import org.apache.harmony.awt.internal.nls.Messages;
+
 public class WritableRaster extends Raster {
 
     protected WritableRaster(SampleModel sampleModel, DataBuffer dataBuffer,
@@ -56,36 +58,38 @@
     public WritableRaster createWritableChild(int parentX, int parentY, int w,
             int h, int childMinX, int childMinY, int bandList[]) {
         if (w <= 0 || h <= 0) {
-            throw new RasterFormatException("Width or Height of child " +
-                    "Raster is less than or equal to zero");
+            // awt.244=Width or Height of child Raster is less than or equal to zero
+            throw new RasterFormatException(Messages.getString("awt.244")); //$NON-NLS-1$
         }
 
         if (parentX < this.minX || parentX + w > this.minX + this.width) {
-            throw new RasterFormatException("parentX disposes outside Raster");
+            // awt.245=parentX disposes outside Raster
+            throw new RasterFormatException(Messages.getString("awt.245")); //$NON-NLS-1$
         }
 
         if (parentY < this.minY || parentY + h > this.minY + this.height) {
-            throw new RasterFormatException("parentY disposes outside Raster");
+            // awt.246=parentY disposes outside Raster
+            throw new RasterFormatException(Messages.getString("awt.246")); //$NON-NLS-1$
         }
 
         if ((long) parentX + w > Integer.MAX_VALUE) {
-            throw new RasterFormatException("parentX + w results in " +
-                    "integer overflow");
+            // awt.247=parentX + w results in integer overflow
+            throw new RasterFormatException(Messages.getString("awt.247")); //$NON-NLS-1$
         }
 
         if ((long) parentY + h > Integer.MAX_VALUE) {
-            throw new RasterFormatException("parentY + h results in " +
-                    "integer overflow");
+            // awt.248=parentY + h results in integer overflow
+            throw new RasterFormatException(Messages.getString("awt.248")); //$NON-NLS-1$
         }
 
         if ((long) childMinX + w > Integer.MAX_VALUE) {
-            throw new RasterFormatException("childMinX + w results in " +
-                    "integer overflow");
+            // awt.249=childMinX + w results in integer overflow
+            throw new RasterFormatException(Messages.getString("awt.249")); //$NON-NLS-1$
         }
 
         if ((long) childMinY + h > Integer.MAX_VALUE) {
-            throw new RasterFormatException("childMinY + h results in " +
-                    "integer overflow");
+            // awt.24A=childMinY + h results in integer overflow
+            throw new RasterFormatException(Messages.getString("awt.24A")); //$NON-NLS-1$
         }
 
         SampleModel childModel;
@@ -200,8 +204,8 @@
 
         if (dstX < this.minX || dstX + w > this.minX + this.width ||
                 dstY < this.minY || dstY + h > this.minY + this.height) {
-            throw new ArrayIndexOutOfBoundsException("Coordinates are " +
-                    "not in bounds");
+            // awt.63=Coordinates are not in bounds
+            throw new ArrayIndexOutOfBoundsException(Messages.getString("awt.63")); //$NON-NLS-1$
         }
 
         int srcX = inRaster.getMinX();

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/image/renderable/RenderableImage.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/image/renderable/RenderableImage.java?view=diff&rev=470895&r1=470894&r2=470895
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/image/renderable/RenderableImage.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/image/renderable/RenderableImage.java Fri Nov  3 08:45:01 2006
@@ -26,7 +26,7 @@
 
 public interface RenderableImage {
 
-    public static final String HINTS_OBSERVED = "HINTS_OBSERVED";
+    public static final String HINTS_OBSERVED = "HINTS_OBSERVED"; //$NON-NLS-1$
 
     public Object getProperty(String name);
 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/image/renderable/RenderableImageOp.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/image/renderable/RenderableImageOp.java?view=diff&rev=470895&r1=470894&r2=470895
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/image/renderable/RenderableImageOp.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/image/renderable/RenderableImageOp.java Fri Nov  3 08:45:01 2006
@@ -26,6 +26,8 @@
 import java.awt.image.RenderedImage;
 import java.util.Vector;
 
+import org.apache.harmony.awt.internal.nls.Messages;
+
 public class RenderableImageOp implements RenderableImage {
 
     ContextualRenderedImageFactory CRIF;
@@ -79,7 +81,8 @@
 
     public RenderedImage createScaledRendering(int w, int h, RenderingHints hints) {
         if(w == 0 && h == 0) {
-            throw new IllegalArgumentException("Width and Height mustn't be equal zero both");
+            // awt.60=Width and Height mustn't be equal zero both
+            throw new IllegalArgumentException(Messages.getString("awt.60")); //$NON-NLS-1$
         }
         if(w == 0){
             w = Math.round(h*(getWidth()/getHeight()));

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/image/renderable/RenderableImageProducer.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/image/renderable/RenderableImageProducer.java?view=diff&rev=470895&r1=470894&r2=470895
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/image/renderable/RenderableImageProducer.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/image/renderable/RenderableImageProducer.java Fri Nov  3 08:45:01 2006
@@ -48,7 +48,7 @@
 
     public synchronized void startProduction(ImageConsumer ic) {
         addConsumer(ic);
-        Thread t = new Thread(this, "RenderableImageProducer thread");
+        Thread t = new Thread(this, "RenderableImageProducer thread"); //$NON-NLS-1$
         t.start();
     }
 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/print/Book.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/print/Book.java?view=diff&rev=470895&r1=470894&r2=470895
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/print/Book.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/print/Book.java Fri Nov  3 08:45:01 2006
@@ -22,6 +22,8 @@
 
 import java.util.Vector;
 
+import org.apache.harmony.awt.internal.nls.Messages;
+
 public class Book implements Pageable {
 
     private final Vector<innerPage> bookPages;
@@ -35,10 +37,14 @@
         innerPage(Printable painter, PageFormat page) {
             super();
             if (painter == null) {
-                throw new NullPointerException("painter is null");
+                // awt.01='{0}' parameter is null
+                throw new NullPointerException(Messages.getString(
+                        "awt.01", "painter")); //$NON-NLS-1$ //$NON-NLS-2$
             }
             if (page == null) {
-                throw new NullPointerException("page is null");
+                // awt.01='{0}' parameter is null
+                throw new NullPointerException(Messages.getString(
+                        "awt.01", "page")); //$NON-NLS-1$ //$NON-NLS-2$
             }
             pagePainter = painter;
             pageFormat = page;
@@ -80,8 +86,8 @@
             throws IndexOutOfBoundsException {
 
         if (pageIndex >= getNumberOfPages()) {
-            throw new IndexOutOfBoundsException(
-                    "pageIndex is more than book size");
+            // awt.5E=pageIndex is more than book size
+            throw new IndexOutOfBoundsException(Messages.getString("awt.5E")); //$NON-NLS-1$
         }
         return bookPages.elementAt(pageIndex).getPageFormat();
     }
@@ -90,8 +96,8 @@
             throws IndexOutOfBoundsException {
 
         if (pageIndex >= getNumberOfPages()) {
-            throw new IndexOutOfBoundsException(
-                    "pageIndex is more than book size");
+            // awt.5E=pageIndex is more than book size
+            throw new IndexOutOfBoundsException(Messages.getString("awt.5E")); //$NON-NLS-1$
         }
         return bookPages.elementAt(pageIndex).getPrintable();
     }
@@ -100,8 +106,8 @@
             throws IndexOutOfBoundsException {
 
         if (pageIndex >= getNumberOfPages()) {
-            throw new IndexOutOfBoundsException(
-                    "pageIndex is more than book size");
+            // awt.5E=pageIndex is more than book size
+            throw new IndexOutOfBoundsException(Messages.getString("awt.5E")); //$NON-NLS-1$
         }
         bookPages.setElementAt(new innerPage(painter, page), pageIndex);
     }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/print/PageFormat.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/print/PageFormat.java?view=diff&rev=470895&r1=470894&r2=470895
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/print/PageFormat.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/print/PageFormat.java Fri Nov  3 08:45:01 2006
@@ -20,6 +20,8 @@
  */
 package java.awt.print;
 
+import org.apache.harmony.awt.internal.nls.Messages;
+
 public class PageFormat implements Cloneable {
     public static final int LANDSCAPE = 0;
     public static final int PORTRAIT = 1;
@@ -155,7 +157,8 @@
                 || orientation == REVERSE_LANDSCAPE) {
             this.pageOrientation = orientation;
         } else {
-            throw new IllegalArgumentException("wrong orientation");
+            // awt.5F=wrong orientation
+            throw new IllegalArgumentException(Messages.getString("awt.5F")); //$NON-NLS-1$
         }
     }
 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/print/PrinterJob.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/print/PrinterJob.java?view=diff&rev=470895&r1=470894&r2=470895
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/print/PrinterJob.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/print/PrinterJob.java Fri Nov  3 08:45:01 2006
@@ -27,6 +27,8 @@
 import javax.print.StreamPrintServiceFactory;
 import javax.print.attribute.PrintRequestAttributeSet;
 
+import org.apache.harmony.awt.internal.nls.Messages;
+
 public abstract class PrinterJob {
 
     /* abstract section */
@@ -75,22 +77,22 @@
         return AccessController.doPrivileged(
                 new PrivilegedAction<PrinterJob>() {
             public PrinterJob run() {
-                String s = System.getProperty("java.awt.printerjob");
+                String s = System.getProperty("java.awt.printerjob"); //$NON-NLS-1$
 
-                if (s == null || s.equals("")){
-                    s = "org.apache.harmony.x.print.awt.PSPrinterJob";
+                if (s == null || s.equals("")){ //$NON-NLS-1$
+                    s = "org.apache.harmony.x.print.awt.PSPrinterJob"; //$NON-NLS-1$
                 }
                 try {
                     return (PrinterJob) Class.forName(s).newInstance();
                 } catch (ClassNotFoundException cnfe) {
-                    throw new AWTError(
-                            "Default class for PrinterJob is not found");
+                    // awt.5A=Default class for PrinterJob is not found
+                    throw new AWTError(Messages.getString("awt.5A")); //$NON-NLS-1$
                 } catch (IllegalAccessException iae) {
-                    throw new AWTError(
-                            "No access to default class for PrinterJob");
+                    // awt.5B=No access to default class for PrinterJob
+                    throw new AWTError(Messages.getString("awt.5B")); //$NON-NLS-1$
                 } catch (InstantiationException ie) {
-                    throw new AWTError(
-                            "Instantiation exception for PrinterJob");
+                    // awt.5C=Instantiation exception for PrinterJob
+                    throw new AWTError(Messages.getString("awt.5C")); //$NON-NLS-1$
                 }
             }
         });
@@ -130,8 +132,8 @@
     public boolean printDialog(PrintRequestAttributeSet attributes)
             throws HeadlessException {
         if (attributes == null) {
-            throw new NullPointerException(
-                    "The parameter 'attributes' is null");
+            // awt.01='{0}' parameter is null
+            throw new NullPointerException(Messages.getString("awt.01", "attributes")); //$NON-NLS-1$ //$NON-NLS-2$
         }
         //This implementation ignores the attribute set.
         return printDialog();
@@ -139,16 +141,17 @@
 
     public void setPrintService(PrintService printservice)
             throws PrinterException {
-        throw new PrinterException(printservice.toString()
-                    + "is not supported");
+        // awt.5D={0} is not supported
+        throw new PrinterException(Messages.getString(
+                "awt.5D", printservice.toString())); //$NON-NLS-1$
     }
 
     public PageFormat pageDialog(PrintRequestAttributeSet attributes)
         throws HeadlessException {
         //This implementation ignores the attribute set.
         if(attributes == null) {
-            throw new NullPointerException(
-                    "The parameter 'attributes' is null");
+            // awt.01='{0}' parameter is null
+            throw new NullPointerException(Messages.getString("awt.01", "attributes")); //$NON-NLS-1$ //$NON-NLS-2$
         }
         return pageDialog(defaultPage());
     }



Mime
View raw message