Package totalcross.barcode
Class Barcode93
- java.lang.Object
-
- totalcross.barcode.Barcode
-
- totalcross.barcode.Barcode93
-
public class Barcode93 extends Barcode
Implements the code 93. The default parameters are:x = 1f; n = 2; font = new Font("Helvetica",Font.PLAIN,20)); textAlignment = ALIGN_CENTER; generateChecksum = false; checksumText = false; startStopText = true; extended = false; codeType = CODE93; transparent = true; shotText = true generateChecksum = true; checksumText = false;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
Fields Modifier and Type Field Description static java.lang.StringASCII_CHARSASCII chars representation in Code 93 using escape chars.static java.lang.StringCHARSCode 93 chars ordered by code93 value-
Fields inherited from class totalcross.barcode.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, showText, size, startStopText, SUPP2, SUPP5, textAlignment, transparent, TYPE_CODE128, TYPE_CODE93, TYPE_INTERLEAVED2OF5, UPCA, UPCE, x
-
-
Constructor Summary
Constructors Constructor Description Barcode93()Creates a new Barcode39.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetBarcodeWidth()Gets the maximum width that the barcode will occupy.static java.lang.StringgetChecksum(java.lang.String text)Calculates the checksum.voidplaceBarcode(Image i, int barColor, int textColor)Places the barcode in a Image.-
Methods inherited from class totalcross.barcode.Barcode
createImage, createImage, getBackgroundColor, getBarHeight, getCode, getCodeType, getFont, getFontName, getFontSize, getN, getQuietZoneX, getSize, getTextAlignment, getX, isChecksumText, isExtended, isGenerateChecksum, isGuardBars, isQuietZone, isShowText, isStartStopText, isTransparent, scale, setBackgroundColor, setBarHeight, setChecksumText, setCode, setCodeType, setExtended, setFont, setFontName, setFontSize, setFontStyle, setGenerateChecksum, setGuardBars, setN, setQuietZone, setQuietZoneX, setShowText, setSize, setStartStopText, setTextAlignment, setTransparent, setX
-
-
-
-
Field Detail
-
CHARS
public static java.lang.String CHARS
Code 93 chars ordered by code93 value
-
ASCII_CHARS
public static java.lang.String ASCII_CHARS
ASCII chars representation in Code 93 using escape chars. First digit is escape char using this convention: escape ' ' = No escape char escape '*' = First Escape char; Barcode93 value 43 escape '&' = Second Escape char; Barcode93 value 44 escape '#' = Thirth Escape char; Barcode93 value 45 escape '@' = Fourth Escape char; Barcode93 value 46 The second digit is the code 93 char to use
-
-
Method Detail
-
getBarcodeWidth
public int getBarcodeWidth()
Gets the maximum width that the barcode will occupy. The lower left corner is always (0, 0).- Specified by:
getBarcodeWidthin classBarcode- Returns:
- the size the barcode occupies.
-
getChecksum
public static java.lang.String getChecksum(java.lang.String text)
Calculates the checksum.- Parameters:
text- the text- Returns:
- the checksum
-
placeBarcode
public void placeBarcode(Image i, int barColor, int textColor)
Places the barcode in a Image. The The bars and text are written in the following colors:barColortextColorResult
nullnullbars and text painted with current fill color
barColornullbars and text painted with
barColornulltextColorbars painted with current color
text painted withtextColorbarColortextColorbars painted with
barColor
text painted withtextColor- Specified by:
placeBarcodein classBarcode- Parameters:
i- theImagewhere the barcode will be placedbarColor- the color of the bars. It can be-1textColor- the color of the text. It can be-1
-
-