Supplement for #271 to deprecate alternative min/max size hint

This commit is contained in:
Sean Owen 2014-12-17 21:59:35 +00:00
parent 45e591b9ef
commit 51bee78535
2 changed files with 9 additions and 0 deletions

View file

@ -44,12 +44,19 @@ public enum EncodeHintType {
/**
* Specifies a minimum barcode size (type {@link Dimension}). Only applicable to Data Matrix now.
*
* @deprecated use width/height params in
* {@link com.google.zxing.datamatrix.DataMatrixWriter#encode(String, BarcodeFormat, int, int)}
*/
@Deprecated
MIN_SIZE,
/**
* Specifies a maximum barcode size (type {@link Dimension}). Only applicable to Data Matrix now.
*
* @deprecated without replacement
*/
@Deprecated
MAX_SIZE,
/**

View file

@ -67,10 +67,12 @@ public final class DataMatrixWriter implements Writer {
if (requestedShape != null) {
shape = requestedShape;
}
@SuppressWarnings("deprecated")
Dimension requestedMinSize = (Dimension) hints.get(EncodeHintType.MIN_SIZE);
if (requestedMinSize != null) {
minSize = requestedMinSize;
}
@SuppressWarnings("deprecated")
Dimension requestedMaxSize = (Dimension) hints.get(EncodeHintType.MAX_SIZE);
if (requestedMaxSize != null) {
maxSize = requestedMaxSize;