Issue 495: Renamed DATAMATRIX to DATA_MATRIX for consistency.
git-svn-id: https://zxing.googlecode.com/svn/trunk@1508 59b500cc-1b3d-0410-9834-0bbf25fbcc57
diff --git a/core/src/com/google/zxing/BarcodeFormat.java b/core/src/com/google/zxing/BarcodeFormat.java
index e10a8a8..73e3cd0 100644
--- a/core/src/com/google/zxing/BarcodeFormat.java
+++ b/core/src/com/google/zxing/BarcodeFormat.java
@@ -33,7 +33,7 @@
public static final BarcodeFormat QR_CODE = new BarcodeFormat("QR_CODE");
/** DataMatrix 2D barcode format. */
- public static final BarcodeFormat DATAMATRIX = new BarcodeFormat("DATAMATRIX");
+ public static final BarcodeFormat DATA_MATRIX = new BarcodeFormat("DATA_MATRIX");
/** UPC-E 1D format. */
public static final BarcodeFormat UPC_E = new BarcodeFormat("UPC_E");
@@ -58,7 +58,7 @@
/** Code 93 1D format. */
public static final BarcodeFormat CODE_93 = new BarcodeFormat("CODE_93");
-
+
/** CODABAR 1D format. */
public static final BarcodeFormat CODABAR = new BarcodeFormat("CODABAR");
@@ -70,7 +70,7 @@
/** PDF417 format. */
public static final BarcodeFormat PDF417 = new BarcodeFormat("PDF417");
-
+
/** RSS EXPANDED */
public static final BarcodeFormat RSS_EXPANDED = new BarcodeFormat("RSS_EXPANDED");
diff --git a/core/src/com/google/zxing/MultiFormatReader.java b/core/src/com/google/zxing/MultiFormatReader.java
index 9784760..c817d68 100644
--- a/core/src/com/google/zxing/MultiFormatReader.java
+++ b/core/src/com/google/zxing/MultiFormatReader.java
@@ -104,7 +104,7 @@
formats.contains(BarcodeFormat.CODE_93) ||
formats.contains(BarcodeFormat.CODE_128) ||
formats.contains(BarcodeFormat.ITF) ||
- formats.contains(BarcodeFormat.RSS14) ||
+ formats.contains(BarcodeFormat.RSS14) ||
formats.contains(BarcodeFormat.RSS_EXPANDED);
// Put 1D readers upfront in "normal" mode
if (addOneDReader && !tryHarder) {
@@ -113,7 +113,7 @@
if (formats.contains(BarcodeFormat.QR_CODE)) {
readers.addElement(new QRCodeReader());
}
- if (formats.contains(BarcodeFormat.DATAMATRIX)) {
+ if (formats.contains(BarcodeFormat.DATA_MATRIX)) {
readers.addElement(new DataMatrixReader());
}
if (formats.contains(BarcodeFormat.PDF417)) {
@@ -129,13 +129,13 @@
readers.addElement(new MultiFormatOneDReader(hints));
}
readers.addElement(new QRCodeReader());
-
+
// TODO re-enable once Data Matrix is ready
// readers.addElement(new DataMatrixReader());
-
+
// TODO: Enable once PDF417 has passed QA
//readers.addElement(new PDF417Reader());
-
+
if (tryHarder) {
readers.addElement(new MultiFormatOneDReader(hints));
}
diff --git a/core/src/com/google/zxing/datamatrix/DataMatrixReader.java b/core/src/com/google/zxing/datamatrix/DataMatrixReader.java
index 477a989..25f8fa4 100644
--- a/core/src/com/google/zxing/datamatrix/DataMatrixReader.java
+++ b/core/src/com/google/zxing/datamatrix/DataMatrixReader.java
@@ -42,7 +42,7 @@
public final class DataMatrixReader implements Reader {
private static final ResultPoint[] NO_POINTS = new ResultPoint[0];
-
+
private final Decoder decoder = new Decoder();
/**
@@ -70,7 +70,8 @@
decoderResult = decoder.decode(detectorResult.getBits());
points = detectorResult.getPoints();
}
- Result result = new Result(decoderResult.getText(), decoderResult.getRawBytes(), points, BarcodeFormat.DATAMATRIX);
+ Result result = new Result(decoderResult.getText(), decoderResult.getRawBytes(), points,
+ BarcodeFormat.DATA_MATRIX);
if (decoderResult.getByteSegments() != null) {
result.putMetadata(ResultMetadataType.BYTE_SEGMENTS, decoderResult.getByteSegments());
}
@@ -90,7 +91,7 @@
* around it. This is a specialized method that works exceptionally fast in this special
* case.
*
- * @see com.google.zxing.qrcode.QRCodeReader#extractPureBits(BitMatrix)
+ * @see com.google.zxing.qrcode.QRCodeReader#extractPureBits(BitMatrix)
*/
private static BitMatrix extractPureBits(BitMatrix image) throws NotFoundException {
@@ -132,7 +133,7 @@
int dimension = 2 + ((rowEndOfSymbol - x) / moduleSize);
y += moduleSize;
-
+
// Push in the "border" by half the module width so that we start
// sampling in the middle of the module. Just in case the image is a
// little off, this will help recover.
diff --git a/core/test/src/com/google/zxing/datamatrix/DataMatrixBlackBox1TestCase.java b/core/test/src/com/google/zxing/datamatrix/DataMatrixBlackBox1TestCase.java
index 6514e5e..a4cc881 100644
--- a/core/test/src/com/google/zxing/datamatrix/DataMatrixBlackBox1TestCase.java
+++ b/core/test/src/com/google/zxing/datamatrix/DataMatrixBlackBox1TestCase.java
@@ -26,7 +26,7 @@
public DataMatrixBlackBox1TestCase() {
// TODO use MultiFormatReader here once Data Matrix decoder is done
- super("test/data/blackbox/datamatrix-1", new DataMatrixReader(), BarcodeFormat.DATAMATRIX);
+ super("test/data/blackbox/datamatrix-1", new DataMatrixReader(), BarcodeFormat.DATA_MATRIX);
addTest(7, 7, 0.0f);
addTest(7, 7, 90.0f);
addTest(6, 6, 180.0f);
diff --git a/core/test/src/com/google/zxing/datamatrix/DataMatrixBlackBox2TestCase.java b/core/test/src/com/google/zxing/datamatrix/DataMatrixBlackBox2TestCase.java
index 3508ff0..b33a796 100644
--- a/core/test/src/com/google/zxing/datamatrix/DataMatrixBlackBox2TestCase.java
+++ b/core/test/src/com/google/zxing/datamatrix/DataMatrixBlackBox2TestCase.java
@@ -26,7 +26,7 @@
public DataMatrixBlackBox2TestCase() {
// TODO use MultiFormatReader here once Data Matrix decoder is done
- super("test/data/blackbox/datamatrix-2", new DataMatrixReader(), BarcodeFormat.DATAMATRIX);
+ super("test/data/blackbox/datamatrix-2", new DataMatrixReader(), BarcodeFormat.DATA_MATRIX);
addTest(4, 4, 0.0f);
addTest(1, 1, 90.0f);
addTest(3, 3, 180.0f);
diff --git a/javase/src/com/google/zxing/client/j2se/CommandLineRunner.java b/javase/src/com/google/zxing/client/j2se/CommandLineRunner.java
index 235a80d..a725d07 100644
--- a/javase/src/com/google/zxing/client/j2se/CommandLineRunner.java
+++ b/javase/src/com/google/zxing/client/j2se/CommandLineRunner.java
@@ -114,14 +114,14 @@
vector.addElement(BarcodeFormat.UPC_E);
vector.addElement(BarcodeFormat.EAN_13);
vector.addElement(BarcodeFormat.EAN_8);
- vector.addElement(BarcodeFormat.RSS14);
+ vector.addElement(BarcodeFormat.RSS14);
if (!productsOnly) {
vector.addElement(BarcodeFormat.CODE_39);
- vector.addElement(BarcodeFormat.CODE_93);
+ vector.addElement(BarcodeFormat.CODE_93);
vector.addElement(BarcodeFormat.CODE_128);
vector.addElement(BarcodeFormat.ITF);
vector.addElement(BarcodeFormat.QR_CODE);
- vector.addElement(BarcodeFormat.DATAMATRIX);
+ vector.addElement(BarcodeFormat.DATA_MATRIX);
vector.addElement(BarcodeFormat.PDF417);
//vector.addElement(BarcodeFormat.CODABAR);
}
@@ -239,7 +239,7 @@
System.out.println(uri.toString() + " (format: " + result.getBarcodeFormat() +
", type: " + parsedResult.getType() + "):\nRaw result:\n" + result.getText() +
"\nParsed result:\n" + parsedResult.getDisplayResult());
-
+
System.out.println("Also, there were " + result.getResultPoints().length + " result points.");
for (int i = 0; i < result.getResultPoints().length; i++) {
ResultPoint rp = result.getResultPoints()[i];
diff --git a/zxingorg/src/com/google/zxing/web/DecodeServlet.java b/zxingorg/src/com/google/zxing/web/DecodeServlet.java
index 8419c7a..6a64c3e 100644
--- a/zxingorg/src/com/google/zxing/web/DecodeServlet.java
+++ b/zxingorg/src/com/google/zxing/web/DecodeServlet.java
@@ -107,13 +107,13 @@
possibleFormats.add(BarcodeFormat.EAN_8);
possibleFormats.add(BarcodeFormat.EAN_13);
possibleFormats.add(BarcodeFormat.CODE_39);
- possibleFormats.add(BarcodeFormat.CODE_93);
+ possibleFormats.add(BarcodeFormat.CODE_93);
possibleFormats.add(BarcodeFormat.CODE_128);
//possibleFormats.add(BarcodeFormat.CODABAR);
possibleFormats.add(BarcodeFormat.ITF);
- possibleFormats.add(BarcodeFormat.RSS14);
+ possibleFormats.add(BarcodeFormat.RSS14);
possibleFormats.add(BarcodeFormat.QR_CODE);
- possibleFormats.add(BarcodeFormat.DATAMATRIX);
+ possibleFormats.add(BarcodeFormat.DATA_MATRIX);
possibleFormats.add(BarcodeFormat.PDF417);
HINTS.put(DecodeHintType.POSSIBLE_FORMATS, possibleFormats);
HINTS_PURE = new Hashtable<DecodeHintType, Object>(HINTS);
@@ -286,11 +286,11 @@
}
if (image == null) {
response.sendRedirect("badimage.jspx");
- return;
+ return;
}
if (image.getHeight() <= 1 || image.getWidth() <= 1 ||
image.getHeight() * image.getWidth() > MAX_PIXELS) {
- log.fine("Dimensions too large: " + image.getWidth() + 'x' + image.getHeight());
+ log.fine("Dimensions too large: " + image.getWidth() + 'x' + image.getHeight());
response.sendRedirect("badimage.jspx");
return;
}