com.jrefinery.report.ext.barcode
Class Barcode39

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

public class Barcode39
extends Barcode

Implements the code 39 and code 39 extended. The default parameters are:

x = 0.8f;
n = 2;
font = BaseFont.createFont("Helvetica", "winansi", false);
size = 8;
baseline = size;
barHeight = size * 3;
textAlignment = Element.ALIGN_CENTER;
generateChecksum = false;
checksumText = false;
startStopText = true;
extended = false;
 

Author:
Paulo Soares (psoares@consiste.pt)

Field Summary
 
Fields inherited from class com.jrefinery.report.ext.barcode.Barcode
DEFAULT_FONT
 
Constructor Summary
Barcode39()
          Creates a new Barcode39.
 
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.
 java.lang.String getFullCode()
           
 float getMultiplier()
          Gets the bar multiplier for wide bars.
 boolean isExtended()
          Gets the property to generate extended barcode 39.
 boolean isStartStopText()
          Sets the property to show the start and stop character '*' in the text for the barcode 39.
 void setExtended(boolean extended)
          Sets the property to generate extended barcode 39.
 void setMultiplier(float n)
          Sets the bar multiplier for wide bars.
 void setStartStopText(boolean startStopText)
          Gets the property to show the start and stop character '*' in the text for the barcode 39.
 
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

Barcode39

public Barcode39()
Creates a new Barcode39.

Method Detail

getMultiplier

public float getMultiplier()
Gets the bar multiplier for wide bars.

Returns:
the bar multiplier for wide bars

setMultiplier

public void setMultiplier(float n)
Sets the bar multiplier for wide bars.

Parameters:
n - the bar multiplier for wide bars

getFullCode

public java.lang.String getFullCode()

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

isStartStopText

public boolean isStartStopText()
Sets the property to show the start and stop character '*' in the text for the barcode 39.

Returns:
value of property startStopText

setStartStopText

public void setStartStopText(boolean startStopText)
Gets the property to show the start and stop character '*' in the text for the barcode 39.

Parameters:
startStopText - new value of property startStopText

isExtended

public boolean isExtended()
Gets the property to generate extended barcode 39.

Returns:
value of property extended.

setExtended

public void setExtended(boolean extended)
Sets the property to generate extended barcode 39.

Parameters:
extended - new value of property extended

getBarcodeSize

public java.awt.geom.Dimension2D getBarcodeSize()
Gets the maximum area that the barcode and the text, if any, will occupy.

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