Examples of Barcode


Examples of it.stefanobertini.zebra.cpcl.labelmode.Barcode

    }

    @Test
    public void test2() {

  Barcode command = new Barcode(Orientation.vertical, BarcodeType.Code128, BarcodeRatio.RATIO_1D5_TO_1__0, 2, 150, new Position(110, 210), "VERT.");

  CommandOutputBuilder output = new CommandOutputBuilder();
  output.printLn("VBARCODE 128 2 0 150 110 210 VERT.");

  assertCommand(output, command);
View Full Code Here

Examples of it.stefanobertini.zebra.cpcl.labelmode.Barcode

    }

    @Test
    public void test3() {

  Barcode command = new Barcode(BarcodeType.Code128, BarcodeRatio.RATIO_2D0_TO_1__1, 1, 50, new Position(150, 10), "HORIZ.", new Font("4", 0), 10);

  CommandOutputBuilder output = new CommandOutputBuilder();
  output.printLn("BARCODE-TEXT 4 0 10");
  output.printLn("BARCODE 128 1 1 50 150 10 HORIZ.");
  output.printLn("BARCODE-TEXT OFF");
View Full Code Here

Examples of it.stefanobertini.zebra.cpcl.linemode.Barcode

public class BarcodeTest {

    @Test
    public void test() {

  Barcode command = new Barcode(BarcodeType.Code128, BarcodeRatio.RATIO_2D0_TO_1__1, 1, 50, "HORIZ.");

  CommandOutputBuilder output = new CommandOutputBuilder();
  output.printLn("! U1 BARCODE 128 1 1 50 0 0 HORIZ.");

  assertCommand(output, command);
View Full Code Here

Examples of net.sourceforge.barbecue.Barcode

    {
      logger.info("No type supplied to barcode element.");
      return null;
    }

    final Barcode barcode = SimpleBarcodesUtility.createBarcode(data, ltype, checksum);
    if (barcode == null)
    {
      return null;
    }
    barcode.setDrawingText(showText);
    barcode.setBarWidth(barWidth);
    barcode.setBarHeight(barHeight);
    return new BarcodeWrapper(barcode);
  }
View Full Code Here

Examples of net.sourceforge.barbecue.Barcode

        (element, SimpleBarcodesModule.NAMESPACE, "show-text", true);
    final boolean checksum = ElementTypeUtils.getBooleanAttribute
        (element, SimpleBarcodesAttributeNames.NAMESPACE, SimpleBarcodesAttributeNames.CHECKSUM_ATTRIBUTE, true);

    // create barcde and set its properties
    final Barcode barcode = SimpleBarcodesUtility.createBarcode(value.toString(), type, checksum);
    if (barcode == null)
    {
      final Object nullValue = element.getAttribute(AttributeNames.Core.NAMESPACE, AttributeNames.Core.NULL_VALUE);
      return filter(runtime, element, nullValue);
    }
    barcode.setBackground(backgroundColor);
    barcode.setForeground(color);
    barcode.setDrawingText(showText);
    barcode.setBarWidth(barWidth);
    barcode.setBarHeight(barHeight);
    barcode.setOpaque(backgroundColor.getAlpha() == 255);
    return new BarcodeWrapper(barcode);
  }
View Full Code Here

Examples of net.sourceforge.barbecue.Barcode

{

  public Barcode createBarcode(BarcodeInfo barcodeInfo)
      throws BarcodeException
  {
    Barcode barcode = createBaseBarcode(barcodeInfo);
    barcode.setDrawingText(barcodeInfo.isDrawText());
    if (barcodeInfo.getBarWidth() != null)
    {
      barcode.setBarWidth(barcodeInfo.getBarWidth().intValue());
    }
    if (barcodeInfo.getBarHeight() != null)
    {
      barcode.setBarHeight(barcodeInfo.getBarHeight().intValue());
    }
    return barcode;
  }
View Full Code Here

Examples of net.sourceforge.barbecue.Barcode

      barcodeInfo.setDrawText(component.isDrawText());
      barcodeInfo.setRequiresChecksum(component.isChecksumRequired());
      barcodeInfo.setBarWidth(component.getBarWidth());
      barcodeInfo.setBarHeight(component.getBarHeight());
     
      Barcode barcode = BarcodeProviders.createBarcode(barcodeInfo);
      BarbecueRenderer renderer = new BarbecueRenderer(barcode);
      renderer.setRotation(BarbecueStyleResolver.getRotationValue(element));
      image.setRenderer(renderer);
      return image;
    }
View Full Code Here

Examples of net.sourceforge.barbecue.Barcode

    barcodeInfo.setDrawText(barcodeComponent.isDrawText());
    barcodeInfo.setRequiresChecksum(barcodeComponent.isChecksumRequired());
    barcodeInfo.setBarWidth(barcodeComponent.getBarWidth());
    barcodeInfo.setBarHeight(barcodeComponent.getBarHeight());
   
    Barcode barcode = BarcodeProviders.createBarcode(barcodeInfo);
    BarbecueRenderer renderer = new BarbecueRenderer(barcode);
    renderer.setRotation(BarbecueStyleResolver.getRotationValue(fillContext.getComponentElement()));
   
    image.setRenderer(renderer);
  }
View Full Code Here

Examples of net.sourceforge.barbecue.Barcode

      }
      return null;
    }


    final Barcode barcode = SimpleBarcodesUtility.createBarcode(data, ltype, checksum);
    if (barcode == null)
    {
      return null;
    }
    barcode.setDrawingText(showText);
    barcode.setBarWidth(barWidth);
    barcode.setBarHeight(barHeight);
    return new BarcodeWrapper(barcode);
  }
View Full Code Here

Examples of net.sourceforge.barbecue.Barcode

      {
        return new BarcodeDrawable(generator, value.toString());
      }

      // create barcde and set its properties
      final Barcode barcode = SimpleBarcodesUtility.createBarcode(value.toString(), type, checksum);
      if (barcode == null)
      {
        final Object nullValue = element.getAttribute(AttributeNames.Core.NAMESPACE, AttributeNames.Core.NULL_VALUE);
        return filter(runtime, element, nullValue);
      }
      barcode.setDrawingText(showText);
      if (barWidth != null)
      {
        barcode.setBarWidth(barWidth.intValue());
      }
      else
      {
        barcode.setBarWidth(1);
      }
      if (barHeight != null)
      {
        barcode.setBarHeight(barHeight.intValue());
      }
      else
      {
        barcode.setBarHeight(18);
      }
      barcode.setDrawingText(showText);
      return new BarcodeWrapper(barcode);
    }
    catch (Exception e)
    {
      if (logger.isInfoEnabled())
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.