|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--jbars.Barcode | +--jbars.Barcode128
Implements the code 128 and UCC/EAN-128. Other symbologies are allowed in raw mode.
The code types allowed are:
x = 1f; font = new Font("Helvetica",Font.PLAIN,20)); textAlignment = ALIGN_CENTER; codeType = CODE128; transparent = true; shotText = true quietZone = true; quietZoneX = 10;This class is based on iText "A Free Java-PDF library by Bruno Lowagie and Paulo Soares" using the Mozilla Public License(MPL)
Field Summary | |
(package private) static byte[][] |
BARS
The bars to generate the code. |
(package private) static byte[] |
BARS_STOP
The stop bars. |
static char |
CODE_AB_TO_C
The charset code change. |
static char |
CODE_AC_TO_B
The charset code change. |
static char |
CODE_BC_TO_A
The charset code change. |
static char |
FNC1
The code for UCC/EAN-128. |
static char |
START_A
The start code. |
static char |
START_B
The start code. |
static char |
START_C
The start code. |
Fields inherited from class jbars.Barcode |
ALIGN_CENTER, ALIGN_LEFT, ALIGN_RIGHT, backgroundColor, barHeight, checksumText, CODABAR, code, CODE128, CODE128_RAW, CODE128_UCC, CODE93, codeType, EAN13, EAN8, extended, font, generateChecksum, guardBars, n, PLANET, POSTNET, quietZone, quietZoneX, ROTATE_0, ROTATE_180, ROTATE_270, ROTATE_90, showText, size, startStopText, SUPP2, SUPP5, textAlignment, transparent, TYPE_CODE128, TYPE_CODE93, TYPE_INTERLEAVED2OF5, UPCA, UPCE, x |
Constructor Summary | |
Barcode128()
Creates new Barcode128 |
Method Summary | |
float |
getBarcodeWidth()
Gets the maximum width that the barcode will occupy. |
static byte[] |
getBarsCode128Raw(java.lang.String text)
Generates the bars. |
(package private) static java.lang.String |
getPackedRawDigits(java.lang.String text,
int textIndex,
int numDigits)
Packs the digits for charset C. |
static java.lang.String |
getRawText(java.lang.String text,
boolean ucc)
Converts the human readable text to the characters needed to create a barcode. |
(package private) static boolean |
isNextDigits(java.lang.String text,
int textIndex,
int numDigits)
Returns true if the next numDigits
starting from index textIndex are numeric. |
void |
placeBarcode(java.awt.image.BufferedImage i,
java.awt.Color barColor,
java.awt.Color textColor)
Places the barcode in a BufferedImage. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
static byte[][] BARS
static byte[] BARS_STOP
public static final char CODE_AB_TO_C
public static final char CODE_AC_TO_B
public static final char CODE_BC_TO_A
public static final char FNC1
public static final char START_A
public static final char START_B
public static final char START_C
Constructor Detail |
public Barcode128()
Method Detail |
public float getBarcodeWidth()
getBarcodeWidth
in class Barcode
public static byte[] getBarsCode128Raw(java.lang.String text)
text
- the barcode
static java.lang.String getPackedRawDigits(java.lang.String text, int textIndex, int numDigits)
text
- the text to packtextIndex
- where to pack fromnumDigits
- the number of digits to pack. It is always an even number
public static java.lang.String getRawText(java.lang.String text, boolean ucc)
text
- the text to convertucc
- true
if it is an UCC/EAN-128. In this case
the character FNC1 is added
static boolean isNextDigits(java.lang.String text, int textIndex, int numDigits)
true
if the next numDigits
starting from index textIndex
are numeric.
text
- the text to checktextIndex
- where to check fromnumDigits
- the number of digits to check
public void placeBarcode(java.awt.image.BufferedImage i, java.awt.Color barColor, java.awt.Color textColor)
|
|
Result |
---|---|---|
|
|
bars and text painted with current fill color |
|
|
bars and text painted with |
|
|
bars painted with current color |
|
|
bars painted with |
placeBarcode
in class Barcode
barColor
- the color of the bars. It can be null
textColor
- the color of the text. It can be null
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |