Index: src/main/java/common/java/awt/color/ColorSpace.java =================================================================== --- src/main/java/common/java/awt/color/ColorSpace.java (revision 470363) +++ src/main/java/common/java/awt/color/ColorSpace.java (working copy) @@ -23,6 +23,7 @@ import java.io.Serializable; import org.apache.harmony.awt.gl.color.LUTColorConverter; +import org.apache.harmony.awt.internal.nls.Messages; public abstract class ColorSpace implements Serializable { @@ -105,11 +106,11 @@ public String getName(int idx) { if (idx < 0 || idx > numComponents - 1) { - throw new IllegalArgumentException( - "Invalid component index: " + idx); + // awt.16A=Invalid component index: {0} + throw new IllegalArgumentException(Messages.getString("awt.16A", idx)); //$NON-NLS-1$ } - return "Unnamed color component #" + idx; + return "Unnamed color component #" + idx; //$NON-NLS-1$ } public abstract float[] toRGB(float[] colorvalue); @@ -122,16 +123,16 @@ public float getMinValue(int component) { if (component < 0 || component > numComponents - 1) { - throw new IllegalArgumentException( - "Invalid component index: " + component); + // awt.16A=Invalid component index: {0} + throw new IllegalArgumentException(Messages.getString("awt.16A", component)); //$NON-NLS-1$ } return 0; } public float getMaxValue(int component) { if (component < 0 || component > numComponents - 1) { - throw new IllegalArgumentException( - "Invalid component index: " + component); + // awt.16A=Invalid component index: {0} + throw new IllegalArgumentException(Messages.getString("awt.16A", component)); //$NON-NLS-1$ } return 1; } @@ -194,6 +195,7 @@ } // Unknown argument passed - throw new IllegalArgumentException("Not a predefined colorspace"); + // awt.16B=Not a predefined colorspace + throw new IllegalArgumentException(Messages.getString("awt.16B")); //$NON-NLS-1$ } } \ No newline at end of file Index: src/main/java/common/java/awt/color/ICC_ColorSpace.java =================================================================== --- src/main/java/common/java/awt/color/ICC_ColorSpace.java (revision 470363) +++ src/main/java/common/java/awt/color/ICC_ColorSpace.java (working copy) @@ -24,6 +24,7 @@ import org.apache.harmony.awt.gl.color.ColorConverter; import org.apache.harmony.awt.gl.color.ColorScaler; import org.apache.harmony.awt.gl.color.ICC_Transform; +import org.apache.harmony.awt.internal.nls.Messages; import java.io.*; @@ -33,12 +34,12 @@ // Need to keep compatibility with serialized form private static final ObjectStreamField[] serialPersistentFields = { - new ObjectStreamField("thisProfile", ICC_Profile.class), - new ObjectStreamField("minVal", float[].class), - new ObjectStreamField("maxVal", float[].class), - new ObjectStreamField("diffMinMax", float[].class), - new ObjectStreamField("invDiffMinMax", float[].class), - new ObjectStreamField("needScaleInit", Boolean.TYPE) + new ObjectStreamField("thisProfile", ICC_Profile.class), //$NON-NLS-1$ + new ObjectStreamField("minVal", float[].class), //$NON-NLS-1$ + new ObjectStreamField("maxVal", float[].class), //$NON-NLS-1$ + new ObjectStreamField("diffMinMax", float[].class), //$NON-NLS-1$ + new ObjectStreamField("invDiffMinMax", float[].class), //$NON-NLS-1$ + new ObjectStreamField("needScaleInit", Boolean.TYPE) //$NON-NLS-1$ }; @@ -82,7 +83,8 @@ case ICC_Profile.CLASS_INPUT: break; // OK, it is color conversion profile default: - throw new IllegalArgumentException("Invalid profile class."); + // awt.168=Invalid profile class. + throw new IllegalArgumentException(Messages.getString("awt.168")); //$NON-NLS-1$ } profile = pf; @@ -234,7 +236,8 @@ @Override public float getMinValue(int component) { if ((component < 0) || (component > this.getNumComponents() - 1)) { - throw new IllegalArgumentException("Component index out of range"); + // awt.169=Component index out of range + throw new IllegalArgumentException(Messages.getString("awt.169")); //$NON-NLS-1$ } return minValues[component]; @@ -243,7 +246,8 @@ @Override public float getMaxValue(int component) { if ((component < 0) || (component > this.getNumComponents() - 1)) { - throw new IllegalArgumentException("Component index out of range"); + // awt.169=Component index out of range + throw new IllegalArgumentException(Messages.getString("awt.169")); //$NON-NLS-1$ } return maxValues[component]; @@ -281,12 +285,12 @@ private void writeObject(ObjectOutputStream out) throws IOException { ObjectOutputStream.PutField fields = out.putFields(); - fields.put("thisProfile", profile); - fields.put("minVal", null); - fields.put("maxVal", null); - fields.put("diffMinMax", null); - fields.put("invDiffMinMax", null); - fields.put("needScaleInit", true); + fields.put("thisProfile", profile); //$NON-NLS-1$ + fields.put("minVal", null); //$NON-NLS-1$ + fields.put("maxVal", null); //$NON-NLS-1$ + fields.put("diffMinMax", null); //$NON-NLS-1$ + fields.put("invDiffMinMax", null); //$NON-NLS-1$ + fields.put("needScaleInit", true); //$NON-NLS-1$ out.writeFields(); } @@ -294,7 +298,7 @@ private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { ObjectInputStream.GetField fields = in.readFields(); resolvedDeserializedInst = - new ICC_ColorSpace((ICC_Profile) fields.get("thisProfile", null)); + new ICC_ColorSpace((ICC_Profile) fields.get("thisProfile", null)); //$NON-NLS-1$ } Object readResolve() throws ObjectStreamException { Index: src/main/java/common/java/awt/color/ICC_Profile.java =================================================================== --- src/main/java/common/java/awt/color/ICC_Profile.java (revision 470363) +++ src/main/java/common/java/awt/color/ICC_Profile.java (working copy) @@ -37,6 +37,7 @@ import org.apache.harmony.awt.gl.color.ICC_ProfileHelper; import org.apache.harmony.awt.gl.color.NativeCMM; +import org.apache.harmony.awt.internal.nls.Messages; public class ICC_Profile implements Serializable { @@ -372,15 +373,15 @@ byte[] data = (byte[])s.readObject(); if (colorSpaceStr != null) { - if (colorSpaceStr.equals("CS_sRGB")) { + if (colorSpaceStr.equals("CS_sRGB")) { //$NON-NLS-1$ openedProfileObject = getInstance(ColorSpace.CS_sRGB); - } else if (colorSpaceStr.equals("CS_GRAY")) { + } else if (colorSpaceStr.equals("CS_GRAY")) { //$NON-NLS-1$ openedProfileObject = getInstance(ColorSpace.CS_GRAY); - } else if (colorSpaceStr.equals("CS_LINEAR_RGB")) { + } else if (colorSpaceStr.equals("CS_LINEAR_RGB")) { //$NON-NLS-1$ openedProfileObject = getInstance(ColorSpace.CS_LINEAR_RGB); - } else if (colorSpaceStr.equals("CS_CIEXYZ")) { + } else if (colorSpaceStr.equals("CS_CIEXYZ")) { //$NON-NLS-1$ openedProfileObject = getInstance(ColorSpace.CS_CIEXYZ); - } else if (colorSpaceStr.equals("CS_PYCC")) { + } else if (colorSpaceStr.equals("CS_PYCC")) { //$NON-NLS-1$ openedProfileObject = getInstance(ColorSpace.CS_PYCC); } else { openedProfileObject = ICC_Profile.getInstance(data); @@ -464,9 +465,9 @@ } // Not an ICC profile class - throw new IllegalArgumentException( - "Profile class does not comply with ICC specification" - ); + // awt.15F=Profile class does not comply with ICC specification + throw new IllegalArgumentException(Messages.getString("awt.15F")); //$NON-NLS-1$ + } public int getPCSType() { @@ -522,8 +523,8 @@ default: } - throw new ProfileDataException( - "Color space doesn't comply with ICC specification" + // awt.160=Color space doesn't comply with ICC specification + throw new ProfileDataException(Messages.getString("awt.160") //$NON-NLS-1$ ); } @@ -585,23 +586,23 @@ } catch (FileNotFoundException e) {} // Check java.iccprofile.path entries - fiStream = tryPath(System.getProperty("java.iccprofile.path"), fName); + fiStream = tryPath(System.getProperty("java.iccprofile.path"), fName); //$NON-NLS-1$ if (fiStream != null) { return fiStream; } // Check java.class.path entries - fiStream = tryPath(System.getProperty("java.class.path"), fName); + fiStream = tryPath(System.getProperty("java.class.path"), fName); //$NON-NLS-1$ if (fiStream != null) { return fiStream; } // Check directory with java sample profiles - String home = System.getProperty("java.home"); + String home = System.getProperty("java.home"); //$NON-NLS-1$ if (home != null) { fiStream = tryPath( home + File.separatorChar + - "lib" + File.separatorChar + "cmm", fName + "lib" + File.separatorChar + "cmm", fName //$NON-NLS-1$ //$NON-NLS-2$ ); } @@ -610,7 +611,8 @@ }); if (fiStream == null) { - throw new IOException("Unable to open file " + fileName); + // awt.161=Unable to open file {0} + throw new IOException(Messages.getString("awt.161", fileName)); //$NON-NLS-1$ } ICC_Profile pf = getInstance(fiStream); @@ -620,7 +622,8 @@ public static ICC_Profile getInstance(InputStream s) throws IOException { byte[] header = new byte[headerSize]; - String invalidDataMessage = "Invalid ICC Profile Data"; + // awt.162=Invalid ICC Profile Data + String invalidDataMessage = Messages.getString("awt.162"); //$NON-NLS-1$ // Get header from the input stream if (s.read(header) != headerSize) { @@ -659,10 +662,11 @@ try { res = new ICC_Profile(data); } catch (CMMException e) { - throw new IllegalArgumentException("Invalid ICC Profile data"); + // awt.162=Invalid ICC Profile Data + throw new IllegalArgumentException(Messages.getString("awt.162")); //$NON-NLS-1$ } - if (System.getProperty("os.name").toLowerCase().indexOf("windows") >= 0) { + if (System.getProperty("os.name").toLowerCase().indexOf("windows") >= 0) { //$NON-NLS-1$ //$NON-NLS-2$ try { if ( res.getColorSpaceType () == ColorSpace.TYPE_RGB && res.getDataSize(icSigMediaWhitePointTag) > 0 && @@ -693,40 +697,42 @@ case ColorSpace.CS_sRGB: if (sRGBProfile == null) { - sRGBProfile = getInstance("sRGB.pf"); + sRGBProfile = getInstance("sRGB.pf"); //$NON-NLS-1$ } return sRGBProfile; case ColorSpace.CS_CIEXYZ: if (xyzProfile == null) { - xyzProfile = getInstance("CIEXYZ.pf"); + xyzProfile = getInstance("CIEXYZ.pf"); //$NON-NLS-1$ } return xyzProfile; case ColorSpace.CS_GRAY: if (grayProfile == null) { - grayProfile = getInstance("GRAY.pf"); + grayProfile = getInstance("GRAY.pf"); //$NON-NLS-1$ } return grayProfile; case ColorSpace.CS_PYCC: if (pyccProfile == null) { - pyccProfile = getInstance("PYCC.pf"); + pyccProfile = getInstance("PYCC.pf"); //$NON-NLS-1$ } return pyccProfile; case ColorSpace.CS_LINEAR_RGB: if (linearRGBProfile == null) { - linearRGBProfile = getInstance("LINEAR_RGB.pf"); + linearRGBProfile = getInstance("LINEAR_RGB.pf"); //$NON-NLS-1$ } return linearRGBProfile; } } catch (IOException e) { - throw new IllegalArgumentException("Can't open color profile"); + // awt.163=Can't open color profile + throw new IllegalArgumentException(Messages.getString("awt.163")); //$NON-NLS-1$ } - throw new IllegalArgumentException("Not a predefined color space"); + // awt.164=Not a predefined color space + throw new IllegalArgumentException(Messages.getString("awt.164")); //$NON-NLS-1$ } /** @@ -819,9 +825,8 @@ default: } - throw new IllegalArgumentException ( - "Color space doesn't comply with ICC specification" - ); + // awt.165=Color space doesn't comply with ICC specification + throw new IllegalArgumentException (Messages.getString("awt.165")); //$NON-NLS-1$ } private long getProfileHandle() { @@ -899,7 +904,8 @@ if (dataTRC == null) { return gamma; } - throw new ProfileDataException("TRC is not a simple gamma value."); + // awt.166=TRC is not a simple gamma value. + throw new ProfileDataException(Messages.getString("awt.166")); //$NON-NLS-1$ } short[] getTRC(int tagSignature) { @@ -907,7 +913,8 @@ getGammaOrTRC(tagSignature, dataTRC); if (dataTRC == null) { - throw new ProfileDataException("TRC is a gamma value, not a table."); + // awt.167=TRC is a gamma value, not a table. + throw new ProfileDataException(Messages.getString("awt.167")); //$NON-NLS-1$ } return dataTRC; } Index: src/main/java/common/java/awt/color/ICC_ProfileRGB.java =================================================================== --- src/main/java/common/java/awt/color/ICC_ProfileRGB.java (revision 470363) +++ src/main/java/common/java/awt/color/ICC_ProfileRGB.java (working copy) @@ -20,6 +20,8 @@ */ package java.awt.color; +import org.apache.harmony.awt.internal.nls.Messages; + public class ICC_ProfileRGB extends ICC_Profile { private static final long serialVersionUID = 8505067385152579334L; @@ -33,9 +35,9 @@ public static final int BLUECOMPONENT = 2; - private static final String UNKNOWN_COMPONENT_MSG = - "Unknown component. Must be REDCOMPONENT, " + - "GREENCOMPONENT or BLUECOMPONENT."; + // awt.15E=Unknown component. Must be REDCOMPONENT, GREENCOMPONENT or BLUECOMPONENT. + private static final String UNKNOWN_COMPONENT_MSG = Messages + .getString("awt.15E"); //$NON-NLS-1$ @Override public short[] getTRC(int component) { Index: src/main/java/common/java/awt/color/ICC_ProfileStub.java =================================================================== --- src/main/java/common/java/awt/color/ICC_ProfileStub.java (revision 470363) +++ src/main/java/common/java/awt/color/ICC_ProfileStub.java (working copy) @@ -26,6 +26,8 @@ import java.io.ObjectStreamException; import java.io.OutputStream; +import org.apache.harmony.awt.internal.nls.Messages; + final class ICC_ProfileStub extends ICC_Profile { private static final long serialVersionUID = 501389760875253507L; @@ -40,14 +42,15 @@ case ColorSpace.CS_GRAY: break; default: - throw new IllegalArgumentException("Invalid colorspace"); + // awt.15D=Invalid colorspace + throw new IllegalArgumentException(Messages.getString("awt.15D")); //$NON-NLS-1$ } colorspace = csSpecifier; } @Override public void write(String fileName) throws IOException { - throw new UnsupportedOperationException("Stub cannot perform this operation"); + throw new UnsupportedOperationException("Stub cannot perform this operation"); //$NON-NLS-1$ } /** @@ -61,22 +64,22 @@ @Override public void write(OutputStream s) throws IOException { - throw new UnsupportedOperationException("Stub cannot perform this operation"); + throw new UnsupportedOperationException("Stub cannot perform this operation"); //$NON-NLS-1$ } @Override public void setData(int tagSignature, byte[] tagData) { - throw new UnsupportedOperationException("Stub cannot perform this operation"); + throw new UnsupportedOperationException("Stub cannot perform this operation"); //$NON-NLS-1$ } @Override public byte[] getData(int tagSignature) { - throw new UnsupportedOperationException("Stub cannot perform this operation"); + throw new UnsupportedOperationException("Stub cannot perform this operation"); //$NON-NLS-1$ } @Override public byte[] getData() { - throw new UnsupportedOperationException("Stub cannot perform this operation"); + throw new UnsupportedOperationException("Stub cannot perform this operation"); //$NON-NLS-1$ } @Override @@ -90,7 +93,7 @@ @Override public int getPCSType() { - throw new UnsupportedOperationException("Stub cannot perform this operation"); + throw new UnsupportedOperationException("Stub cannot perform this operation"); //$NON-NLS-1$ } @Override @@ -104,18 +107,18 @@ case ColorSpace.CS_GRAY: return 1; default: - throw new UnsupportedOperationException("Stub cannot perform this operation"); + throw new UnsupportedOperationException("Stub cannot perform this operation"); //$NON-NLS-1$ } } @Override public int getMinorVersion() { - throw new UnsupportedOperationException("Stub cannot perform this operation"); + throw new UnsupportedOperationException("Stub cannot perform this operation"); //$NON-NLS-1$ } @Override public int getMajorVersion() { - throw new UnsupportedOperationException("Stub cannot perform this operation"); + throw new UnsupportedOperationException("Stub cannot perform this operation"); //$NON-NLS-1$ } @Override @@ -131,24 +134,24 @@ case ColorSpace.CS_GRAY: return ColorSpace.TYPE_GRAY; default: - throw new UnsupportedOperationException("Stub cannot perform this operation"); + throw new UnsupportedOperationException("Stub cannot perform this operation"); //$NON-NLS-1$ } } public static ICC_Profile getInstance(String fileName) throws IOException { - throw new UnsupportedOperationException("Stub cannot perform this operation"); + throw new UnsupportedOperationException("Stub cannot perform this operation"); //$NON-NLS-1$ } public static ICC_Profile getInstance(InputStream s) throws IOException { - throw new UnsupportedOperationException("Stub cannot perform this operation"); + throw new UnsupportedOperationException("Stub cannot perform this operation"); //$NON-NLS-1$ } public static ICC_Profile getInstance(byte[] data) { - throw new UnsupportedOperationException("Stub cannot perform this operation"); + throw new UnsupportedOperationException("Stub cannot perform this operation"); //$NON-NLS-1$ } public static ICC_Profile getInstance(int cspace) { - throw new UnsupportedOperationException("Stub cannot perform this operation"); + throw new UnsupportedOperationException("Stub cannot perform this operation"); //$NON-NLS-1$ } public ICC_Profile loadProfile() { @@ -164,7 +167,7 @@ case ColorSpace.CS_PYCC: return ICC_Profile.getInstance(ColorSpace.CS_PYCC); default: - throw new UnsupportedOperationException("Stub cannot perform this operation"); + throw new UnsupportedOperationException("Stub cannot perform this operation"); //$NON-NLS-1$ } } } \ No newline at end of file Index: src/main/java/common/java/awt/datatransfer/DataFlavor.java =================================================================== --- src/main/java/common/java/awt/datatransfer/DataFlavor.java (revision 470363) +++ src/main/java/common/java/awt/datatransfer/DataFlavor.java (working copy) @@ -26,6 +26,7 @@ import java.util.*; import org.apache.harmony.awt.datatransfer.*; +import org.apache.harmony.awt.internal.nls.Messages; public class DataFlavor implements Externalizable, Cloneable { @@ -37,47 +38,47 @@ */ @Deprecated public static final DataFlavor plainTextFlavor = - new DataFlavor("text/plain; charset=unicode; class=java.io.InputStream", - "Plain Text"); + new DataFlavor("text/plain; charset=unicode; class=java.io.InputStream", //$NON-NLS-1$ + "Plain Text"); //$NON-NLS-1$ public static final DataFlavor stringFlavor = - new DataFlavor("application/x-java-serialized-object; class=java.lang.String", - "Unicode String"); + new DataFlavor("application/x-java-serialized-object; class=java.lang.String", //$NON-NLS-1$ + "Unicode String"); //$NON-NLS-1$ public static final DataFlavor imageFlavor = - new DataFlavor("image/x-java-image; class=java.awt.Image", - "Image"); + new DataFlavor("image/x-java-image; class=java.awt.Image", //$NON-NLS-1$ + "Image"); //$NON-NLS-1$ public static final DataFlavor javaFileListFlavor = - new DataFlavor("application/x-java-file-list; class=java.util.List", - "application/x-java-file-list"); + new DataFlavor("application/x-java-file-list; class=java.util.List", //$NON-NLS-1$ + "application/x-java-file-list"); //$NON-NLS-1$ public static final String javaJVMLocalObjectMimeType = - "application/x-java-jvm-local-objectref"; + "application/x-java-jvm-local-objectref"; //$NON-NLS-1$ public static final String javaRemoteObjectMimeType = - "application/x-java-remote-object"; + "application/x-java-remote-object"; //$NON-NLS-1$ public static final String javaSerializedObjectMimeType = - "application/x-java-serialized-object"; + "application/x-java-serialized-object"; //$NON-NLS-1$ private static final String sortedTextFlavors[] = { - "text/sgml", - "text/xml", - "text/html", - "text/rtf", - "text/enriched", - "text/richtext", - "text/uri-list", - "text/tab-separated-values", - "text/t140" , - "text/rfc822-headers", - "text/parityfec", - "text/directory", - "text/css", - "text/calendar", - "application/x-java-serialized-object", - "text/plain" + "text/sgml", //$NON-NLS-1$ + "text/xml", //$NON-NLS-1$ + "text/html", //$NON-NLS-1$ + "text/rtf", //$NON-NLS-1$ + "text/enriched", //$NON-NLS-1$ + "text/richtext", //$NON-NLS-1$ + "text/uri-list", //$NON-NLS-1$ + "text/tab-separated-values", //$NON-NLS-1$ + "text/t140" , //$NON-NLS-1$ + "text/rfc822-headers", //$NON-NLS-1$ + "text/parityfec", //$NON-NLS-1$ + "text/directory", //$NON-NLS-1$ + "text/css", //$NON-NLS-1$ + "text/calendar", //$NON-NLS-1$ + "application/x-java-serialized-object", //$NON-NLS-1$ + "text/plain" //$NON-NLS-1$ }; private static DataFlavor plainUnicodeFlavor = null; @@ -88,10 +89,10 @@ public static final DataFlavor getTextPlainUnicodeFlavor() { if (plainUnicodeFlavor == null) { - plainUnicodeFlavor = new DataFlavor("text/plain" - + "; charset=" + DTK.getDTK().getDefaultCharset() - + "; class=java.io.InputStream", - "Plain Text"); + plainUnicodeFlavor = new DataFlavor("text/plain" //$NON-NLS-1$ + + "; charset=" + DTK.getDTK().getDefaultCharset() //$NON-NLS-1$ + + "; class=java.io.InputStream", //$NON-NLS-1$ + "Plain Text"); //$NON-NLS-1$ } return plainUnicodeFlavor; @@ -135,15 +136,15 @@ } public DataFlavor(Class representationClass, String humanPresentableName) { - mimeInfo = new MimeTypeProcessor.MimeType("application", "x-java-serialized-object"); + mimeInfo = new MimeTypeProcessor.MimeType("application", "x-java-serialized-object"); //$NON-NLS-1$ //$NON-NLS-2$ if (humanPresentableName != null) { this.humanPresentableName = humanPresentableName; } else { - this.humanPresentableName = "application/x-java-serialized-object"; + this.humanPresentableName = "application/x-java-serialized-object"; //$NON-NLS-1$ } - mimeInfo.addParameter("class", representationClass.getName()); + mimeInfo.addParameter("class", representationClass.getName()); //$NON-NLS-1$ this.representationClass = representationClass; } @@ -151,7 +152,8 @@ try { init(mimeType, humanPresentableName, null); } catch (ClassNotFoundException e) { - throw new IllegalArgumentException("Can't load class: " + mimeInfo.getParameter("class")); + // awt.16C=Can't load class: {0} + throw new IllegalArgumentException(Messages.getString("awt.16C", mimeInfo.getParameter("class"))); //$NON-NLS-1$//$NON-NLS-2$ } } @@ -173,7 +175,8 @@ try { mimeInfo = MimeTypeProcessor.parse(mimeType); } catch (IllegalArgumentException e) { - throw new IllegalArgumentException("Can't parse MIME type: " + mimeType); + // awt.16D=Can't parse MIME type: {0} + throw new IllegalArgumentException(Messages.getString("awt.16D", mimeType)); //$NON-NLS-1$ } if (humanPresentableName != null) { @@ -182,10 +185,10 @@ this.humanPresentableName = mimeInfo.getPrimaryType() + '/' + mimeInfo.getSubType(); } - className = mimeInfo.getParameter("class"); + className = mimeInfo.getParameter("class"); //$NON-NLS-1$ if (className == null) { - className = "java.io.InputStream"; - mimeInfo.addParameter("class", className); + className = "java.io.InputStream"; //$NON-NLS-1$ + mimeInfo.addParameter("class", className); //$NON-NLS-1$ } representationClass = (classLoader == null) ? Class.forName(className) : @@ -194,15 +197,15 @@ private String getCharset() { if (isCharsetRedundant()) { - return ""; + return ""; //$NON-NLS-1$ } - String charset = mimeInfo.getParameter("charset"); + String charset = mimeInfo.getParameter("charset"); //$NON-NLS-1$ if (isCharsetRequired() && ((charset == null) || (charset.length() == 0))) { return DTK.getDTK().getDefaultCharset(); } if (charset == null) { - return ""; + return ""; //$NON-NLS-1$ } return charset; @@ -211,27 +214,27 @@ private boolean isCharsetRequired() { String type = mimeInfo.getFullType(); - return (type.equals("text/sgml") || - type.equals("text/xml") || - type.equals("text/html") || - type.equals("text/enriched") || - type.equals("text/richtext") || - type.equals("text/uri-list") || - type.equals("text/directory") || - type.equals("text/css") || - type.equals("text/calendar") || - type.equals("application/x-java-serialized-object") || - type.equals("text/plain")); + return (type.equals("text/sgml") || //$NON-NLS-1$ + type.equals("text/xml") || //$NON-NLS-1$ + type.equals("text/html") || //$NON-NLS-1$ + type.equals("text/enriched") || //$NON-NLS-1$ + type.equals("text/richtext") || //$NON-NLS-1$ + type.equals("text/uri-list") || //$NON-NLS-1$ + type.equals("text/directory") || //$NON-NLS-1$ + type.equals("text/css") || //$NON-NLS-1$ + type.equals("text/calendar") || //$NON-NLS-1$ + type.equals("application/x-java-serialized-object") || //$NON-NLS-1$ + type.equals("text/plain")); //$NON-NLS-1$ } private boolean isCharsetRedundant() { String type = mimeInfo.getFullType(); - return (type.equals("text/rtf") || - type.equals("text/tab-separated-values") || - type.equals("text/t140") || - type.equals("text/rfc822-headers") || - type.equals("text/parityfec")); + return (type.equals("text/rtf") || //$NON-NLS-1$ + type.equals("text/tab-separated-values") || //$NON-NLS-1$ + type.equals("text/t140") || //$NON-NLS-1$ + type.equals("text/rfc822-headers") || //$NON-NLS-1$ + type.equals("text/parityfec")); //$NON-NLS-1$ } MimeTypeProcessor.MimeType getMimeInfo() { @@ -253,7 +256,7 @@ public String getParameter(String paramName) { String lowerName = paramName.toLowerCase(); - if (lowerName.equals("humanpresentablename")) { + if (lowerName.equals("humanpresentablename")) { //$NON-NLS-1$ return humanPresentableName; } return mimeInfo.getParameter(lowerName); @@ -345,7 +348,7 @@ mimeInfo = (MimeTypeProcessor.MimeType) is.readObject(); representationClass = (mimeInfo != null) ? - Class.forName(mimeInfo.getParameter("class")) : null; + Class.forName(mimeInfo.getParameter("class")) : null; //$NON-NLS-1$ } @Override @@ -368,8 +371,8 @@ */ return (getClass().getName() - + "[MimeType=(" + getMimeType() - + ");humanPresentableName=" + humanPresentableName + "]"); + + "[MimeType=(" + getMimeType() //$NON-NLS-1$ + + ");humanPresentableName=" + humanPresentableName + "]"); //$NON-NLS-1$ //$NON-NLS-2$ } public boolean isMimeTypeSerializedObject() { @@ -399,7 +402,7 @@ { return false; } - if (!mimeInfo.getPrimaryType().equals("text") || isUnicodeFlavor()) { + if (!mimeInfo.getPrimaryType().equals("text") || isUnicodeFlavor()) { //$NON-NLS-1$ return true; } @@ -432,13 +435,13 @@ } private String getKeyInfo() { - String key = mimeInfo.getFullType() + ";class=" + representationClass.getName(); + String key = mimeInfo.getFullType() + ";class=" + representationClass.getName(); //$NON-NLS-1$ - if (!mimeInfo.getPrimaryType().equals("text") || isUnicodeFlavor()) { + if (!mimeInfo.getPrimaryType().equals("text") || isUnicodeFlavor()) { //$NON-NLS-1$ return key; } - return key + ";charset=" + getCharset().toLowerCase(); + return key + ";charset=" + getCharset().toLowerCase(); //$NON-NLS-1$ } public boolean isFlavorSerializedObjectType() { @@ -460,7 +463,7 @@ if (equals(stringFlavor) || equals(plainTextFlavor)) { return true; } - if (!mimeInfo.getPrimaryType().equals("text")) { + if (!mimeInfo.getPrimaryType().equals("text")) { //$NON-NLS-1$ return false; } @@ -483,7 +486,8 @@ Object data = transferable.getTransferData(this); if (data == null) { - throw new IllegalArgumentException("Transferable has null data"); + // awt.16E=Transferable has null data + throw new IllegalArgumentException(Messages.getString("awt.16E")); //$NON-NLS-1$ } if (data instanceof Reader) { @@ -508,8 +512,8 @@ } else if (data instanceof byte[]) { stream = new ByteArrayInputStream((byte[]) data); } else { - throw new IllegalArgumentException( - "Can't create reader for this representation class"); + // awt.16F=Can't create reader for this representation class + throw new IllegalArgumentException(Messages.getString("awt.16F")); //$NON-NLS-1$ } if (charset.length() == 0) { @@ -568,11 +572,11 @@ private static DataFlavor selectBestByCharset(List list) { List best; - best = getFlavors(list, new String[] {"UTF-16", "UTF-8", "UTF-16BE", "UTF-16LE"}); + best = getFlavors(list, new String[] {"UTF-16", "UTF-8", "UTF-16BE", "UTF-16LE"}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ if (best == null) { best = getFlavors(list, new String[] {DTK.getDTK().getDefaultCharset()}); if (best == null) { - best = getFlavors(list, new String[] {"US-ASCII"}); + best = getFlavors(list, new String[] {"US-ASCII"}); //$NON-NLS-1$ if (best == null) { best = selectBestByAlphabet(list); } Index: src/main/java/common/java/awt/datatransfer/MimeTypeProcessor.java =================================================================== --- src/main/java/common/java/awt/datatransfer/MimeTypeProcessor.java (revision 470363) +++ src/main/java/common/java/awt/datatransfer/MimeTypeProcessor.java (working copy) @@ -55,9 +55,9 @@ String name = keys.nextElement(); String value = type.parameters.get(name); - buf.append("; "); + buf.append("; "); //$NON-NLS-1$ buf.append(name); - buf.append("=\""); + buf.append("=\""); //$NON-NLS-1$ buf.append(value); buf.append('"'); } @@ -216,7 +216,7 @@ } String getFullType() { - return (primaryType + "/" + subType); + return (primaryType + "/" + subType); //$NON-NLS-1$ } String getParameter(String name) { Index: src/main/java/common/java/awt/datatransfer/SystemFlavorMap.java =================================================================== --- src/main/java/common/java/awt/datatransfer/SystemFlavorMap.java (revision 470363) +++ src/main/java/common/java/awt/datatransfer/SystemFlavorMap.java (working copy) @@ -34,7 +34,7 @@ public final class SystemFlavorMap implements FlavorMap, FlavorTable { private static final String SERIALIZED_PREFIX = - "org.apache.harmony.awt.datatransfer:"; + "org.apache.harmony.awt.datatransfer:"; //$NON-NLS-1$ private final HashMap> flavor2Native = new HashMap>(); private final HashMap> native2Flavor = new HashMap>(); Index: src/main/java/common/java/awt/datatransfer/UnsupportedFlavorException.java =================================================================== --- src/main/java/common/java/awt/datatransfer/UnsupportedFlavorException.java (revision 470363) +++ src/main/java/common/java/awt/datatransfer/UnsupportedFlavorException.java (working copy) @@ -21,6 +21,6 @@ private static final long serialVersionUID = 5383814944251665601L; public UnsupportedFlavorException(DataFlavor flavor) { - super("flavor = " + flavor.toString()); + super("flavor = " + flavor.toString()); //$NON-NLS-1$ } } Index: src/main/java/common/java/awt/dnd/DragGestureEvent.java =================================================================== --- src/main/java/common/java/awt/dnd/DragGestureEvent.java (revision 470363) +++ src/main/java/common/java/awt/dnd/DragGestureEvent.java (working copy) @@ -27,6 +27,8 @@ import java.util.Iterator; import java.util.List; +import org.apache.harmony.awt.internal.nls.Messages; + public class DragGestureEvent extends EventObject { private static final long serialVersionUID = 9080172649166731306L; @@ -45,22 +47,28 @@ super(dgr); if (dgr.getComponent() == null) { - throw new IllegalArgumentException("Component is null."); + // awt.185=Component is null. + throw new IllegalArgumentException(Messages.getString("awt.185")); //$NON-NLS-1$ } if (dgr.getDragSource() == null) { - throw new IllegalArgumentException("DragSource is null."); + // awt.186=DragSource is null. + throw new IllegalArgumentException(Messages.getString("awt.186")); //$NON-NLS-1$ } if (!DnDConstants.isValidAction(act)) { - throw new IllegalArgumentException("Invalid action."); + // awt.184=Invalid action. + throw new IllegalArgumentException(Messages.getString("awt.184")); //$NON-NLS-1$ } if (ori == null) { - throw new IllegalArgumentException("Origin is null."); + // awt.187=Origin is null. + throw new IllegalArgumentException(Messages.getString("awt.187")); //$NON-NLS-1$ } if (evs == null) { - throw new IllegalArgumentException("Event list is null."); + // awt.188=Event list is null. + throw new IllegalArgumentException(Messages.getString("awt.188")); //$NON-NLS-1$ } if (evs.isEmpty()) { - throw new IllegalArgumentException("Event list is empty."); + // awt.189=Event list is empty. + throw new IllegalArgumentException(Messages.getString("awt.189")); //$NON-NLS-1$ } recognizer = dgr; Index: src/main/java/common/java/awt/dnd/DragGestureRecognizer.java =================================================================== --- src/main/java/common/java/awt/dnd/DragGestureRecognizer.java (revision 470363) +++ src/main/java/common/java/awt/dnd/DragGestureRecognizer.java (working copy) @@ -24,6 +24,8 @@ import java.util.ArrayList; import java.util.TooManyListenersException; +import org.apache.harmony.awt.internal.nls.Messages; + public abstract class DragGestureRecognizer implements Serializable { private static final long serialVersionUID = 8996673345831063337L; @@ -40,7 +42,8 @@ protected DragGestureRecognizer(DragSource ds, Component c, int sa, DragGestureListener dgl) { if (ds == null) { - throw new IllegalArgumentException("Drag source is null."); + // awt.172=Drag source is null. + throw new IllegalArgumentException(Messages.getString("awt.172")); //$NON-NLS-1$ } dragSource = ds; @@ -121,7 +124,8 @@ return; } if (dragGestureListener != null) { - throw new TooManyListenersException("One listener is already exist."); + // awt.173=One listener is already exist. + throw new TooManyListenersException(Messages.getString("awt.173")); //$NON-NLS-1$ } dragGestureListener = dgl; @@ -130,7 +134,8 @@ public synchronized void removeDragGestureListener(DragGestureListener dgl) { if (dragGestureListener != dgl) { - throw new IllegalArgumentException("dgl is not current listener."); + // awt.174=dgl is not current listener. + throw new IllegalArgumentException(Messages.getString("awt.174")); //$NON-NLS-1$ } if (dragGestureListener == null) { return; Index: src/main/java/common/java/awt/dnd/DragSource.java =================================================================== --- src/main/java/common/java/awt/dnd/DragSource.java (revision 470363) +++ src/main/java/common/java/awt/dnd/DragSource.java (working copy) @@ -32,6 +32,7 @@ import java.util.EventListener; import org.apache.harmony.awt.ListenerList; +import org.apache.harmony.awt.internal.nls.Messages; // TODO: think of synchronization @@ -66,12 +67,12 @@ } else { Toolkit toolkit = Toolkit.getDefaultToolkit(); - DefaultMoveDrop = getDefaultCursor(toolkit, "dnd.MoveCursor"); - DefaultMoveNoDrop = getDefaultCursor(toolkit, "dnd.NoMoveCursor"); - DefaultCopyDrop = getDefaultCursor(toolkit, "dnd.CopyCursor"); - DefaultCopyNoDrop = getDefaultCursor(toolkit, "dnd.NoCopyCursor"); - DefaultLinkDrop = getDefaultCursor(toolkit, "dnd.LinkCursor"); - DefaultLinkNoDrop = getDefaultCursor(toolkit, "dnd.NoLinkCursor"); + DefaultMoveDrop = getDefaultCursor(toolkit, "dnd.MoveCursor"); //$NON-NLS-1$ + DefaultMoveNoDrop = getDefaultCursor(toolkit, "dnd.NoMoveCursor"); //$NON-NLS-1$ + DefaultCopyDrop = getDefaultCursor(toolkit, "dnd.CopyCursor"); //$NON-NLS-1$ + DefaultCopyNoDrop = getDefaultCursor(toolkit, "dnd.NoCopyCursor"); //$NON-NLS-1$ + DefaultLinkDrop = getDefaultCursor(toolkit, "dnd.LinkCursor"); //$NON-NLS-1$ + DefaultLinkNoDrop = getDefaultCursor(toolkit, "dnd.NoLinkCursor"); //$NON-NLS-1$ } } @@ -80,7 +81,7 @@ return (Cursor) toolkit.getDesktopProperty(name); } catch (Exception e) { e.printStackTrace(); - throw new RuntimeException("Can't create default D&D cursor: " + e); + throw new RuntimeException(Messages.getString("awt.170", e)); //$NON-NLS-1$ } } @@ -102,11 +103,11 @@ } public static int getDragThreshold() { - int threshold = Integer.getInteger("awt.dnd.drag.threshold", -1).intValue(); + int threshold = Integer.getInteger("awt.dnd.drag.threshold", -1).intValue(); //$NON-NLS-1$ if (threshold <= 0) { Object val = Toolkit.getDefaultToolkit().getDesktopProperty( - "DnD.gestureMotionThreshold" + "DnD.gestureMotionThreshold" //$NON-NLS-1$ ); if (val != null && val instanceof Integer) { @@ -187,9 +188,8 @@ throws InvalidDnDOperationException { if (curContext != null) { - throw new InvalidDnDOperationException( - "Attempt to start a drag while an existing " + - "drag operation is still executing."); + // awt.171=Attempt to start a drag while an existing drag operation is still executing. + throw new InvalidDnDOperationException(Messages.getString("awt.171")); //$NON-NLS-1$ } DragSourceContextPeer peer = Index: src/main/java/common/java/awt/dnd/DragSourceContext.java =================================================================== --- src/main/java/common/java/awt/dnd/DragSourceContext.java (revision 470363) +++ src/main/java/common/java/awt/dnd/DragSourceContext.java (working copy) @@ -26,6 +26,8 @@ import java.io.Serializable; import java.util.TooManyListenersException; +import org.apache.harmony.awt.internal.nls.Messages; + public class DragSourceContext implements DragSourceListener, DragSourceMotionListener, Serializable { @@ -60,31 +62,38 @@ Transferable t, DragSourceListener dsl) { if (dscp == null) { - throw new NullPointerException("Context peer is null."); + // awt.179=Context peer is null. + throw new NullPointerException(Messages.getString("awt.179")); //$NON-NLS-1$ } if (trigger == null) { - throw new NullPointerException("Trigger event is null."); + // awt.17A=Trigger event is null. + throw new NullPointerException(Messages.getString("awt.17A")); //$NON-NLS-1$ } if (trigger.getDragAction() == DnDConstants.ACTION_NONE) { - throw new RuntimeException("Can't init ACTION_NONE drag."); + // awt.17B=Can't init ACTION_NONE drag. + throw new RuntimeException(Messages.getString("awt.17B")); //$NON-NLS-1$ } if ((dragImage != null) && (offset == null)) { - throw new NullPointerException("Image offset is null."); + // awt.17C=Image offset is null. + throw new NullPointerException(Messages.getString("awt.17C")); //$NON-NLS-1$ } if (t == null) { - throw new NullPointerException("Transferable is null."); + // awt.17D=Transferable is null. + throw new NullPointerException(Messages.getString("awt.17D")); //$NON-NLS-1$ } if (trigger.getComponent() == null) { - throw new IllegalArgumentException( - "Component associated with the trigger event is null."); + // awt.17E=Component associated with the trigger event is null. + throw new IllegalArgumentException(Messages.getString("awt.17E")); //$NON-NLS-1$ } if (trigger.getDragSource() == null) { - throw new IllegalArgumentException("DragSource for the trigger event is null."); + // awt.17F=DragSource for the trigger event is null. + throw new IllegalArgumentException(Messages.getString("awt.17F")); //$NON-NLS-1$ } if (trigger.getSourceAsDragGestureRecognizer().getSourceActions() == DnDConstants.ACTION_NONE) { - throw new IllegalArgumentException("Source actions for the DragGestureRecognizer associated with the trigger event are equal to DnDConstants.ACTION_NONE."); + // awt.180=Source actions for the DragGestureRecognizer associated with the trigger event are equal to DnDConstants.ACTION_NONE. + throw new IllegalArgumentException(Messages.getString("awt.180")); //$NON-NLS-1$ } this.trigger = trigger; @@ -143,10 +152,12 @@ return; } if (dsl == this) { - throw new IllegalArgumentException("Attempt to register context as its listener."); + // awt.181=Attempt to register context as its listener. + throw new IllegalArgumentException(Messages.getString("awt.181")); //$NON-NLS-1$ } if (listener != null) { - throw new TooManyListenersException("One listener is already exist."); + // awt.173=One listener is already exist. + throw new TooManyListenersException(Messages.getString("awt.173")); //$NON-NLS-1$ } listener = dsl; @@ -154,7 +165,8 @@ public synchronized void removeDragSourceListener(DragSourceListener dsl) { if (listener != dsl) { - throw new IllegalArgumentException("dsl is not current listener."); + // awt.182=dsl is not current listener. + throw new IllegalArgumentException(Messages.getString("awt.182")); //$NON-NLS-1$ } listener = null; @@ -165,7 +177,8 @@ return; } if ((status < DEFAULT) || (status > CHANGED)) { - throw new RuntimeException("Invalid status."); + // awt.183=Invalid status. + throw new RuntimeException(Messages.getString("awt.183")); //$NON-NLS-1$ } int possibleOps = dropOp & ((status == DEFAULT) ? DnDConstants.ACTION_NONE : targetAct); @@ -211,7 +224,8 @@ case DnDConstants.ACTION_LINK: return (enabled ? DragSource.DefaultLinkDrop : DragSource.DefaultLinkNoDrop); default: - throw new RuntimeException("Invalid action."); + // awt.184=Invalid action. + throw new RuntimeException(Messages.getString("awt.184")); //$NON-NLS-1$ } } Index: src/main/java/common/java/awt/dnd/DragSourceEvent.java =================================================================== --- src/main/java/common/java/awt/dnd/DragSourceEvent.java (revision 470363) +++ src/main/java/common/java/awt/dnd/DragSourceEvent.java (working copy) @@ -23,6 +23,8 @@ import java.awt.Point; import java.util.EventObject; +import org.apache.harmony.awt.internal.nls.Messages; + public class DragSourceEvent extends EventObject { private static final long serialVersionUID = -763287114604032641L; @@ -40,7 +42,8 @@ super(dsc); if (dsc == null) { - throw new IllegalArgumentException("Context is null."); + // awt.18A=Context is null. + throw new IllegalArgumentException(Messages.getString("awt.18A")); //$NON-NLS-1$ } context = dsc; Index: src/main/java/common/java/awt/dnd/DropTarget.java =================================================================== --- src/main/java/common/java/awt/dnd/DropTarget.java (revision 470363) +++ src/main/java/common/java/awt/dnd/DropTarget.java (working copy) @@ -34,6 +34,7 @@ import java.util.TooManyListenersException; import org.apache.harmony.awt.datatransfer.DTK; +import org.apache.harmony.awt.internal.nls.Messages; public class DropTarget implements DropTargetListener, Serializable { @@ -128,7 +129,8 @@ return; } if (dtl != dropTargetListener) { - throw new IllegalArgumentException("Listener mismatch"); + // awt.175=Listener mismatch + throw new IllegalArgumentException(Messages.getString("awt.175")); //$NON-NLS-1$ } dropTargetListener = null; } @@ -139,8 +141,8 @@ return; } if (dtl == this) { - throw new IllegalArgumentException( - "DropTarget cannot be added as listener to itself"); + // awt.176=DropTarget cannot be added as listener to itself + throw new IllegalArgumentException(Messages.getString("awt.176")); //$NON-NLS-1$ } if (dropTargetListener != null) { throw new TooManyListenersException(); Index: src/main/java/common/java/awt/dnd/DropTargetContext.java =================================================================== --- src/main/java/common/java/awt/dnd/DropTargetContext.java (revision 470363) +++ src/main/java/common/java/awt/dnd/DropTargetContext.java (working copy) @@ -32,6 +32,8 @@ import java.util.Arrays; import java.util.List; +import org.apache.harmony.awt.internal.nls.Messages; + public class DropTargetContext implements Serializable { private static final long serialVersionUID = -634158968993743371L; @@ -111,7 +113,8 @@ protected Transferable getTransferable() throws InvalidDnDOperationException { if (peer == null) { - throw new InvalidDnDOperationException("Transfer data is not available"); + // awt.07=Transfer data is not available + throw new InvalidDnDOperationException(Messages.getString("awt.07")); //$NON-NLS-1$ } return new TransferableProxy(peer.isTransferableJVMLocal(), peer.getTransferable()); } Index: src/main/java/common/java/awt/dnd/DropTargetEvent.java =================================================================== --- src/main/java/common/java/awt/dnd/DropTargetEvent.java (revision 470363) +++ src/main/java/common/java/awt/dnd/DropTargetEvent.java (working copy) @@ -23,6 +23,8 @@ import java.awt.Point; import java.util.EventObject; +import org.apache.harmony.awt.internal.nls.Messages; + public class DropTargetEvent extends EventObject { private static final long serialVersionUID = 2821229066521922993L; @@ -49,10 +51,12 @@ this(dtc); if (!DnDConstants.isValidAction(userAction)) { - throw new IllegalArgumentException("Invalid user action."); + // awt.177=Invalid user action. + throw new IllegalArgumentException(Messages.getString("awt.177")); //$NON-NLS-1$ } if (!DnDConstants.isValidAction(sourceAction)) { - throw new IllegalArgumentException("Invalid source action."); + // awt.178=Invalid source action. + throw new IllegalArgumentException(Messages.getString("awt.178")); //$NON-NLS-1$ } this.location = (Point) location.clone(); Index: src/main/java/common/java/awt/event/ActionEvent.java =================================================================== --- src/main/java/common/java/awt/event/ActionEvent.java (revision 470363) +++ src/main/java/common/java/awt/event/ActionEvent.java (working copy) @@ -85,24 +85,24 @@ */ String idString = (id == ACTION_PERFORMED) ? - "ACTION_PERFORMED" : "unknown type"; - String modifiersString = ""; + "ACTION_PERFORMED" : "unknown type"; //$NON-NLS-1$ //$NON-NLS-2$ + String modifiersString = ""; //$NON-NLS-1$ if ((modifiers & SHIFT_MASK) > 0) { - modifiersString += "Shift"; + modifiersString += "Shift"; //$NON-NLS-1$ } if ((modifiers & CTRL_MASK) > 0) { - modifiersString += modifiersString.length() == 0 ? "Ctrl" : "+Ctrl"; + modifiersString += modifiersString.length() == 0 ? "Ctrl" : "+Ctrl"; //$NON-NLS-1$ //$NON-NLS-2$ } if ((modifiers & META_MASK) > 0) { - modifiersString += modifiersString.length() == 0 ? "Meta" : "+Meta"; + modifiersString += modifiersString.length() == 0 ? "Meta" : "+Meta"; //$NON-NLS-1$ //$NON-NLS-2$ } if ((modifiers & ALT_MASK) > 0) { - modifiersString += modifiersString.length() == 0 ? "Alt" : "+Alt"; + modifiersString += modifiersString.length() == 0 ? "Alt" : "+Alt"; //$NON-NLS-1$ //$NON-NLS-2$ } - return (idString + ",cmd=" + command + ",when=" + when + - ",modifiers=" + modifiersString); + return (idString + ",cmd=" + command + ",when=" + when + //$NON-NLS-1$ //$NON-NLS-2$ + ",modifiers=" + modifiersString); //$NON-NLS-1$ } } Index: src/main/java/common/java/awt/event/AdjustmentEvent.java =================================================================== --- src/main/java/common/java/awt/event/AdjustmentEvent.java (revision 470363) +++ src/main/java/common/java/awt/event/AdjustmentEvent.java (working copy) @@ -87,31 +87,31 @@ */ String idString = (id == ADJUSTMENT_VALUE_CHANGED ? - "ADJUSTMENT_VALUE_CHANGED" : "unknown type"); + "ADJUSTMENT_VALUE_CHANGED" : "unknown type"); //$NON-NLS-1$ //$NON-NLS-2$ String adjType = null; switch (type) { case UNIT_INCREMENT: - adjType = "UNIT_INCREMENT"; + adjType = "UNIT_INCREMENT"; //$NON-NLS-1$ break; case UNIT_DECREMENT: - adjType = "UNIT_DECREMENT"; + adjType = "UNIT_DECREMENT"; //$NON-NLS-1$ break; case BLOCK_INCREMENT: - adjType = "BLOCK_INCREMENT"; + adjType = "BLOCK_INCREMENT"; //$NON-NLS-1$ break; case BLOCK_DECREMENT: - adjType = "BLOCK_DECREMENT"; + adjType = "BLOCK_DECREMENT"; //$NON-NLS-1$ break; case TRACK: - adjType = "TRACK"; + adjType = "TRACK"; //$NON-NLS-1$ break; default: - adjType = "unknown type"; + adjType = "unknown type"; //$NON-NLS-1$ } - return (idString + ",adjType=" + adjType + ",value=" + value + - ",isAdjusting=" + isAdjusting); + return (idString + ",adjType=" + adjType + ",value=" + value + //$NON-NLS-1$ //$NON-NLS-2$ + ",isAdjusting=" + isAdjusting); //$NON-NLS-1$ } } Index: src/main/java/common/java/awt/event/AWTEventListenerProxy.java =================================================================== --- src/main/java/common/java/awt/event/AWTEventListenerProxy.java (revision 470363) +++ src/main/java/common/java/awt/event/AWTEventListenerProxy.java (working copy) @@ -24,6 +24,8 @@ import java.util.EventListenerProxy; +import org.apache.harmony.awt.internal.nls.Messages; + public class AWTEventListenerProxy extends EventListenerProxy implements AWTEventListener { private AWTEventListener listener; @@ -32,7 +34,8 @@ public AWTEventListenerProxy(long eventMask, AWTEventListener listener) { super(listener); - assert listener != null : "Listener can't be zero"; + // awt.193=Listener can't be zero + assert listener != null : Messages.getString("awt.193"); //$NON-NLS-1$ this.listener = listener; this.eventMask = eventMask; Index: src/main/java/common/java/awt/event/ComponentEvent.java =================================================================== --- src/main/java/common/java/awt/event/ComponentEvent.java (revision 470363) +++ src/main/java/common/java/awt/event/ComponentEvent.java (working copy) @@ -62,21 +62,21 @@ switch (id) { case COMPONENT_MOVED: - idString = "COMPONENT_MOVED"; + idString = "COMPONENT_MOVED"; //$NON-NLS-1$ break; case COMPONENT_RESIZED: - idString = "COMPONENT_RESIZED"; + idString = "COMPONENT_RESIZED"; //$NON-NLS-1$ break; case COMPONENT_SHOWN: - return "COMPONENT_SHOWN"; + return "COMPONENT_SHOWN"; //$NON-NLS-1$ case COMPONENT_HIDDEN: - return "COMPONENT_HIDDEN"; + return "COMPONENT_HIDDEN"; //$NON-NLS-1$ default: - return "unknown type"; + return "unknown type"; //$NON-NLS-1$ } - return (idString + " (" + c.getX() + "," + c.getY() + - " " + c.getWidth()+ "x" + c.getHeight() + ")"); + return (idString + " (" + c.getX() + "," + c.getY() + //$NON-NLS-1$ //$NON-NLS-2$ + " " + c.getWidth()+ "x" + c.getHeight() + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ } } Index: src/main/java/common/java/awt/event/ContainerEvent.java =================================================================== --- src/main/java/common/java/awt/event/ContainerEvent.java (revision 470363) +++ src/main/java/common/java/awt/event/ContainerEvent.java (working copy) @@ -65,16 +65,16 @@ switch (id) { case COMPONENT_ADDED: - idString = "COMPONENT_ADDED"; + idString = "COMPONENT_ADDED"; //$NON-NLS-1$ break; case COMPONENT_REMOVED: - idString = "COMPONENT_REMOVED"; + idString = "COMPONENT_REMOVED"; //$NON-NLS-1$ break; default: - idString = "unknown type"; + idString = "unknown type"; //$NON-NLS-1$ } - return (idString + ",child=" + child.getName()); + return (idString + ",child=" + child.getName()); //$NON-NLS-1$ } } Index: src/main/java/common/java/awt/event/FocusEvent.java =================================================================== --- src/main/java/common/java/awt/event/FocusEvent.java (revision 470363) +++ src/main/java/common/java/awt/event/FocusEvent.java (working copy) @@ -73,18 +73,18 @@ switch (id) { case FOCUS_GAINED: - idString = "FOCUS_GAINED"; + idString = "FOCUS_GAINED"; //$NON-NLS-1$ break; case FOCUS_LOST: - idString = "FOCUS_LOST"; + idString = "FOCUS_LOST"; //$NON-NLS-1$ break; default: - idString = "unknown type"; + idString = "unknown type"; //$NON-NLS-1$ } return (idString + - (temporary ? ",temporary" : ",permanent") + - ",opposite=" + opposite); + (temporary ? ",temporary" : ",permanent") + //$NON-NLS-1$ //$NON-NLS-2$ + ",opposite=" + opposite); //$NON-NLS-1$ } } Index: src/main/java/common/java/awt/event/HierarchyEvent.java =================================================================== --- src/main/java/common/java/awt/event/HierarchyEvent.java (revision 470363) +++ src/main/java/common/java/awt/event/HierarchyEvent.java (working copy) @@ -92,34 +92,34 @@ switch (id) { case HIERARCHY_CHANGED: - paramString = "HIERARCHY_CHANGED"; + paramString = "HIERARCHY_CHANGED"; //$NON-NLS-1$ break; case ANCESTOR_MOVED: - paramString = "ANCESTOR_MOVED"; + paramString = "ANCESTOR_MOVED"; //$NON-NLS-1$ break; case ANCESTOR_RESIZED: - paramString = "ANCESTOR_RESIZED"; + paramString = "ANCESTOR_RESIZED"; //$NON-NLS-1$ break; default: - paramString = "unknown type"; + paramString = "unknown type"; //$NON-NLS-1$ } - paramString += " ("; + paramString += " ("; //$NON-NLS-1$ if (id == HIERARCHY_CHANGED) { if ((changeFlag & PARENT_CHANGED) > 0) { - paramString += "PARENT_CHANGED,"; + paramString += "PARENT_CHANGED,"; //$NON-NLS-1$ } if ((changeFlag & DISPLAYABILITY_CHANGED) > 0) { - paramString += "DISPLAYABILITY_CHANGED,"; + paramString += "DISPLAYABILITY_CHANGED,"; //$NON-NLS-1$ } if ((changeFlag & SHOWING_CHANGED) > 0) { - paramString += "SHOWING_CHANGED,"; + paramString += "SHOWING_CHANGED,"; //$NON-NLS-1$ } } - return paramString + "changed=" + changed + - ",changedParent=" + changedParent + ")"; + return paramString + "changed=" + changed + //$NON-NLS-1$ + ",changedParent=" + changedParent + ")"; //$NON-NLS-1$ //$NON-NLS-2$ } } Index: src/main/java/common/java/awt/event/InputMethodEvent.java =================================================================== --- src/main/java/common/java/awt/event/InputMethodEvent.java (revision 470363) +++ src/main/java/common/java/awt/event/InputMethodEvent.java (working copy) @@ -25,6 +25,8 @@ import java.awt.font.TextHitInfo; import java.text.AttributedCharacterIterator; +import org.apache.harmony.awt.internal.nls.Messages; + public class InputMethodEvent extends AWTEvent { private static final long serialVersionUID = 4727190874778922661L; @@ -65,17 +67,19 @@ super(src, id); if ((id < INPUT_METHOD_FIRST) || (id > INPUT_METHOD_LAST)) { - throw new IllegalArgumentException("Wrong event id"); + // awt.18E=Wrong event id + throw new IllegalArgumentException(Messages.getString("awt.18E")); //$NON-NLS-1$ } if ((id == CARET_POSITION_CHANGED) && (text != null)) { - throw new IllegalArgumentException( - "Text must be null for CARET_POSITION_CHANGED"); + // awt.18F=Text must be null for CARET_POSITION_CHANGED + throw new IllegalArgumentException(Messages.getString("awt.18F")); //$NON-NLS-1$ } if ((text != null) && ((committedCharacterCount < 0) || (committedCharacterCount > (text.getEndIndex() - text.getBeginIndex())))) { - throw new IllegalArgumentException("Wrong committedCharacterCount"); + // awt.190=Wrong committedCharacterCount + throw new IllegalArgumentException(Messages.getString("awt.190")); //$NON-NLS-1$ } this.when = when; @@ -129,18 +133,18 @@ switch (id) { case INPUT_METHOD_TEXT_CHANGED: - typeString = "INPUT_METHOD_TEXT_CHANGED"; + typeString = "INPUT_METHOD_TEXT_CHANGED"; //$NON-NLS-1$ break; case CARET_POSITION_CHANGED: - typeString = "CARET_POSITION_CHANGED"; + typeString = "CARET_POSITION_CHANGED"; //$NON-NLS-1$ break; default: - typeString = "unknown type"; + typeString = "unknown type"; //$NON-NLS-1$ } - return typeString + ",text=" + text + - ",commitedCharCount=" + committedCharacterCount + - ",caret=" + caret + ",visiblePosition=" + visiblePosition; + return typeString + ",text=" + text + //$NON-NLS-1$ + ",commitedCharCount=" + committedCharacterCount + //$NON-NLS-1$ + ",caret=" + caret + ",visiblePosition=" + visiblePosition; //$NON-NLS-1$ //$NON-NLS-2$ } } Index: src/main/java/common/java/awt/event/InvocationEvent.java =================================================================== --- src/main/java/common/java/awt/event/InvocationEvent.java (revision 470363) +++ src/main/java/common/java/awt/event/InvocationEvent.java (working copy) @@ -23,6 +23,8 @@ import java.awt.AWTEvent; import java.awt.ActiveEvent; +import org.apache.harmony.awt.internal.nls.Messages; + public class InvocationEvent extends AWTEvent implements ActiveEvent { private static final long serialVersionUID = 436056344909459450L; @@ -56,10 +58,12 @@ { super(source, id); - assert runnable != null : "Cannot invoke null runnable"; + // awt.18C=Cannot invoke null runnable + assert runnable != null : Messages.getString("awt.18C"); //$NON-NLS-1$ if (source == null) { - throw new IllegalArgumentException("Source is null"); + // awt.18D=Source is null + throw new IllegalArgumentException(Messages.getString("awt.18D")); //$NON-NLS-1$ } this.runnable = runnable; this.notifier = notifier; @@ -118,11 +122,11 @@ * System.out.println(e); */ - return ((id == INVOCATION_DEFAULT ? "INVOCATION_DEFAULT" : "unknown type") + - ",runnable=" + runnable + - ",notifier=" + notifier + - ",catchExceptions=" + catchExceptions + - ",when=" + when); + return ((id == INVOCATION_DEFAULT ? "INVOCATION_DEFAULT" : "unknown type") + //$NON-NLS-1$ //$NON-NLS-2$ + ",runnable=" + runnable + //$NON-NLS-1$ + ",notifier=" + notifier + //$NON-NLS-1$ + ",catchExceptions=" + catchExceptions + //$NON-NLS-1$ + ",when=" + when); //$NON-NLS-1$ } } Index: src/main/java/common/java/awt/event/ItemEvent.java =================================================================== --- src/main/java/common/java/awt/event/ItemEvent.java (revision 470363) +++ src/main/java/common/java/awt/event/ItemEvent.java (working copy) @@ -74,17 +74,17 @@ switch (stateChange) { case SELECTED: - stateString = "SELECTED"; + stateString = "SELECTED"; //$NON-NLS-1$ break; case DESELECTED: - stateString = "DESELECTED"; + stateString = "DESELECTED"; //$NON-NLS-1$ break; default: - stateString = "unknown type"; + stateString = "unknown type"; //$NON-NLS-1$ } - return ((id == ITEM_STATE_CHANGED ? "ITEM_STATE_CHANGED" : "unknown type") + - ",item=" + item + ",stateChange=" + stateString); + return ((id == ITEM_STATE_CHANGED ? "ITEM_STATE_CHANGED" : "unknown type") + //$NON-NLS-1$ //$NON-NLS-2$ + ",item=" + item + ",stateChange=" + stateString); //$NON-NLS-1$ //$NON-NLS-2$ } } Index: src/main/java/common/java/awt/event/KeyEvent.java =================================================================== --- src/main/java/common/java/awt/event/KeyEvent.java (revision 470363) +++ src/main/java/common/java/awt/event/KeyEvent.java (working copy) @@ -25,6 +25,8 @@ import java.lang.reflect.Field; import java.lang.reflect.Modifier; +import org.apache.harmony.awt.internal.nls.Messages; + public class KeyEvent extends InputEvent { private static final long serialVersionUID = -2352130953028126954L; @@ -438,36 +440,36 @@ } static String getKeyModifiersExText(int modifiersEx) { - String text = ""; + String text = ""; //$NON-NLS-1$ if ((modifiersEx & InputEvent.META_DOWN_MASK) != 0) { - text += Toolkit.getProperty("AWT.meta", "Meta"); + text += Toolkit.getProperty("AWT.meta", "Meta"); //$NON-NLS-1$ //$NON-NLS-2$ } if ((modifiersEx & InputEvent.CTRL_DOWN_MASK) != 0) { - text += ((text.length() > 0) ? "+" : "") + - Toolkit.getProperty("AWT.control", "Ctrl"); + text += ((text.length() > 0) ? "+" : "") + //$NON-NLS-1$ //$NON-NLS-2$ + Toolkit.getProperty("AWT.control", "Ctrl"); //$NON-NLS-1$ //$NON-NLS-2$ } if ((modifiersEx & InputEvent.ALT_DOWN_MASK) != 0) { - text += ((text.length() > 0) ? "+" : "") + - Toolkit.getProperty("AWT.alt", "Alt"); + text += ((text.length() > 0) ? "+" : "") + //$NON-NLS-1$ //$NON-NLS-2$ + Toolkit.getProperty("AWT.alt", "Alt"); //$NON-NLS-1$ //$NON-NLS-2$ } if ((modifiersEx & InputEvent.SHIFT_DOWN_MASK) != 0) { - text += ((text.length() > 0) ? "+" : "") + - Toolkit.getProperty("AWT.shift", "Shift"); + text += ((text.length() > 0) ? "+" : "") + //$NON-NLS-1$ //$NON-NLS-2$ + Toolkit.getProperty("AWT.shift", "Shift"); //$NON-NLS-1$ //$NON-NLS-2$ } if ((modifiersEx & InputEvent.ALT_GRAPH_DOWN_MASK) != 0) { - text += ((text.length() > 0) ? "+" : "") + - Toolkit.getProperty("AWT.altGraph", "Alt Graph"); + text += ((text.length() > 0) ? "+" : "") + //$NON-NLS-1$ //$NON-NLS-2$ + Toolkit.getProperty("AWT.altGraph", "Alt Graph"); //$NON-NLS-1$ //$NON-NLS-2$ } return text; } public static String getKeyText(int keyCode) { - String[] rawName = getPublicStaticFinalIntFieldName(keyCode, "VK_".length()); + String[] rawName = getPublicStaticFinalIntFieldName(keyCode, "VK_".length()); //$NON-NLS-1$ if ((rawName == null) || (rawName.length == 0)) { - return ("Unknown keyCode: " + (keyCode >= 0 ? "0x" : "-0x") + + return ("Unknown keyCode: " + (keyCode >= 0 ? "0x" : "-0x") + //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ Integer.toHexString(Math.abs(keyCode))); } @@ -478,7 +480,7 @@ } private static String getDefaultName(String[] rawName) { - String name = ""; + String name = ""; //$NON-NLS-1$ for (int i = 0; true; i++) { String part = rawName[i]; @@ -489,7 +491,7 @@ if (i == (rawName.length - 1)) { break; } - name += " "; + name += " "; //$NON-NLS-1$ } return name; @@ -505,7 +507,7 @@ part.substring(1).toLowerCase(); } - return ("AWT." + name); + return ("AWT." + name); //$NON-NLS-1$ } private static String[] getPublicStaticFinalIntFieldName(int value, int prefixLength) { @@ -516,12 +518,12 @@ Class ssalc = field.getType(); int modifiers = field.getModifiers(); - if (ssalc.isPrimitive() && ssalc.getName().equals("int") && + if (ssalc.isPrimitive() && ssalc.getName().equals("int") && //$NON-NLS-1$ Modifier.isFinal(modifiers) && Modifier.isPublic(modifiers) && Modifier.isStatic(modifiers)) { if (field.getInt(null) == value){ - return field.getName().substring(prefixLength).split("_"); + return field.getName().substring(prefixLength).split("_"); //$NON-NLS-1$ } } } @@ -554,12 +556,12 @@ if (id == KEY_TYPED) { if (keyCode != VK_UNDEFINED) { - throw new IllegalArgumentException( - "Invalid keyCode for KEY_TYPED event, must be VK_UNDEFINED"); + // awt.191=Invalid keyCode for KEY_TYPED event, must be VK_UNDEFINED + throw new IllegalArgumentException(Messages.getString("awt.191")); //$NON-NLS-1$ } if (keyChar == CHAR_UNDEFINED) { - throw new IllegalArgumentException( - "Invalid keyChar for KEY_TYPED event, can't be CHAR_UNDEFINED"); + // awt.192=Invalid keyChar for KEY_TYPED event, can't be CHAR_UNDEFINED + throw new IllegalArgumentException(Messages.getString("awt.192")); //$NON-NLS-1$ } } @@ -617,53 +619,53 @@ String locString = null; String paramString = null; String keyCharString = (keyChar == '\n') ? - keyCharString = getKeyText(VK_ENTER) : "'" + keyChar + "'"; + keyCharString = getKeyText(VK_ENTER) : "'" + keyChar + "'"; //$NON-NLS-1$ //$NON-NLS-2$ switch (id) { case KEY_PRESSED: - idString = "KEY_PRESSED"; + idString = "KEY_PRESSED"; //$NON-NLS-1$ break; case KEY_RELEASED: - idString = "KEY_RELEASED"; + idString = "KEY_RELEASED"; //$NON-NLS-1$ break; case KEY_TYPED: - idString = "KEY_TYPED"; + idString = "KEY_TYPED"; //$NON-NLS-1$ break; default: - idString = "unknown type"; + idString = "unknown type"; //$NON-NLS-1$ } switch(keyLocation){ case KEY_LOCATION_STANDARD: - locString = "KEY_LOCATION_STANDARD"; + locString = "KEY_LOCATION_STANDARD"; //$NON-NLS-1$ break; case KEY_LOCATION_LEFT: - locString = "KEY_LOCATION_LEFT"; + locString = "KEY_LOCATION_LEFT"; //$NON-NLS-1$ break; case KEY_LOCATION_RIGHT: - locString = "KEY_LOCATION_RIGHT"; + locString = "KEY_LOCATION_RIGHT"; //$NON-NLS-1$ break; case KEY_LOCATION_NUMPAD: - locString = "KEY_LOCATION_NUMPAD"; + locString = "KEY_LOCATION_NUMPAD"; //$NON-NLS-1$ break; case KEY_LOCATION_UNKNOWN: - locString = "KEY_LOCATION_UNKNOWN"; + locString = "KEY_LOCATION_UNKNOWN"; //$NON-NLS-1$ break; default: - locString = "unknown type"; + locString = "unknown type"; //$NON-NLS-1$ } - paramString = idString + ",keyCode=" + keyCode; + paramString = idString + ",keyCode=" + keyCode; //$NON-NLS-1$ if (isActionKey()) { - paramString += "," + getKeyText(keyCode); + paramString += "," + getKeyText(keyCode); //$NON-NLS-1$ } else { - paramString += ",keyChar=" + keyCharString; + paramString += ",keyChar=" + keyCharString; //$NON-NLS-1$ } if (getModifiersEx() > 0) { - paramString += ",modifiers=" + getModifiersExText(getModifiersEx()) + - ",extModifiers=" + getModifiersExText(getModifiersEx()); + paramString += ",modifiers=" + getModifiersExText(getModifiersEx()) + //$NON-NLS-1$ + ",extModifiers=" + getModifiersExText(getModifiersEx()); //$NON-NLS-1$ } - paramString += ",keyLocation=" + locString; + paramString += ",keyLocation=" + locString; //$NON-NLS-1$ return paramString; } Index: src/main/java/common/java/awt/event/MouseEvent.java =================================================================== --- src/main/java/common/java/awt/event/MouseEvent.java (revision 470363) +++ src/main/java/common/java/awt/event/MouseEvent.java (working copy) @@ -24,6 +24,8 @@ import java.awt.Point; import java.awt.Toolkit; +import org.apache.harmony.awt.internal.nls.Messages; + public class MouseEvent extends InputEvent { private static final long serialVersionUID = -991214153494842848L; @@ -68,16 +70,16 @@ static String addMouseModifiersExText(String text, int modifiersEx) { if ((modifiersEx & InputEvent.BUTTON1_DOWN_MASK) != 0) { - text += ((text.length() > 0) ? "+" : "") + - Toolkit.getProperty("AWT.button1", "Button1"); + text += ((text.length() > 0) ? "+" : "") + //$NON-NLS-1$ //$NON-NLS-2$ + Toolkit.getProperty("AWT.button1", "Button1"); //$NON-NLS-1$ //$NON-NLS-2$ } if ((modifiersEx & InputEvent.BUTTON2_DOWN_MASK) != 0) { - text += ((text.length() > 0) ? "+" : "") + - Toolkit.getProperty("AWT.button2", "Button2"); + text += ((text.length() > 0) ? "+" : "") + //$NON-NLS-1$ //$NON-NLS-2$ + Toolkit.getProperty("AWT.button2", "Button2"); //$NON-NLS-1$ //$NON-NLS-2$ } if ((modifiersEx & InputEvent.BUTTON3_DOWN_MASK) != 0) { - text += ((text.length() > 0) ? "+" : "") + - Toolkit.getProperty("AWT.button3", "Button3"); + text += ((text.length() > 0) ? "+" : "") + //$NON-NLS-1$ //$NON-NLS-2$ + Toolkit.getProperty("AWT.button3", "Button3"); //$NON-NLS-1$ //$NON-NLS-2$ } return text; @@ -97,7 +99,8 @@ if ((button != NOBUTTON) && (button != BUTTON1) && (button != BUTTON2) && (button != BUTTON3)) { - throw new IllegalArgumentException("Invalid button value"); + // awt.18B=Invalid button value + throw new IllegalArgumentException(Messages.getString("awt.18B")); //$NON-NLS-1$ } this.popupTrigger = popupTrigger; @@ -153,41 +156,41 @@ switch (id) { case MOUSE_MOVED: - idString = "MOUSE_MOVED"; + idString = "MOUSE_MOVED"; //$NON-NLS-1$ break; case MOUSE_CLICKED: - idString = "MOUSE_CLICKED"; + idString = "MOUSE_CLICKED"; //$NON-NLS-1$ break; case MOUSE_PRESSED: - idString = "MOUSE_PRESSED"; + idString = "MOUSE_PRESSED"; //$NON-NLS-1$ break; case MOUSE_RELEASED: - idString = "MOUSE_RELEASED"; + idString = "MOUSE_RELEASED"; //$NON-NLS-1$ break; case MOUSE_DRAGGED: - idString = "MOUSE_DRAGGED"; + idString = "MOUSE_DRAGGED"; //$NON-NLS-1$ break; case MOUSE_ENTERED: - idString = "MOUSE_ENTERED"; + idString = "MOUSE_ENTERED"; //$NON-NLS-1$ break; case MOUSE_EXITED: - idString = "MOUSE_EXITED"; + idString = "MOUSE_EXITED"; //$NON-NLS-1$ break; case MOUSE_WHEEL: - idString = "MOUSE_WHEEL"; + idString = "MOUSE_WHEEL"; //$NON-NLS-1$ break; default: - idString = "unknown type"; + idString = "unknown type"; //$NON-NLS-1$ } - paramString = idString + ",(" + getX() + "," + getY() + ")" + - ",button=" + button; + paramString = idString + ",(" + getX() + "," + getY() + ")" + //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + ",button=" + button; //$NON-NLS-1$ if (getModifiersEx() > 0) { paramString += - ",modifiers=" + getModifiersExText(getModifiersEx()) + - ",extModifiers=" + getModifiersExText(getModifiersEx()); + ",modifiers=" + getModifiersExText(getModifiersEx()) + //$NON-NLS-1$ + ",extModifiers=" + getModifiersExText(getModifiersEx()); //$NON-NLS-1$ } - paramString += ",clickCount=" + getClickCount(); + paramString += ",clickCount=" + getClickCount(); //$NON-NLS-1$ return paramString; } Index: src/main/java/common/java/awt/event/MouseWheelEvent.java =================================================================== --- src/main/java/common/java/awt/event/MouseWheelEvent.java (revision 470363) +++ src/main/java/common/java/awt/event/MouseWheelEvent.java (working copy) @@ -78,18 +78,18 @@ switch (scrollType) { case WHEEL_UNIT_SCROLL: - typeString = "WHEEL_UNIT_SCROLL"; + typeString = "WHEEL_UNIT_SCROLL"; //$NON-NLS-1$ break; case WHEEL_BLOCK_SCROLL: - typeString = "WHEEL_BLOCK_SCROLL"; + typeString = "WHEEL_BLOCK_SCROLL"; //$NON-NLS-1$ break; default: - typeString = "unknown type"; + typeString = "unknown type"; //$NON-NLS-1$ } - paramString += ",scrollType=" + typeString + - ",scrollAmount=" + scrollAmount + - ",wheelRotation=" + wheelRotation; + paramString += ",scrollType=" + typeString + //$NON-NLS-1$ + ",scrollAmount=" + scrollAmount + //$NON-NLS-1$ + ",wheelRotation=" + wheelRotation; //$NON-NLS-1$ return paramString; } Index: src/main/java/common/java/awt/event/PaintEvent.java =================================================================== --- src/main/java/common/java/awt/event/PaintEvent.java (revision 470363) +++ src/main/java/common/java/awt/event/PaintEvent.java (working copy) @@ -65,16 +65,16 @@ switch (id) { case PAINT: - typeString = "PAINT"; + typeString = "PAINT"; //$NON-NLS-1$ break; case UPDATE: - typeString = "UPDATE"; + typeString = "UPDATE"; //$NON-NLS-1$ break; default: - typeString = "unknown type"; + typeString = "unknown type"; //$NON-NLS-1$ } - return typeString + ",updateRect=" + updateRect; + return typeString + ",updateRect=" + updateRect; //$NON-NLS-1$ } } Index: src/main/java/common/java/awt/event/TextEvent.java =================================================================== --- src/main/java/common/java/awt/event/TextEvent.java (revision 470363) +++ src/main/java/common/java/awt/event/TextEvent.java (working copy) @@ -47,7 +47,7 @@ */ return (id == TEXT_VALUE_CHANGED) ? - "TEXT_VALUE_CHANGED" : "unknown type"; + "TEXT_VALUE_CHANGED" : "unknown type"; //$NON-NLS-1$ //$NON-NLS-2$ } } Index: src/main/java/common/java/awt/event/WindowEvent.java =================================================================== --- src/main/java/common/java/awt/event/WindowEvent.java (revision 470363) +++ src/main/java/common/java/awt/event/WindowEvent.java (working copy) @@ -106,41 +106,41 @@ switch (id) { case WINDOW_OPENED: - typeString = "WINDOW_OPENED"; + typeString = "WINDOW_OPENED"; //$NON-NLS-1$ break; case WINDOW_CLOSING: - typeString = "WINDOW_CLOSING"; + typeString = "WINDOW_CLOSING"; //$NON-NLS-1$ break; case WINDOW_CLOSED: - typeString = "WINDOW_CLOSED"; + typeString = "WINDOW_CLOSED"; //$NON-NLS-1$ break; case WINDOW_ICONIFIED: - typeString = "WINDOW_ICONIFIED"; + typeString = "WINDOW_ICONIFIED"; //$NON-NLS-1$ break; case WINDOW_DEICONIFIED: - typeString = "WINDOW_DEICONIFIED"; + typeString = "WINDOW_DEICONIFIED"; //$NON-NLS-1$ break; case WINDOW_ACTIVATED: - typeString = "WINDOW_ACTIVATED"; + typeString = "WINDOW_ACTIVATED"; //$NON-NLS-1$ break; case WINDOW_DEACTIVATED: - typeString = "WINDOW_DEACTIVATED"; + typeString = "WINDOW_DEACTIVATED"; //$NON-NLS-1$ break; case WINDOW_GAINED_FOCUS: - typeString = "WINDOW_GAINED_FOCUS"; + typeString = "WINDOW_GAINED_FOCUS"; //$NON-NLS-1$ break; case WINDOW_LOST_FOCUS: - typeString = "WINDOW_LOST_FOCUS"; + typeString = "WINDOW_LOST_FOCUS"; //$NON-NLS-1$ break; case WINDOW_STATE_CHANGED: - typeString = "WINDOW_STATE_CHANGED"; + typeString = "WINDOW_STATE_CHANGED"; //$NON-NLS-1$ break; default: - typeString = "unknown type"; + typeString = "unknown type"; //$NON-NLS-1$ } - return typeString + ",opposite=" + oppositeWindow + - ",oldState=" + oldState + ",newState=" + newState; + return typeString + ",opposite=" + oppositeWindow + //$NON-NLS-1$ + ",oldState=" + oldState + ",newState=" + newState; //$NON-NLS-1$ //$NON-NLS-2$ } } Index: src/main/java/common/java/awt/font/GlyphJustificationInfo.java =================================================================== --- src/main/java/common/java/awt/font/GlyphJustificationInfo.java (revision 470363) +++ src/main/java/common/java/awt/font/GlyphJustificationInfo.java (working copy) @@ -20,6 +20,8 @@ */ package java.awt.font; +import org.apache.harmony.awt.internal.nls.Messages; + public final class GlyphJustificationInfo { public static final int PRIORITY_KASHIDA = 0; @@ -53,42 +55,44 @@ int shrinkPriority, float shrinkLeftLimit, float shrinkRightLimit) { if (weight < 0) { - throw new IllegalArgumentException("weight must be a " + "positive number"); + // awt.19C=weight must be a positive number + throw new IllegalArgumentException(Messages.getString("awt.19C")); //$NON-NLS-1$ } this.weight = weight; if (growLeftLimit < 0) { - throw new IllegalArgumentException("growLeftLimit must be a " + "positive number"); + // awt.19D=growLeftLimit must be a positive number + throw new IllegalArgumentException(Messages.getString("awt.19D")); //$NON-NLS-1$ } this.growLeftLimit = growLeftLimit; if (growRightLimit < 0) { - throw new IllegalArgumentException("growRightLimit must be a " + "positive number"); + // awt.19E=growRightLimit must be a positive number + throw new IllegalArgumentException(Messages.getString("awt.19E")); //$NON-NLS-1$ } this.growRightLimit = growRightLimit; if ((shrinkPriority < 0) || (shrinkPriority > PRIORITY_NONE)) { - throw new IllegalArgumentException("incorrect value for " - + "shrinkPriority, more than PRIORITY_NONE or less than " - + "PRIORITY_KASHIDA value"); + // awt.19F=incorrect value for shrinkPriority, more than PRIORITY_NONE or less than PRIORITY_KASHIDA value + throw new IllegalArgumentException(Messages.getString("awt.19F")); //$NON-NLS-1$ } this.shrinkPriority = shrinkPriority; if ((growPriority < 0) || (growPriority > PRIORITY_NONE)) { - throw new IllegalArgumentException("incorrect value for " - + "growPriority, more than PRIORITY_NONE or less than " - + "PRIORITY_KASHIDA value"); + // awt.200=incorrect value for growPriority, more than PRIORITY_NONE or less than PRIORITY_KASHIDA value + throw new IllegalArgumentException(Messages.getString("awt.200")); //$NON-NLS-1$ } this.growPriority = growPriority; if (shrinkLeftLimit < 0) { - throw new IllegalArgumentException("shrinkLeftLimit must be a " + "positive number"); + // awt.201=shrinkLeftLimit must be a positive number + throw new IllegalArgumentException(Messages.getString("awt.201")); //$NON-NLS-1$ } this.shrinkLeftLimit = shrinkLeftLimit; if (shrinkRightLimit < 0) { - throw new IllegalArgumentException("shrinkRightLimit must be a " - + "positive number"); + // awt.202=shrinkRightLimit must be a positive number + throw new IllegalArgumentException(Messages.getString("awt.202")); //$NON-NLS-1$ } this.shrinkRightLimit = shrinkRightLimit; Index: src/main/java/common/java/awt/font/GraphicAttribute.java =================================================================== --- src/main/java/common/java/awt/font/GraphicAttribute.java (revision 470363) +++ src/main/java/common/java/awt/font/GraphicAttribute.java (working copy) @@ -23,6 +23,8 @@ import java.awt.Graphics2D; import java.awt.geom.Rectangle2D; +import org.apache.harmony.awt.internal.nls.Messages; + public abstract class GraphicAttribute { public static final int TOP_ALIGNMENT = -1; @@ -40,7 +42,8 @@ protected GraphicAttribute(int align) { if ((align < BOTTOM_ALIGNMENT) || (align > HANGING_BASELINE)) { - throw new IllegalArgumentException("illigal alignment argument"); + // awt.198=Illegal alignment argument + throw new IllegalArgumentException(Messages.getString("awt.198")); //$NON-NLS-1$ } this.alignment = align; } Index: src/main/java/common/java/awt/font/LineBreakMeasurer.java =================================================================== --- src/main/java/common/java/awt/font/LineBreakMeasurer.java (revision 470363) +++ src/main/java/common/java/awt/font/LineBreakMeasurer.java (working copy) @@ -24,6 +24,8 @@ import java.text.AttributedCharacterIterator; import java.text.BreakIterator; +import org.apache.harmony.awt.internal.nls.Messages; + public final class LineBreakMeasurer { private TextMeasurer tm = null; private BreakIterator bi = null; @@ -93,9 +95,8 @@ public int nextOffset(float wrappingWidth, int offsetLimit, boolean requireNextWord) { if (offsetLimit <= position) { - throw new IllegalArgumentException( - "Offset limit should be greater than current position." - ); + // awt.203=Offset limit should be greater than current position. + throw new IllegalArgumentException(Messages.getString("awt.203")); //$NON-NLS-1$ } if (position == maxpos) { @@ -127,7 +128,8 @@ public void setPosition(int pos) { if (tm.aci.getBeginIndex() > pos || maxpos < pos) { - throw new IllegalArgumentException("Index is out of range"); + // awt.33=index is out of range + throw new IllegalArgumentException(Messages.getString("awt.33")); //$NON-NLS-1$ } position = pos; } Index: src/main/java/common/java/awt/font/NumericShaper.java =================================================================== --- src/main/java/common/java/awt/font/NumericShaper.java (revision 470363) +++ src/main/java/common/java/awt/font/NumericShaper.java (working copy) @@ -23,6 +23,7 @@ import java.io.IOException; import java.io.Serializable; +import org.apache.harmony.awt.internal.nls.Messages; import org.apache.harmony.misc.HashCode; @@ -197,25 +198,25 @@ // Set of context names used in toString method private final String[] contexts = { - "EUROPEAN", - "ARABIC", - "EASTERN_ARABIC", - "DEVANAGARI", - "BENGALI", - "GURMUKHI", - "GUJARATI", - "ORIYA", - "TAMIL", - "TELUGU", - "KANNADA", - "MALAYALAM", - "THAI", - "LAO", - "TIBETAN", - "MYANMAR", - "ETHIOPIC", - "KHMER", - "MONGOLIAN" + "EUROPEAN", //$NON-NLS-1$ + "ARABIC", //$NON-NLS-1$ + "EASTERN_ARABIC", //$NON-NLS-1$ + "DEVANAGARI", //$NON-NLS-1$ + "BENGALI", //$NON-NLS-1$ + "GURMUKHI", //$NON-NLS-1$ + "GUJARATI", //$NON-NLS-1$ + "ORIYA", //$NON-NLS-1$ + "TAMIL", //$NON-NLS-1$ + "TELUGU", //$NON-NLS-1$ + "KANNADA", //$NON-NLS-1$ + "MALAYALAM", //$NON-NLS-1$ + "THAI", //$NON-NLS-1$ + "LAO", //$NON-NLS-1$ + "TIBETAN", //$NON-NLS-1$ + "MYANMAR", //$NON-NLS-1$ + "ETHIOPIC", //$NON-NLS-1$ + "KHMER", //$NON-NLS-1$ + "MONGOLIAN" //$NON-NLS-1$ }; /* @@ -390,8 +391,9 @@ */ private int getIndexFromRange(int range){ if (range == 0){ - throw new IllegalArgumentException("Illegal range argument value:"+ - range); + // awt.199=Illegal range argument value: {0} + throw new IllegalArgumentException(Messages.getString("awt.199", //$NON-NLS-1$ + range)); } int index = 0; @@ -402,8 +404,9 @@ index++; } - throw new IllegalArgumentException("Illegal range argument value:" + - range); + // awt.199=Illegal range argument value: {0} + throw new IllegalArgumentException(Messages.getString("awt.199", //$NON-NLS-1$ + range)); } @@ -415,8 +418,9 @@ */ private int getRangeFromIndex(int index){ if (index < 0 || index >= MAX_INDEX){ - throw new IllegalArgumentException("Illegal range argument value:"+ - index); + // awt.199=Illegal range argument value: {0} + throw new IllegalArgumentException(Messages.getString("awt.199", //$NON-NLS-1$ + index)); } return 1 << index; @@ -476,15 +480,15 @@ */ StringBuffer sb = new StringBuffer(super.toString()); - sb.append("[contextual:"); + sb.append("[contextual:"); //$NON-NLS-1$ sb.append(fContextual); if (fContextual){ - sb.append(", context:"); + sb.append(", context:"); //$NON-NLS-1$ sb.append(contexts[fDefaultContextIndex]); } - sb.append(", range(s): "); + sb.append(", range(s): "); //$NON-NLS-1$ if (fContextual) { int index = 0; boolean isFirst = true; @@ -493,7 +497,7 @@ if (isFirst){ isFirst = false; } else { - sb.append(", "); + sb.append(", "); //$NON-NLS-1$ } sb.append(contexts[index]); } @@ -502,7 +506,7 @@ } else { sb.append(contexts[fSingleRangeIndex]); } - sb.append("]"); + sb.append("]"); //$NON-NLS-1$ return sb.toString(); } @@ -536,13 +540,13 @@ int len = text.length; if ((start < 0) || ((start + count) > len)) { - throw new IndexOutOfBoundsException( - "start or count arguments are out of text range"); + // awt.19A=start or count arguments are out of text range + throw new IndexOutOfBoundsException(Messages.getString("awt.19A")); //$NON-NLS-1$ } if (count < 0) { - throw new IllegalArgumentException( - "count argument must be positive"); + // awt.19B=count argument must be positive + throw new IllegalArgumentException(Messages.getString("awt.19B")); //$NON-NLS-1$ } if (isContextual()){ @@ -556,13 +560,13 @@ int len = text.length; if ((start < 0) || ((start + count) > len)) { - throw new IndexOutOfBoundsException( - "start or count arguments are out of text range"); + // awt.19A=start or count arguments are out of text range + throw new IndexOutOfBoundsException(Messages.getString("awt.19A")); //$NON-NLS-1$ } if (count < 0) { - throw new IllegalArgumentException( - "count argument must be positive"); + // awt.19B=count argument must be positive + throw new IllegalArgumentException(Messages.getString("awt.19B")); //$NON-NLS-1$ } if (isContextual()){ Index: src/main/java/common/java/awt/font/TextAttribute.java =================================================================== --- src/main/java/common/java/awt/font/TextAttribute.java (revision 470363) +++ src/main/java/common/java/awt/font/TextAttribute.java (working copy) @@ -25,6 +25,8 @@ import java.util.HashMap; import java.util.Map; +import org.apache.harmony.awt.internal.nls.Messages; + public final class TextAttribute extends Attribute { private static final long serialVersionUID = 7744112784117861702L; @@ -42,66 +44,67 @@ if (result != null) { return result; } - throw new InvalidObjectException("Unknown attribute name"); + // awt.194=Unknown attribute name + throw new InvalidObjectException(Messages.getString("awt.194")); //$NON-NLS-1$ } - public static final TextAttribute BACKGROUND = new TextAttribute("background"); + public static final TextAttribute BACKGROUND = new TextAttribute("background"); //$NON-NLS-1$ - public static final TextAttribute BIDI_EMBEDDING = new TextAttribute("bidi_embedding"); + public static final TextAttribute BIDI_EMBEDDING = new TextAttribute("bidi_embedding"); //$NON-NLS-1$ - public static final TextAttribute CHAR_REPLACEMENT = new TextAttribute("char_replacement"); + public static final TextAttribute CHAR_REPLACEMENT = new TextAttribute("char_replacement"); //$NON-NLS-1$ - public static final TextAttribute FAMILY = new TextAttribute("family"); + public static final TextAttribute FAMILY = new TextAttribute("family"); //$NON-NLS-1$ - public static final TextAttribute FONT = new TextAttribute("font"); + public static final TextAttribute FONT = new TextAttribute("font"); //$NON-NLS-1$ - public static final TextAttribute FOREGROUND = new TextAttribute("foreground"); + public static final TextAttribute FOREGROUND = new TextAttribute("foreground"); //$NON-NLS-1$ public static final TextAttribute INPUT_METHOD_HIGHLIGHT = new TextAttribute( - "input method highlight"); + "input method highlight"); //$NON-NLS-1$ public static final TextAttribute INPUT_METHOD_UNDERLINE = new TextAttribute( - "input method underline"); + "input method underline"); //$NON-NLS-1$ - public static final TextAttribute JUSTIFICATION = new TextAttribute("justification"); + public static final TextAttribute JUSTIFICATION = new TextAttribute("justification"); //$NON-NLS-1$ public static final Float JUSTIFICATION_FULL = new Float(1.0f); public static final Float JUSTIFICATION_NONE = new Float(0.0f); - public static final TextAttribute NUMERIC_SHAPING = new TextAttribute("numeric_shaping"); + public static final TextAttribute NUMERIC_SHAPING = new TextAttribute("numeric_shaping"); //$NON-NLS-1$ - public static final TextAttribute POSTURE = new TextAttribute("posture"); + public static final TextAttribute POSTURE = new TextAttribute("posture"); //$NON-NLS-1$ public static final Float POSTURE_REGULAR = new Float(0.0f); public static final Float POSTURE_OBLIQUE = new Float(0.20f); - public static final TextAttribute RUN_DIRECTION = new TextAttribute("run_direction"); + public static final TextAttribute RUN_DIRECTION = new TextAttribute("run_direction"); //$NON-NLS-1$ public static final Boolean RUN_DIRECTION_LTR = new Boolean(false); public static final Boolean RUN_DIRECTION_RTL = new Boolean(true); - public static final TextAttribute SIZE = new TextAttribute("size"); + public static final TextAttribute SIZE = new TextAttribute("size"); //$NON-NLS-1$ - public static final TextAttribute STRIKETHROUGH = new TextAttribute("strikethrough"); + public static final TextAttribute STRIKETHROUGH = new TextAttribute("strikethrough"); //$NON-NLS-1$ public static final Boolean STRIKETHROUGH_ON = new Boolean(true); - public static final TextAttribute SUPERSCRIPT = new TextAttribute("superscript"); + public static final TextAttribute SUPERSCRIPT = new TextAttribute("superscript"); //$NON-NLS-1$ public static final Integer SUPERSCRIPT_SUB = new Integer(-1); public static final Integer SUPERSCRIPT_SUPER = new Integer(1); - public static final TextAttribute SWAP_COLORS = new TextAttribute("swap_colors"); + public static final TextAttribute SWAP_COLORS = new TextAttribute("swap_colors"); //$NON-NLS-1$ public static final Boolean SWAP_COLORS_ON = new Boolean(true); - public static final TextAttribute TRANSFORM = new TextAttribute("transform"); + public static final TextAttribute TRANSFORM = new TextAttribute("transform"); //$NON-NLS-1$ - public static final TextAttribute UNDERLINE = new TextAttribute("underline"); + public static final TextAttribute UNDERLINE = new TextAttribute("underline"); //$NON-NLS-1$ public static final Integer UNDERLINE_ON = new Integer(0); @@ -115,7 +118,7 @@ public static final Integer UNDERLINE_LOW_DASHED = new Integer(5); - public static final TextAttribute WEIGHT = new TextAttribute("weight"); + public static final TextAttribute WEIGHT = new TextAttribute("weight"); //$NON-NLS-1$ public static final Float WEIGHT_EXTRA_LIGHT = new Float(0.5f); @@ -139,7 +142,7 @@ public static final Float WEIGHT_ULTRABOLD = new Float(2.75f); - public static final TextAttribute WIDTH = new TextAttribute("width"); + public static final TextAttribute WIDTH = new TextAttribute("width"); //$NON-NLS-1$ public static final Float WIDTH_CONDENSED = new Float(0.75f); Index: src/main/java/common/java/awt/font/TextHitInfo.java =================================================================== --- src/main/java/common/java/awt/font/TextHitInfo.java (revision 470363) +++ src/main/java/common/java/awt/font/TextHitInfo.java (working copy) @@ -36,8 +36,8 @@ @Override public String toString() { return new String( - "TextHitInfo[" + charIdx + ", " + - (isTrailing?"Trailing":"Leading") + "]" + "TextHitInfo[" + charIdx + ", " + //$NON-NLS-1$ //$NON-NLS-2$ + (isTrailing?"Trailing":"Leading") + "]" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ ); } Index: src/main/java/common/java/awt/font/TextLayout.java =================================================================== --- src/main/java/common/java/awt/font/TextLayout.java (revision 470363) +++ src/main/java/common/java/awt/font/TextLayout.java (working copy) @@ -72,14 +72,17 @@ public TextLayout(String string, Font font, FontRenderContext frc) { if (string == null){ + // awt.01='{0}' parameter is null throw new IllegalArgumentException(Messages.getString("awt.01", "string")); //$NON-NLS-1$ //$NON-NLS-2$ } if (font == null){ + // awt.01='{0}' parameter is null throw new IllegalArgumentException(Messages.getString("awt.01", "font")); //$NON-NLS-1$ //$NON-NLS-2$ } if (string.length() == 0){ + // awt.02='{0}' parameter has zero length throw new IllegalArgumentException(Messages.getString("awt.02", "string")); //$NON-NLS-1$ //$NON-NLS-2$ } @@ -94,14 +97,17 @@ Map attributes, FontRenderContext frc ) { if (string == null){ + // awt.01='{0}' parameter is null throw new IllegalArgumentException(Messages.getString("awt.01", "string")); //$NON-NLS-1$ //$NON-NLS-2$ } if (attributes == null){ + // awt.01='{0}' parameter is null throw new IllegalArgumentException(Messages.getString("awt.01", "attributes")); //$NON-NLS-1$ //$NON-NLS-2$ } if (string.length() == 0){ + // awt.02='{0}' parameter has zero length throw new IllegalArgumentException(Messages.getString("awt.02", "string")); //$NON-NLS-1$ //$NON-NLS-2$ } @@ -114,10 +120,12 @@ public TextLayout(AttributedCharacterIterator text, FontRenderContext frc) { if (text == null){ + // awt.03='{0}' iterator parameter is null throw new IllegalArgumentException(Messages.getString("awt.03", "text")); //$NON-NLS-1$ //$NON-NLS-2$ } if (text.getBeginIndex() == text.getEndIndex()){ + // awt.04='{0}' iterator parameter has zero length throw new IllegalArgumentException(Messages.getString("awt.04", "text")); //$NON-NLS-1$ //$NON-NLS-2$ } @@ -240,7 +248,8 @@ public Shape[] getCaretShapes(int offset, Rectangle2D bounds, TextLayout.CaretPolicy policy) { if (offset < 0 || offset > breaker.getCharCount()) { - throw new IllegalArgumentException("Offset is out of bounds"); + // awt.195=Offset is out of bounds + throw new IllegalArgumentException(Messages.getString("awt.195")); //$NON-NLS-1$ } updateMetrics(); @@ -267,7 +276,8 @@ float justification = breaker.getJustification(); if (justification < 0) { - throw new Error("Justification impossible, layout already justified"); + // awt.196=Justification impossible, layout already justified + throw new Error(Messages.getString("awt.196")); //$NON-NLS-1$ } else if (justification == 0) { return this; } @@ -296,7 +306,8 @@ if (firstEndpoint > secondEndpoint) { if (secondEndpoint < 0 || firstEndpoint > breaker.getCharCount()) { - throw new IllegalArgumentException("Endpoints are out of range"); + // awt.197=Endpoints are out of range + throw new IllegalArgumentException(Messages.getString("awt.197")); //$NON-NLS-1$ } return caretManager.getLogicalHighlightShape( secondEndpoint, @@ -306,7 +317,8 @@ ); } if (firstEndpoint < 0 || secondEndpoint > breaker.getCharCount()) { - throw new IllegalArgumentException("Endpoints are out of range"); + // awt.197=Endpoints are out of range + throw new IllegalArgumentException(Messages.getString("awt.197")); //$NON-NLS-1$ } return caretManager.getLogicalHighlightShape( firstEndpoint, @@ -331,7 +343,8 @@ public TextHitInfo getNextLeftHit(int offset, TextLayout.CaretPolicy policy) { if (offset < 0 || offset > breaker.getCharCount()) { - throw new IllegalArgumentException("Offset is out of bounds"); + // awt.195=Offset is out of bounds + throw new IllegalArgumentException(Messages.getString("awt.195")); //$NON-NLS-1$ } TextHitInfo hit = TextHitInfo.afterOffset(offset); @@ -355,7 +368,8 @@ public TextHitInfo getNextRightHit(int offset, TextLayout.CaretPolicy policy) { if (offset < 0 || offset > breaker.getCharCount()) { - throw new IllegalArgumentException("Offset is out of bounds"); + // awt.195=Offset is out of bounds + throw new IllegalArgumentException(Messages.getString("awt.195")); //$NON-NLS-1$ } TextHitInfo hit = TextHitInfo.afterOffset(offset); @@ -426,7 +440,8 @@ float justification = breaker.getJustification(); if (justification < 0) { - throw new IllegalStateException("Justification impossible, layout already justified"); + // awt.196=Justification impossible, layout already justified + throw new IllegalStateException(Messages.getString("awt.196")); //$NON-NLS-1$ } else if (justification == 0) { return; } Index: src/main/java/common/java/awt/font/TransformAttribute.java =================================================================== --- src/main/java/common/java/awt/font/TransformAttribute.java (revision 470363) +++ src/main/java/common/java/awt/font/TransformAttribute.java (working copy) @@ -23,6 +23,8 @@ import java.awt.geom.AffineTransform; import java.io.Serializable; +import org.apache.harmony.awt.internal.nls.Messages; + public final class TransformAttribute implements Serializable { private static final long serialVersionUID = 3356247357827709530L; @@ -31,7 +33,8 @@ public TransformAttribute(AffineTransform transform) { if (transform == null) { - throw new IllegalArgumentException("transform can not be null"); + // awt.94=transform can not be null + throw new IllegalArgumentException(Messages.getString("awt.94")); //$NON-NLS-1$ } if (!transform.isIdentity()){ this.fTransform = new AffineTransform(transform); Index: src/main/java/common/org/apache/harmony/awt/internal/nls/messages.properties =================================================================== --- src/main/java/common/org/apache/harmony/awt/internal/nls/messages.properties (revision 470363) +++ src/main/java/common/org/apache/harmony/awt/internal/nls/messages.properties (working copy) @@ -39,20 +39,20 @@ awt.15=Can not get monitor info awt.16=Can not create DC for device awt.17=Unknown Composite type : {0} -awt.18=Transparency is not supported. -awt.19=Illegal size of volatile image. +awt.18=Transparency is not supported +awt.19=Illegal size of volatile image awt.1A=Failed to register window class {0} GetLastError returned {1} awt.1B=Invalid key code awt.1C=Failure to create JavaWindow GetLastError returned {0} awt.1D=Cannot get data from OLE clipboard awt.1E=Attempt to replace WindowProc handler -awt.1F=Waiting for resource access thread interrupted not from unlock method. -awt.20=Can't unlock not locked resource. -awt.21=Not owner can't unlock resource. -awt.22=Not owner can't free resource. -awt.23=One thread can't store state several times in a row. -awt.24=Owner can't overwrite resource state. Lock operations may be lost. -awt.25=No state stored for current thread. +awt.1F=Waiting for resource access thread interrupted not from unlock method +awt.20=Can't unlock not locked resource +awt.21=Not owner can't unlock resource +awt.22=Not owner can't free resource +awt.23=One thread can't store state several times in a row +awt.24=Owner can't overwrite resource state. Lock operations may be lost +awt.25=No state stored for current thread awt.26=Shutdown thread was interrupted while starting awt.27=Shutdown thread was interrupted while stopping awt.28=bad index: {0} @@ -182,9 +182,9 @@ awt.104=item doesn't exist in the choice menu awt.105=index less than zero awt.106=specified position is greater than the number of items -awt.107=Color parameter outside of expected range: component {0}. -awt.108=Alpha value outside of expected range. -awt.109=Color parameter outside of expected range. +awt.107=Color parameter outside of expected range: component {0} +awt.108=Alpha value outside of expected range +awt.109=Color parameter outside of expected range awt.10A=Priority must be a value between 0 and 1, inclusive awt.10B=aContainer and aComponent cannot be null awt.10C=aContainer is not a focus cycle root of aComponent @@ -221,7 +221,7 @@ awt.12B=adding container to itself awt.12C=adding container's parent to itself awt.12D=adding a window to a container -awt.12E=Unknown component event id. +awt.12E=Unknown component event id awt.12F=Attempt to start nested mouse grab awt.130=Attempt to grab mouse in not displayable window awt.131=AddLayoutComponent: constraint object must be String @@ -268,6 +268,214 @@ awt.15A=Invalid value for defaultSelection awt.15B=Invalid value for multipleDocumentHandling awt.15C=Invalid value for attribute sides +awt.15D=Invalid colorspace +awt.15E=Unknown component. Must be REDCOMPONENT, GREENCOMPONENT or BLUECOMPONENT. +awt.15F=Profile class does not comply with ICC specification +awt.160=Color space doesn't comply with ICC specification +awt.161=Unable to open file {0} +awt.162=Invalid ICC Profile Data +awt.163=Can't open color profile +awt.164=Not a predefined color space +awt.165=Color space doesn't comply with ICC specification +awt.166=TRC is not a simple gamma value +awt.167=TRC is a gamma value, not a table +awt.168=Invalid profile class +awt.169=Component index out of range +awt.16A=Invalid component index: {0} +awt.16B=Not a predefined colorspace +awt.16C=Can't load class: {0} +awt.16D=Can't parse MIME type: {0} +awt.16E=Transferable has null data +awt.16F=Can't create reader for this representation class +awt.170=Can't create default D&D cursor: {0} +awt.171=Attempt to start a drag while an existing drag operation is still executing +awt.172=Drag source is null +awt.173=One listener is already exist +awt.174=dgl is not current listener +awt.175=Listener mismatch +awt.176=DropTarget cannot be added as listener to itself +awt.177=Invalid user action +awt.178=Invalid source action +awt.179=Context peer is null +awt.17A=Trigger event is null +awt.17B=Can't init ACTION_NONE drag +awt.17C=Image offset is null +awt.17D=Transferable is null +awt.17E=Component associated with the trigger event is null +awt.17F=DragSource for the trigger event is null +awt.180=Source actions for the DragGestureRecognizer associated with the trigger event are equal to DnDConstants.ACTION_NONE +awt.181=Attempt to register context as its listener +awt.182=dsl is not current listener +awt.183=Invalid status +awt.184=Invalid action +awt.185=Component is null +awt.186=DragSource is null +awt.187=Origin is null +awt.188=Event list is null +awt.189=Event list is empty +awt.18A=Context is null +awt.18B=Invalid button value +awt.18C=Cannot invoke null runnable +awt.18D=Source is null +awt.18E=Wrong event id +awt.18F=Text must be null for CARET_POSITION_CHANGED +awt.190=Wrong committedCharacterCount +awt.191=Invalid keyCode for KEY_TYPED event, must be VK_UNDEFINED +awt.192=Invalid keyChar for KEY_TYPED event, can't be CHAR_UNDEFINED +awt.193=Listener can't be zero +awt.194=Unknown attribute name +awt.195=Offset is out of bounds +awt.196=Justification impossible, layout already justified +awt.197=Endpoints are out of range +awt.198=Illegal alignment argument +awt.199=Illegal range argument value: {0} +awt.19A=start or count arguments are out of text range +awt.19B=count argument must be positive +awt.19C=weight must be a positive number +awt.19D=growLeftLimit must be a positive number +awt.19E=growRightLimit must be a positive number +awt.19F=incorrect value for shrinkPriority, more than PRIORITY_NONE or less than PRIORITY_KASHIDA value +awt.200=incorrect value for growPriority, more than PRIORITY_NONE or less than PRIORITY_KASHIDA value +awt.201=shrinkLeftLimit must be a positive number +awt.202=shrinkRightLimit must be a positive number +awt.203=Offset limit should be greater than current position +awt.204=Determinant is zero +awt.205=Invalid type of Arc: {0} +awt.206=Flatness is less then zero +awt.207=Limit is less then zero +awt.208=Path is null +awt.209=Invalid winding rule value +awt.20A=First segment should be SEG_MOVETO type +awt.20B=unknown input method highlight state +awt.20C=Number of Bits equals to zero +awt.20D=The number of bits per pixel is not a power of 2 or pixels span data element boundaries +awt.20E=Data Bit offset is not a multiple of pixel bit stride +awt.20F=Number of bands must be only 1 +awt.210=The component value for this ColorModel is signed +awt.211=Pixel values for this ColorModel are not conveniently representable as a single int +awt.212=There is more than one component in this ColorModel +awt.213=This ComponentColorModel does not support the unnormalized form +awt.214=This Color Model doesn't support this transferType +awt.215=transferType is not one of DataBuffer.TYPE_BYTE, DataBuffer.TYPE_USHORT, DataBuffer.TYPE_INT, DataBuffer.TYPE_SHORT, DataBuffer.TYPE_FLOAT, or DataBuffer.TYPE_DOUBLE +awt.216=The components array is not large enough to hold all the color and alpha components +awt.217=The transfer type of this ComponentColorModel is not one of the following transfer types: DataBuffer.TYPE_BYTE, DataBuffer.TYPE_USHORT, or DataBuffer.TYPE_INT +awt.218=The components array is not large enough to hold all the color and alpha components +awt.219=This transferType is not supported by this color model +awt.21A=This ComponentColorModel does not support this transferType +awt.21B=The length of normComponents minus normOffset is less than numComponents +awt.21C=The number of scale factors should not be zero +awt.21D=Number of src bands ({0}) does not match number of dst bands ({1}) +awt.21E=Number of scaling constants is not equal to the number of bands +awt.21F=Unable to transform source +awt.220=Source should not have IndexColorModel +awt.221=The imageType is TYPE_BYTE_BINARY and the color map has more than 16 entries +awt.222=The imageType is not TYPE_BYTE_BINARY or TYPE_BYTE_INDEXED +awt.223=The imageType is not compatible with ColorModel +awt.224=Unknown image type +awt.225=Property name is null +awt.226=Both tileX and tileY are not equal to 0 +awt.227=This image type can't have alpha +awt.228=minX or minY of this raster not equal to zero +awt.229=Number of components in the LUT does not match the number of bands +awt.22A=Wrong type of pixels array +awt.22B=Length of data should not be less than width*height +awt.22C=Unknown data type {0} +awt.22D=This transferType ( {0} ) is not supported by this color model +awt.22E=w or h is less than or equal to zero +awt.22F=The product of w and h is greater than Integer.MAX_VALUE +awt.230=dataType is not one of the supported data types +awt.231=Number of bands must be more then 0 +awt.232=Offset should be not less than zero +awt.233=Number of components should be positive +awt.234=Width or Height equals zero +awt.235=Wrong Data Buffer type : {0} +awt.236=The bits is less than 1 or greater than 32 +awt.237=Source and destinations rasters do not have the same number of bands +awt.238=The number of arrays in the LookupTable does not meet the restrictions +awt.239=The space is not a TYPE_RGB space +awt.23A=The min/max normalized component values are not 0.0/1.0 +awt.23B=The mask of the {0} component is not contiguous +awt.23C=The mask of the alpha component is not contiguous +awt.23D=The mask of the red component is not contiguous +awt.23E=The mask of the green component is not contiguous +awt.23F=The mask of the blue component is not contiguous +awt.240=The transferType not is one of DataBuffer.TYPE_BYTE, DataBuffer.TYPE_USHORT or DataBuffer.TYPE_INT +awt.241=Any offset between bands is greater than the Scanline stride +awt.242=Pixel stride is less than any offset between bands +awt.243=Product of Pixel stride and w is greater than Scanline stride +awt.244=Width or Height of child Raster is less than or equal to zero +awt.245=parentX disposes outside Raster +awt.246=parentY disposes outside Raster +awt.247=parentX + w results in integer overflow +awt.248=parentY + h results in integer overflow +awt.249=childMinX + w results in integer overflow +awt.24A=childMinY + h results in integer overflow +awt.24B=Pixel stride must be >= 0 +awt.24C=Scanline stride must be >= 0 +awt.24D=Bank Indices length must be equal Bank Offsets length +awt.24E=Index of {0} bank must be >= 0 +awt.24F=Unable to invert transform {0} +awt.250=Unknown interpolation type: {0} +awt.251=Transformed width ({0}) and height ({1}) should be greater than 0 +awt.252=Source can't be same as the destination +awt.253=Different number of bands in source and destination +awt.254=Number of bands in the source raster ({0}) is incompatible with the matrix [{1}x{2}] +awt.255=Number of bands in the destination raster ({0}) is incompatible with the matrix [{1}x{2}] +awt.256=Source raster is null +awt.257=Source raster is equal to destination +awt.258=Number of source bands ({0}) is not equal to number of destination bands ({1}) +awt.259=Source image is null +awt.25A=Source equals to destination +awt.25B=Null ColorSpace passed as a parameter +awt.25C=Null profiles passed as a parameter +awt.25D=Source or destination color space is not defined +awt.25E=Incorrect number of source raster bands. Should be equal to the number of color components of source colorspace. +awt.25F=Incorrect number of destination raster bands. Should be equal to the number of color components of destination colorspace. +awt.260=Incompatible rasters - width or height differs +awt.261=Destination color space is undefined +awt.262=Destionation color space should be defined +awt.263=Incompatible images - width or height differs +awt.264=Size of the color map is less than 1 +awt.265=The raster argument is not compatible with this IndexColorModel +awt.266=The number of bits in a pixel is greater than 16 +awt.267=The transferType is invalid +awt.268=The pixel is not a primitive array of type transferType +awt.269=The transferType is not one of DataBuffer.TYPE_BYTE or DataBuffer.TYPE_USHORT +awt.26A=Incorrect ImageConsumer completion status +awt.26B=The number of bits in the pixel values is less than 1 +awt.26C=bits is null +awt.26D=The elements in bits is less than 0 +awt.26E=The sum of the number of bits in bits is less than 1 +awt.26F=The cspace is null +awt.270=The transparency is not a valid value +awt.271=The number of bits in bits is less than 1 +awt.272=The length of components minus offset is less than numComponents +awt.273=The length of normComponents minus normOffset is less than numComponents +awt.274=componentIdx is greater than the number of components or less than zero +awt.275=This pixel representation is not suuported by tis Color Model +awt.276=location.x + w or location.y + h results in integer overflow +awt.277=bankIndices or bandOffsets is null +awt.278=dataBuffer is null +awt.279=bands is less than 1 +awt.27A=dataBuffer has more than one bank +awt.27B=bandOffsets is null +awt.27C=bandMasks is null +awt.27D=bitsPerBand or bands is not greater than zero +awt.27E=The product of bitsPerBand and bands is greater than the number of bits held by dataType +awt.27F=SampleModel or DataBuffer is null +awt.280=SampleModel is null +awt.281=sampleModel, dataBuffer, aRegion or sampleModelTranslate is null +awt.282=aRegion has width or height less than or equal to zero +awt.283=Overflow X coordinate of Raster +awt.284=Overflow Y coordinate of Raster +awt.285=Width or Height of child Raster is less than or equal to zero +awt.286=parentX disposes outside Raster +awt.287=parentY disposes outside Raster +awt.288=parentX + width results in integer overflow +awt.289=parentY + height results in integer overflow +awt.28A=childMinX + width results in integer overflow +awt.28B=childMinY + height results in integer overflow +awt.28C=Rect is null awt.err.00=file dialog {0} error! awt.err.01=error: {0}