本文整理汇总了Java中org.krysalis.barcode4j.impl.postnet.POSTNETBean类的典型用法代码示例。如果您正苦于以下问题:Java POSTNETBean类的具体用法?Java POSTNETBean怎么用?Java POSTNETBean使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
POSTNETBean类属于org.krysalis.barcode4j.impl.postnet包,在下文中一共展示了POSTNETBean类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testDefaultsInXML
import org.krysalis.barcode4j.impl.postnet.POSTNETBean; //导入依赖的package包/类
public void testDefaultsInXML() throws Exception {
POSTNETBean refBean = new POSTNETBean();
POSTNET gen = new POSTNET();
DefaultConfiguration cfg = new DefaultConfiguration("postnet");
gen.configure(cfg);
POSTNETBean xmlBean = gen.getPOSTNETBean();
assertEquals(refBean.getBarHeight(), xmlBean.getBarHeight(), 0.01);
assertEquals(refBean.getBaselinePosition(), xmlBean.getBaselinePosition());
assertEquals(refBean.getChecksumMode(), xmlBean.getChecksumMode());
assertEquals(refBean.isDisplayChecksum(), xmlBean.isDisplayChecksum());
assertEquals(refBean.getFontSize(), xmlBean.getFontSize(), 0.01);
assertEquals(refBean.getHeight(), xmlBean.getHeight(), 0.01);
assertEquals(refBean.getHumanReadableHeight(), xmlBean.getHumanReadableHeight(), 0.01);
assertEquals(refBean.getIntercharGapWidth(), xmlBean.getIntercharGapWidth(), 0.01);
assertEquals(refBean.getModuleWidth(), xmlBean.getModuleWidth(), 0.01);
assertEquals(refBean.getQuietZone(), xmlBean.getQuietZone(), 0.01);
assertEquals(refBean.getShortBarHeight(), xmlBean.getShortBarHeight(), 0.01);
assertEquals(refBean.getVerticalQuietZone(), xmlBean.getVerticalQuietZone(), 0.01);
assertEquals(refBean.hasQuietZone(), xmlBean.hasQuietZone());
assertEquals(refBean.getChecksumMode(), xmlBean.getChecksumMode());
assertEquals(refBean.getMsgPosition(), xmlBean.getMsgPosition());
assertEquals(refBean.getPattern(), xmlBean.getPattern());
}
示例2: BarcodeRenderer
import org.krysalis.barcode4j.impl.postnet.POSTNETBean; //导入依赖的package包/类
public BarcodeRenderer(BarcodeType barcodeType, String code) {
switch (barcodeType) {
case CODE128 : this.barcode = new Code128Bean(); break;
case CODABAR : this.barcode = new CodabarBean(); break;
case CODE39 : this.barcode = new Code39Bean(); break;
case EAN128 : this.barcode = new EAN128Bean(); break;
case DATAMATRIX : this.barcode = new DataMatrixBean(); break;
case INT2OF5 : this.barcode = new Interleaved2Of5Bean(); break;
case PDF417 : this.barcode = new PDF417Bean(); break;
case POSTNET : this.barcode = new POSTNETBean(); break;
case EAN13 : this.barcode = new EAN13Bean(); break;
case EAN8 : this.barcode = new EAN8Bean(); break;
case UPCA : this.barcode = new UPCABean(); break;
case UPCE : this.barcode = new UPCEBean(); break;
case ROYAL_MAIL_CBC : this.barcode = new RoyalMailCBCBean(); break;
case USPS_INTELLIGENT_MAIL : this.barcode = new USPSIntelligentMailBean(); break;
}
this.code = code;
}
示例3: visitPostnet
import org.krysalis.barcode4j.impl.postnet.POSTNETBean; //导入依赖的package包/类
@Override
public void visitPostnet(POSTNETComponent postnet)
{
POSTNETBean postnetBean = new POSTNETBean();
barcodeBean = postnetBean;
evaluatePOSTNET(postnet);
setBaseAttributes(postnet);
if (postnet.getShortBarHeight() != null)
{
postnetBean.setShortBarHeight(
UnitConv.pt2mm(postnet.getShortBarHeight().doubleValue()));
}
if (postnet.getBaselinePosition() != null)
{
postnetBean.setBaselinePosition(
BaselineAlignment.byName(postnet.getBaselinePosition()));
}
if (postnet.getChecksumMode() != null)
{
postnetBean.setChecksumMode(
ChecksumMode.byName(postnet.getChecksumMode()));
}
if (postnet.getDisplayChecksum() != null)
{
postnetBean.setDisplayChecksum(
postnet.getDisplayChecksum().booleanValue());
}
if (postnet.getIntercharGapWidth() != null)
{
postnetBean.setIntercharGapWidth(
UnitConv.pt2mm(postnet.getIntercharGapWidth().doubleValue()));
}
evaluateBarcodeRenderable(postnet);
}
示例4: postnet
import org.krysalis.barcode4j.impl.postnet.POSTNETBean; //导入依赖的package包/类
public static AbstractBarcodeBean postnet(Checksum checksum,
boolean displayChecksum, TextPlacement placement) {
POSTNETBean result = new POSTNETBean();
result.setChecksumMode(getChecksum(checksum));
result.setDisplayChecksum(displayChecksum);
result.setMsgPosition(getPlacement(placement));
return result;
}
示例5: getBarcodePOSTNET
import org.krysalis.barcode4j.impl.postnet.POSTNETBean; //导入依赖的package包/类
public static Image getBarcodePOSTNET(String value) {
AbstractBarcodeBean barcode = new POSTNETBean();
barcode.setMsgPosition(HumanReadablePlacement.HRP_BOTTOM);
return getBarcode(value, barcode);
}
示例6: getBarcodePOSTNET
import org.krysalis.barcode4j.impl.postnet.POSTNETBean; //导入依赖的package包/类
/**
*
* @param value
* @return
*/
public static Image getBarcodePOSTNET(String value) {
AbstractBarcodeBean barcode = new POSTNETBean();
barcode.setMsgPosition(HumanReadablePlacement.HRP_BOTTOM);
return getBarcode(value, barcode);
}