barcode4j 2.0

org.krysalis.barcode4j.impl.datamatrix
Class DataMatrixBean

java.lang.Object
  extended byorg.krysalis.barcode4j.impl.AbstractBarcodeBean
      extended byorg.krysalis.barcode4j.impl.datamatrix.DataMatrixBean
All Implemented Interfaces:
BarcodeGenerator

public class DataMatrixBean
extends AbstractBarcodeBean

This class is an implementation of DataMatrix (ISO 16022:2000(E)).

Version:
$Id: DataMatrixBean.java,v 1.5 2008/05/13 13:00:43 jmaerki Exp $

Field Summary
protected static double DEFAULT_MODULE_WIDTH
          The default module width (dot size) for DataMatrix.
 
Fields inherited from class org.krysalis.barcode4j.impl.AbstractBarcodeBean
doQuietZone, fontName, fontSize, height, moduleWidth, msgPos, pattern, quietZone, quietZoneVertical
 
Constructor Summary
DataMatrixBean()
          Create a new instance.
 
Method Summary
 BarcodeDimension calcDimensions(java.lang.String msg)
          Calculates the dimension of a barcode with the given message. The dimensions are dependant on the configuration of the barcode generator.
 void generateBarcode(CanvasProvider canvas, java.lang.String msg)
          Generates a barcode using the given Canvas to render the barcode to its output format.
 double getBarHeight()
          Returns the height of the bars.
 double getBarWidth(int width)
          Returns the effective width of a bar with a given logical width.
 SymbolShapeHint getShape()
          Gets the requested shape for the generated barcodes.
 double getVerticalQuietZone()
          Returns the vertical quiet zone.
 void setShape(SymbolShapeHint shape)
          Sets the requested shape for the generated barcodes.
 
Methods inherited from class org.krysalis.barcode4j.impl.AbstractBarcodeBean
doQuietZone, getFontName, getFontSize, getHeight, getHumanReadableHeight, getModuleWidth, getMsgPosition, getPattern, getQuietZone, hasFontDescender, hasQuietZone, setBarHeight, setFontName, setFontSize, setHeight, setModuleWidth, setMsgPosition, setPattern, setQuietZone, setVerticalQuietZone
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_MODULE_WIDTH

protected static final double DEFAULT_MODULE_WIDTH
The default module width (dot size) for DataMatrix.

Constructor Detail

DataMatrixBean

public DataMatrixBean()
Create a new instance.

Method Detail

setShape

public void setShape(SymbolShapeHint shape)
Sets the requested shape for the generated barcodes.

Parameters:
shape - requested shape. May be SymbolShapeHint.FORCE_NONE, SymbolShapeHint.FORCE_SQUARE or SymbolShapeHint.FORCE_RECTANGLE.

getShape

public SymbolShapeHint getShape()
Gets the requested shape for the generated barcodes.

Returns:
the requested shape (one of SymbolShapeHint.*).

generateBarcode

public void generateBarcode(CanvasProvider canvas,
                            java.lang.String msg)
Description copied from class: AbstractBarcodeBean
Generates a barcode using the given Canvas to render the barcode to its output format.

Specified by:
generateBarcode in interface BarcodeGenerator
Specified by:
generateBarcode in class AbstractBarcodeBean
See Also:
BarcodeGenerator.generateBarcode(CanvasProvider, String)

calcDimensions

public BarcodeDimension calcDimensions(java.lang.String msg)
Description copied from class: AbstractBarcodeBean
Calculates the dimension of a barcode with the given message. The dimensions are dependant on the configuration of the barcode generator.

Specified by:
calcDimensions in interface BarcodeGenerator
Overrides:
calcDimensions in class AbstractBarcodeBean
See Also:
BarcodeGenerator.calcDimensions(String)

getVerticalQuietZone

public double getVerticalQuietZone()
Description copied from class: AbstractBarcodeBean
Returns the vertical quiet zone. If no vertical quiet zone is set explicitely, the value if AbstractBarcodeBean.getQuietZone() is returned.

Overrides:
getVerticalQuietZone in class AbstractBarcodeBean
Returns:
the height of the vertical quiet zone (in mm)
See Also:
AbstractBarcodeBean.getVerticalQuietZone()

getBarWidth

public double getBarWidth(int width)
Description copied from class: AbstractBarcodeBean
Returns the effective width of a bar with a given logical width.

Specified by:
getBarWidth in class AbstractBarcodeBean
Parameters:
width - the logical width (1=narrow, 2=wide)
Returns:
the effective width of a bar (in mm)
See Also:
AbstractBarcodeBean.getBarWidth(int)

getBarHeight

public double getBarHeight()
Description copied from class: AbstractBarcodeBean
Returns the height of the bars.

Overrides:
getBarHeight in class AbstractBarcodeBean
Returns:
the height of the bars (in mm)
See Also:
AbstractBarcodeBean.getBarHeight()

barcode4j 2.0

Copyright © 2000-2008 Jeremias Maerki. All rights reserved.