public abstract class AbstractBarcodeBean extends Object implements BarcodeGenerator
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
doQuietZone
True if quiet zone should be rendered
|
protected String |
fontName
Font name
|
protected double |
fontSize
Font size in mm
|
protected double |
height
Net height of bars in mm
|
protected double |
moduleWidth
Width of narrow module in mm
|
protected HumanReadablePlacement |
msgPos
Position of human-readable text
|
protected String |
pattern
pattern to be applied over the human readable message
|
protected double |
quietZone
Width of the quiet zone left and right of the barcode in mm
|
protected Double |
quietZoneVertical
Height of the vertical quiet zone above and below the barcode in mm
|
| Constructor and Description |
|---|
AbstractBarcodeBean() |
| Modifier and Type | Method and Description |
|---|---|
BarcodeDimension |
calcDimensions(String msg)
Calculates the dimension of a barcode with the given message.
|
void |
doQuietZone(boolean value)
Controls whether a quiet zone should be included or not.
|
abstract void |
generateBarcode(CanvasProvider canvas,
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.
|
abstract double |
getBarWidth(int width)
Returns the effective width of a bar with a given logical width.
|
String |
getFontName()
Returns the font name of the human-readable part.
|
double |
getFontSize()
Returns the font size of the human-readable part.
|
double |
getHeight()
Returns the full height of the barcode.
|
double |
getHumanReadableHeight()
Returns the height of the human-readable part.
|
double |
getModuleWidth()
Returns the width of the narrow module.
|
HumanReadablePlacement |
getMsgPosition()
Returns the placement of the human-readable part.
|
String |
getPattern()
returns the pattern to be applied over the human readable message
|
double |
getQuietZone() |
double |
getVerticalQuietZone()
Returns the vertical quiet zone.
|
protected boolean |
hasFontDescender()
Indicates whether the barcode height calculation should take a font descender
into account.
|
boolean |
hasQuietZone()
Indicates whether a quiet zone is included.
|
void |
setBarHeight(double height)
Sets the height of the bars.
|
void |
setFontName(String name)
Sets the font name of the human-readable part.
|
void |
setFontSize(double size)
Sets the font size of the human-readable part.
|
void |
setHeight(double height)
Sets the full height of the barcode.
|
void |
setModuleWidth(double width)
Sets the width of the narrow module.
|
void |
setMsgPosition(HumanReadablePlacement placement)
Sets the placement of the human-readable part.
|
void |
setPattern(String v)
Sets the pattern to be applied over the human readable message
|
void |
setQuietZone(double width)
Sets the width of the quiet zone.
|
void |
setVerticalQuietZone(double height)
Sets the height of the vertical quiet zone.
|
protected double height
protected double moduleWidth
protected HumanReadablePlacement msgPos
protected double fontSize
protected String fontName
protected boolean doQuietZone
protected double quietZone
protected Double quietZoneVertical
protected String pattern
public String getPattern()
public void setPattern(String v)
v - Stringprotected boolean hasFontDescender()
public double getHumanReadableHeight()
public double getBarHeight()
public double getHeight()
public void setBarHeight(double height)
height - the height of the bars (in mm)public void setHeight(double height)
height - the full height (in mm)public double getModuleWidth()
public void setModuleWidth(double width)
width - the width of the narrow module (in mm)public abstract double getBarWidth(int width)
width - the logical width (1=narrow, 2=wide)public boolean hasQuietZone()
public void doQuietZone(boolean value)
value - true if a quiet zone should be includedpublic double getQuietZone()
public double getVerticalQuietZone()
getQuietZone() is returned.public void setQuietZone(double width)
width - the width of the quiet zone (in mm)public void setVerticalQuietZone(double height)
height - the height of the vertical quiet zone (in mm)public HumanReadablePlacement getMsgPosition()
public void setMsgPosition(HumanReadablePlacement placement)
placement - the placement of the human-readable partpublic double getFontSize()
public void setFontSize(double size)
size - the font sizepublic String getFontName()
public void setFontName(String name)
name - the font namepublic abstract void generateBarcode(CanvasProvider canvas, String msg)
generateBarcode in interface BarcodeGeneratorcanvas - CanvasProvider that the barcode is to be rendered on.msg - message to encodepublic BarcodeDimension calcDimensions(String msg)
calcDimensions in interface BarcodeGeneratormsg - message to use for calculation.Copyright © 2003–2023. All rights reserved.