com.jrefinery.report.ext.barcode
Class BarcodeUPCA

java.lang.Object
  |
  +--com.jrefinery.report.ext.barcode.Barcode
        |
        +--com.jrefinery.report.ext.barcode.BarcodeEAN
              |
              +--com.jrefinery.report.ext.barcode.BarcodeEAN13
                    |
                    +--com.jrefinery.report.ext.barcode.BarcodeUPCA
All Implemented Interfaces:
java.lang.Cloneable

public class BarcodeUPCA
extends BarcodeEAN13


Field Summary
 
Fields inherited from class com.jrefinery.report.ext.barcode.BarcodeEAN13
TEXTPOS_EAN13
 
Fields inherited from class com.jrefinery.report.ext.barcode.BarcodeEAN
BARS, EVEN, GUARD_EMPTY, ODD
 
Fields inherited from class com.jrefinery.report.ext.barcode.Barcode
DEFAULT_FONT
 
Constructor Summary
BarcodeUPCA()
           
 
Method Summary
static java.lang.String convertUPCAtoUPCE(java.lang.String text)
          Converts an UPCA code into an UPCE code.
protected  void drawCode(java.awt.Graphics2D g2, float keepBarX, float textStartY)
           
protected  java.lang.String getBarCode()
          Creates the bars for the barcode EAN13 and UPCA.
protected  int[] getGuardBarPositions()
           
protected  float getWidth()
           
 
Methods inherited from class com.jrefinery.report.ext.barcode.BarcodeEAN13
getBars, isTextBased
 
Methods inherited from class com.jrefinery.report.ext.barcode.BarcodeEAN
calculateEANParity, createImageWithBarcode, getBarcodeSize, isGuardBars, setGuardBars
 
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
 

Constructor Detail

BarcodeUPCA

public BarcodeUPCA()
Method Detail

getWidth

protected float getWidth()
Overrides:
getWidth in class BarcodeEAN13

getGuardBarPositions

protected int[] getGuardBarPositions()
Overrides:
getGuardBarPositions in class BarcodeEAN13

convertUPCAtoUPCE

public static java.lang.String convertUPCAtoUPCE(java.lang.String text)
Converts an UPCA code into an UPCE code. If the code can not be converted a IllegalArgumentException is thrown

Parameters:
text - the code to convert. It must have 12 numeric characters
Returns:
the 8 converted digits or null if the code could not be converted

getBarCode

protected java.lang.String getBarCode()
Creates the bars for the barcode EAN13 and UPCA.

Overrides:
getBarCode in class BarcodeEAN13
Returns:
the barcode

drawCode

protected void drawCode(java.awt.Graphics2D g2,
                        float keepBarX,
                        float textStartY)
Overrides:
drawCode in class BarcodeEAN13