import net.sf.jasperreports.engine.JRStyle; //导入方法依赖的package包/类
protected void setBaseAttributes(Barcode4jComponent barcodeComponent)
{
JRStyle style = getElementStyle();
if (style != null)
{
String fontName = style.getFontName();
if (fontName != null)
{
barcodeBean.setFontName(fontName);
}
Float fontSize = style.getFontsize();
if (fontSize != null)
{
double barFontSize = UnitConv.pt2mm(fontSize.floatValue());
barcodeBean.setFontSize(barFontSize);
}
}
Double moduleWidth = barcodeComponent.getModuleWidth();
if (moduleWidth != null)
{
barcodeBean.setModuleWidth(UnitConv.pt2mm(moduleWidth.doubleValue()));
}
TextPositionEnum textPlacement = barcodeComponent.getTextPositionValue();
if (textPlacement != null)
{
barcodeBean.setMsgPosition(
HumanReadablePlacement.byName(textPlacement.getName()));
}
Double quietZone = barcodeComponent.getQuietZone();
if (quietZone != null)
{
barcodeBean.doQuietZone(true);
barcodeBean.setQuietZone(UnitConv.pt2mm(quietZone.doubleValue()));
}
Double vQuietZone = barcodeComponent.getVerticalQuietZone();
if (vQuietZone != null)
{
barcodeBean.setVerticalQuietZone(UnitConv.pt2mm(vQuietZone.doubleValue()));
}
// FIXME DataMatrix?
double barcodeHeight;
if (BarcodeUtils.isVertical(barcodeComponent))
{
barcodeHeight = UnitConv.pt2mm(componentElement.getWidth());
}
else
{
barcodeHeight = UnitConv.pt2mm(componentElement.getHeight());
}
barcodeBean.setHeight(barcodeHeight);
}