|
barcode4j 2.1.0 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.krysalis.barcode4j.impl.AbstractBarcodeBean
public abstract class AbstractBarcodeBean
Base class for most barcode implementations.
Field Summary | |
---|---|
protected boolean |
doQuietZone
True if quiet zone should be rendered |
protected java.lang.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 java.lang.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 java.lang.Double |
quietZoneVertical
Height of the vertical quiet zone above and below the barcode in mm |
Constructor Summary | |
---|---|
AbstractBarcodeBean()
|
Method Summary | |
---|---|
BarcodeDimension |
calcDimensions(java.lang.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,
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. |
abstract double |
getBarWidth(int width)
Returns the effective width of a bar with a given logical width. |
java.lang.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. |
java.lang.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(java.lang.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(java.lang.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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected double height
protected double moduleWidth
protected HumanReadablePlacement msgPos
protected double fontSize
protected java.lang.String fontName
protected boolean doQuietZone
protected double quietZone
protected java.lang.Double quietZoneVertical
protected java.lang.String pattern
Constructor Detail |
---|
public AbstractBarcodeBean()
Method Detail |
---|
public java.lang.String getPattern()
public void setPattern(java.lang.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 java.lang.String getFontName()
public void setFontName(java.lang.String name)
name
- the font namepublic abstract void generateBarcode(CanvasProvider canvas, java.lang.String msg)
generateBarcode
in interface BarcodeGenerator
canvas
- CanvasProvider that the barcode is to be rendered on.msg
- message to encodepublic BarcodeDimension calcDimensions(java.lang.String msg)
calcDimensions
in interface BarcodeGenerator
msg
- message to use for calculation.
|
barcode4j 2.1.0 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |