diff --git a/JasperReports/src/org/compiere/report/Barbecue.java b/JasperReports/src/org/compiere/report/Barbecue.java index 0bbbb15809..1ca9aa9249 100644 --- a/JasperReports/src/org/compiere/report/Barbecue.java +++ b/JasperReports/src/org/compiere/report/Barbecue.java @@ -1,46 +1,34 @@ package org.compiere.report; -import java.awt.Color; import java.awt.Graphics2D; -import java.awt.geom.Dimension2D; import java.awt.geom.Rectangle2D; -import java.awt.image.BufferedImage; -import net.sf.jasperreports.engine.JRException; -import net.sf.jasperreports.engine.JRRenderable; -import net.sf.jasperreports.engine.util.JRImageLoader; +import net.sf.jasperreports.engine.JRAbstractSvgRenderer; import net.sourceforge.barbecue.Barcode; -import net.sourceforge.barbecue.BarcodeImageHandler; -public abstract class Barbecue implements JRRenderable +public class Barbecue extends JRAbstractSvgRenderer { private static final long serialVersionUID = 5112469398754718739L; private Barcode m_barcode = null; - - public byte getType() - { - return TYPE_SVG; - } - - - public Dimension2D getDimension() - { - return m_barcode.getSize(); - } - - - public Color getBackcolor() - { - return null; - } - public Barbecue (Barcode barcode) { m_barcode = barcode; } + /** + * Convenience method for creating a barcode renderer with the option of + * + * + * @param barcode The barcode + * @param showDrawingText If the alphanumeric text should be visible below the barcode + */ + public Barbecue (Barcode barcode, boolean showDrawingText) { + m_barcode = barcode; + m_barcode.setDrawingText(showDrawingText); + } + public void render(Graphics2D grx, Rectangle2D rectangle) { try @@ -54,20 +42,4 @@ public abstract class Barbecue implements JRRenderable } - public byte[] getImageData() throws JRException - { - try - { - BufferedImage bi = BarcodeImageHandler.getImage(m_barcode); - return JRImageLoader.loadImageDataFromAWTImage(bi); - - } - catch (Exception e) - { - return null; - // TODO implement exception handling - } - - } - }