|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jrefinery.report.ext.barcode.Barcode
com.jrefinery.report.ext.barcode.BarcodeEAN
Generates barcodes in several formats: EAN13, EAN8, UPCA, UPCE, supplemental 2 and 5. The default parameters are:
x = 0.8f; font = BaseFont.createFont("Helvetica", "winansi", false); size = 8; baseline = size; barHeight = size * 3; guardBars = true; codeType = EAN13; code = "";
Field Summary | |
protected static byte[][] |
BARS
The basic bar widths. |
protected static int |
EVEN
Marker for even parity. |
protected static int[] |
GUARD_EMPTY
The bar positions that are guard bars. |
protected static int |
ODD
Marker for odd parity. |
Fields inherited from class com.jrefinery.report.ext.barcode.Barcode |
DEFAULT_FONT |
Constructor Summary | |
BarcodeEAN()
Creates new BarcodeEAN |
Method Summary | |
protected static int |
calculateEANParity(java.lang.String code)
Calculates the EAN parity character. |
java.awt.Image |
createImageWithBarcode(java.awt.Color barColor,
java.awt.Color textColor)
Creates an Image with the barcode. |
protected abstract void |
drawCode(java.awt.Graphics2D g2,
float keepBarX,
float textStartY)
|
java.awt.geom.Dimension2D |
getBarcodeSize()
Gets the maximum area that the barcode and the text, if any, will occupy. |
protected abstract byte[] |
getBars()
|
protected abstract int[] |
getGuardBarPositions()
|
protected abstract float |
getWidth()
|
boolean |
isGuardBars()
Gets the property to show the guard bars for barcode EAN. |
protected boolean |
isTextBased()
|
void |
setGuardBars(boolean guardBars)
Sets the property to show the guard bars for barcode EAN. |
Methods inherited from class com.jrefinery.report.ext.barcode.Barcode |
clone, getBarHeight, getBaseline, getCode, getFont, getFontAscent, getFontDescent, getMinWidth, getTextAlignment, isDisplayChecksumText, isGenerateChecksum, setBarHeight, setBaseline, setCode, setDisplayChecksumText, setFont, setGenerateChecksum, setMinWidth, setTextAlignment |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static int[] GUARD_EMPTY
protected static byte[][] BARS
protected static final int ODD
protected static final int EVEN
Constructor Detail |
public BarcodeEAN()
Method Detail |
protected abstract byte[] getBars()
public boolean isGuardBars()
public void setGuardBars(boolean guardBars)
guardBars
- new value of property guardBarsprotected static int calculateEANParity(java.lang.String code)
code
- the code
protected abstract float getWidth()
public java.awt.geom.Dimension2D getBarcodeSize()
getBarcodeSize
in class Barcode
protected boolean isTextBased()
protected abstract int[] getGuardBarPositions()
protected abstract void drawCode(java.awt.Graphics2D g2, float keepBarX, float textStartY)
public java.awt.Image createImageWithBarcode(java.awt.Color barColor, java.awt.Color textColor)
Image
with the barcode.
createImageWithBarcode
in class Barcode
barColor
- the color of the bars. It can be null
textColor
- the color of the text. It can be null
Image
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |