-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
345404a
commit 9173391
Showing
5 changed files
with
47 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
src/main/java/com/labelzoom/api/model/components/barcodes/IBarcodeWithModuleWidth.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package com.labelzoom.api.model.components.barcodes; | ||
|
||
import lombok.Getter; | ||
|
||
/** | ||
* <b>***NOTE***</b> When adding additional fields to barcodes, the BarcodeDeserializer must also be updated | ||
*/ | ||
public interface IBarcodeWithModuleWidth | ||
{ | ||
@Getter | ||
enum ZebraBarcodeSize | ||
{ | ||
Smallest(1), | ||
Smaller(2), | ||
Normal(3), | ||
Large(4), | ||
XLarge(5), | ||
XXLarge(6), | ||
XXXLarge(7), | ||
XXXXLarge(8), | ||
XXXXXLarge(9); | ||
|
||
private final int value; | ||
|
||
ZebraBarcodeSize(final int value) { | ||
this.value = value; | ||
} | ||
} | ||
|
||
ZebraBarcodeSize getBarcodeSize(); | ||
void setBarcodeSize(ZebraBarcodeSize size); | ||
|
||
default float getModuleWidthInMm(final int dpi) | ||
{ | ||
return (float)this.getBarcodeSize().getValue() / (float)dpi * 25.4f; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters