Class Interleaved2Of5Bean
java.lang.Object
org.krysalis.barcode4j.impl.AbstractBarcodeBean
org.krysalis.barcode4j.impl.int2of5.Interleaved2Of5Bean
- All Implemented Interfaces:
BarcodeGenerator
- Direct Known Subclasses:
ITF14Bean
This class is an implementation of the Interleaved 2 of 5 barcode.
- Version:
- $Id: Interleaved2Of5Bean.java,v 1.5 2008-05-13 13:00:46 jmaerki Exp $
- Author:
- Jeremias Maerki
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final doubleThe default module width for Interleaved 2 of 5.static final doubleThe default wide factor for Interleaved 2 of 5.Fields inherited from class org.krysalis.barcode4j.impl.AbstractBarcodeBean
doQuietZone, fontName, fontSize, height, moduleWidth, msgPos, pattern, quietZone, quietZoneVertical -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncalcDimensions(String msg) Calculates the dimension of a barcode with the given message.voidgenerateBarcode(CanvasProvider canvas, String msg) Generates a barcode using the given Canvas to render the barcode to its output format.doublegetBarWidth(int width) Returns the effective width of a bar with a given logical width.Returns the current checksum mode.doubleReturns the factor by which wide bars are broader than narrow bars.booleanIndicates whether the checksum will be displayed as part of the human-readable message.voidsetChecksumMode(ChecksumMode mode) Sets the checksum modevoidsetDisplayChecksum(boolean value) Enables or disables the use of the checksum in the human-readable message.voidsetWideFactor(double value) Sets the factor by which wide bars are broader than narrow bars.Methods inherited from class org.krysalis.barcode4j.impl.AbstractBarcodeBean
doQuietZone, getBarHeight, getFontName, getFontSize, getHeight, getHumanReadableHeight, getModuleWidth, getMsgPosition, getPattern, getQuietZone, getVerticalQuietZone, hasFontDescender, hasQuietZone, setBarHeight, setFontName, setFontSize, setHeight, setModuleWidth, setMsgPosition, setPattern, setQuietZone, setVerticalQuietZone
-
Field Details
-
DEFAULT_WIDE_FACTOR
public static final double DEFAULT_WIDE_FACTORThe default wide factor for Interleaved 2 of 5.- See Also:
-
DEFAULT_MODULE_WIDTH
protected static final double DEFAULT_MODULE_WIDTHThe default module width for Interleaved 2 of 5.- See Also:
-
-
Constructor Details
-
Interleaved2Of5Bean
public Interleaved2Of5Bean()Create a new instance.
-
-
Method Details
-
isDisplayChecksum
public boolean isDisplayChecksum()Indicates whether the checksum will be displayed as part of the human-readable message.- Returns:
- true if checksum will be included in the human-readable message
-
setDisplayChecksum
public void setDisplayChecksum(boolean value) Enables or disables the use of the checksum in the human-readable message.- Parameters:
value- true to include the checksum in the human-readable message, false to ignore
-
getBarWidth
public double getBarWidth(int width) Description copied from class:AbstractBarcodeBeanReturns the effective width of a bar with a given logical width.- Specified by:
getBarWidthin classAbstractBarcodeBean- Parameters:
width- the logical width (1=narrow, 2=wide)- Returns:
- the effective width of a bar (in mm)
- See Also:
-
generateBarcode
Description copied from class:AbstractBarcodeBeanGenerates a barcode using the given Canvas to render the barcode to its output format.- Specified by:
generateBarcodein interfaceBarcodeGenerator- Specified by:
generateBarcodein classAbstractBarcodeBean- Parameters:
canvas- CanvasProvider that the barcode is to be rendered on.msg- message to encode- See Also:
-
calcDimensions
Description copied from class:AbstractBarcodeBeanCalculates the dimension of a barcode with the given message. The dimensions are dependant on the configuration of the barcode generator.- Specified by:
calcDimensionsin interfaceBarcodeGenerator- Overrides:
calcDimensionsin classAbstractBarcodeBean- Parameters:
msg- message to use for calculation.- Returns:
- BarcodeDimension a BarcodeDimension object containing the barcode's dimensions
- See Also:
-
getChecksumMode
Returns the current checksum mode.- Returns:
- ChecksumMode the checksum mode
-
setChecksumMode
Sets the checksum mode- Parameters:
mode- the checksum mode
-
getWideFactor
public double getWideFactor()Returns the factor by which wide bars are broader than narrow bars.- Returns:
- the wide factor
-
setWideFactor
public void setWideFactor(double value) Sets the factor by which wide bars are broader than narrow bars.- Parameters:
value- the wide factory (should be > 1.0)
-