com.jrefinery.report.ext.barcode
Class BarcodePostnet

java.lang.Object
  extended bycom.jrefinery.report.ext.barcode.Barcode
      extended bycom.jrefinery.report.ext.barcode.BarcodePostnet
All Implemented Interfaces:
java.lang.Cloneable

public class BarcodePostnet
extends Barcode

Implements the Postnet and Planet barcodes. The default parameters are:

n = 72f / 22f; // distance between bars
x = 0.02f * 72f; // bar width
barHeight = 0.125f * 72f; // height of the tall bars
size = 0.05f * 72f; // height of the short bars
codeType = POSTNET; // type of code
 

Author:
Paulo Soares (psoares@consiste.pt)

Field Summary
 
Fields inherited from class com.jrefinery.report.ext.barcode.Barcode
DEFAULT_FONT
 
Constructor Summary
BarcodePostnet()
          Creates new BarcodePostnet
 
Method Summary
 java.awt.Image createImageWithBarcode(java.awt.Color barColor, java.awt.Color textColor)
          Creates an Image with the barcode.
 java.awt.geom.Dimension2D getBarcodeSize()
          Gets the maximum area that the barcode and the text, if any, will occupy.
 float getBarSize()
           
 byte[] getBarsPostnet()
          Creates the bars for Postnet.
 float getMultiplier()
           
 boolean isTypePlanet()
           
 void setBarSize(float barSize)
           
 void setMultiplier(float multiplier)
           
 void setTypePlanet(boolean typePlanet)
           
 
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

BarcodePostnet

public BarcodePostnet()
Creates new BarcodePostnet

Method Detail

getMultiplier

public float getMultiplier()

setMultiplier

public void setMultiplier(float multiplier)

isTypePlanet

public boolean isTypePlanet()

setTypePlanet

public void setTypePlanet(boolean typePlanet)

getBarSize

public float getBarSize()

setBarSize

public void setBarSize(float barSize)

getBarsPostnet

public byte[] getBarsPostnet()
Creates the bars for Postnet.

Returns:
the bars

getBarcodeSize

public java.awt.geom.Dimension2D getBarcodeSize()
Gets the maximum area that the barcode and the text, if any, will occupy. The lower left corner is always (0, 0).

Specified by:
getBarcodeSize in class Barcode
Returns:
the size the barcode occupies.

createImageWithBarcode

public java.awt.Image createImageWithBarcode(java.awt.Color barColor,
                                             java.awt.Color textColor)
Creates an Image with the barcode.

Specified by:
createImageWithBarcode in class Barcode
Parameters:
barColor - the color of the bars. It can be null
textColor - the color of the text. It can be null
Returns:
the Image