public class BarcodeDrawer extends MustDrawer
Modifier and Type | Field and Description |
---|---|
static int |
BARCODE_TYPE_COD39 |
static int |
BARCODE_TYPE_CODE128 |
static int |
BARCODE_TYPE_INT2OF5 |
currentFontSpec, originalFont
Constructor and Description |
---|
BarcodeDrawer() |
BarcodeDrawer(int barcodeType)
Constructs a new barcode drawer to render barcodes of the specified type.
|
Modifier and Type | Method and Description |
---|---|
void |
drawBarcode(java.awt.Graphics2D graphics2D,
java.lang.String text,
int x,
int y) |
void |
drawBarcode(java.awt.Graphics2D graphics2D,
java.lang.String text,
int x,
int y,
java.awt.Font font)
Renders a barcode at the specified location in the specified Graphics2D context.
|
void |
drawBarcodeAboveFixtext(java.awt.Graphics2D graphics2D,
java.lang.String text,
java.lang.String fixtext,
int imageableX,
int imageableY,
int imagableWidth,
int imagableHeight,
java.awt.Font font,
java.awt.Font fixtextFont) |
void |
drawBarcodeAboveFixtext(java.awt.Graphics2D graphics2D,
java.lang.String text,
java.util.Vector<java.lang.String> fixlines,
int imageableX,
int imageableY,
int imagableWidth,
int imagableHeight,
java.awt.Font font,
java.awt.Font fixtextFont,
int xT) |
void |
drawBarcodeAboveImage(java.awt.Graphics2D graphics2D,
java.lang.String text,
java.awt.Image image,
int imageableX,
int imageableY,
int imagableWidth,
int imagableHeight,
java.awt.Font font) |
void |
drawBarcodeInCenter(java.awt.Graphics2D graphics2D,
java.lang.String text,
int imageableX,
int y,
int imagableWidth,
java.awt.Font font) |
void |
drawBarcodeInCenter(java.awt.Graphics2D graphics2D,
java.lang.String text,
int imageableX,
int imageableY,
int imagableWidth,
int imagableHeight,
java.awt.Font font) |
void |
drawBarcodeRightmost(java.awt.Graphics2D graphics2D,
java.lang.String text,
int imageableX,
int y,
int imagableWidth,
java.awt.Font font) |
static KeyValuePairNum[] |
getAvailableBarcodeTypes() |
void |
setAdjustment(int adjustmentX,
int adjustmentY)
Sets adjustment to correct on wrong printer positioning.
|
void |
setBarcodeType(int barcodeType)
Sets the barcode type.
|
void |
setBarHeight(int barHeight) |
changeFontIfNew, getCompletelyLoadedImage, getCompletelyLoadedImage, getPx, getPxD, getRightAllignOffset, getRightAllignStartPoint, limit, limit, resetFont, setOnBold, wrap
public static final int BARCODE_TYPE_CODE128
public static final int BARCODE_TYPE_COD39
public static final int BARCODE_TYPE_INT2OF5
public BarcodeDrawer()
public BarcodeDrawer(int barcodeType)
barcodeType
- the type of barcode to useBARCODE_TYPE_CODE128
,
BARCODE_TYPE_INT2OF5
,
BARCODE_TYPE_COD39
public static KeyValuePairNum[] getAvailableBarcodeTypes()
public void setBarcodeType(int barcodeType)
barcodeType
- the type of barcode to useBARCODE_TYPE_CODE128
,
BARCODE_TYPE_COD39
,
BARCODE_TYPE_INT2OF5
public void setBarHeight(int barHeight)
public void setAdjustment(int adjustmentX, int adjustmentY)
adjustmentX
- +- mm more right or leftadjustmentY
- +- mm deeper or higherpublic void drawBarcode(java.awt.Graphics2D graphics2D, java.lang.String text, int x, int y, java.awt.Font font)
graphics2D
- the graphics contexttext
- the text (barcode content)x
- the horizontal value of the upper left co-ordinate of the bounding boxy
- the vertical value of the upper left co-ordinate of the bounding boxfont
- the font of the text below the barcodepublic void drawBarcode(java.awt.Graphics2D graphics2D, java.lang.String text, int x, int y)
public void drawBarcodeInCenter(java.awt.Graphics2D graphics2D, java.lang.String text, int imageableX, int y, int imagableWidth, java.awt.Font font)
public void drawBarcodeInCenter(java.awt.Graphics2D graphics2D, java.lang.String text, int imageableX, int imageableY, int imagableWidth, int imagableHeight, java.awt.Font font)
public void drawBarcodeRightmost(java.awt.Graphics2D graphics2D, java.lang.String text, int imageableX, int y, int imagableWidth, java.awt.Font font)
public void drawBarcodeAboveImage(java.awt.Graphics2D graphics2D, java.lang.String text, java.awt.Image image, int imageableX, int imageableY, int imagableWidth, int imagableHeight, java.awt.Font font)
public void drawBarcodeAboveFixtext(java.awt.Graphics2D graphics2D, java.lang.String text, java.lang.String fixtext, int imageableX, int imageableY, int imagableWidth, int imagableHeight, java.awt.Font font, java.awt.Font fixtextFont)
public void drawBarcodeAboveFixtext(java.awt.Graphics2D graphics2D, java.lang.String text, java.util.Vector<java.lang.String> fixlines, int imageableX, int imageableY, int imagableWidth, int imagableHeight, java.awt.Font font, java.awt.Font fixtextFont, int xT)
Copyright 1998-2023 Christoph Mueller, Kaerntner Str. 56, D-70469 Stuttgart, Germany, https://www.perpus.de