Package net.sourceforge.barbecue

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


        (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

{

  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

      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

    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

      }
      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

      {
        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

    final Object value = e.getElementType().getValue(new DebugExpressionRuntime(), e);
    assertTrue(value instanceof BarcodeWrapper);
    final BarcodeWrapper w = (BarcodeWrapper) value;
    w.setStyleSheet(e.getStyle());
    final Barcode barcode = w.getBarcode();
    final Field barWidth = Barcode.class.getDeclaredField("barWidth");
    barWidth.setAccessible(true);
    final Field barHeight = Barcode.class.getDeclaredField("barHeight");
    barHeight.setAccessible(true);
    assertEquals(1, barWidth.get(barcode));
View Full Code Here

        panel.setBounds(x, y, tekEtiketGen, tekEtiketYuks);
        panel.setLayout(null);
        Rectangle barkodPanelBounds = etiket.getBounds();
        if (barkodPanelBounds != null) {
          Rectangle barkodBounds = etiket.getBarkod().getBounds();
          Barcode barkod = null;

          try {
            if (barkodUrun != null) {
              barkod = BarcodeFactory.createCode39(barkodUrun,
                  false);
            } else {
              barkod = BarcodeFactory.createCode39("123456789",
                  false);
            }

          } catch (BarcodeException e) {

            e.printStackTrace();
          }

          barkod.setSize(barkodBounds.getSize());
          barkod.setBarHeight(20);
          barkod.setBarWidth(1);
          barkod.setFont(new Font("Times New Roman", Font.BOLD, 13));
          JPanel barkodPanel = new JPanel();
          barkodPanel.setBackground(Color.white);
          barkodPanel.setLayout(null);
          barkodPanel.setBounds(barkodPanelBounds);
View Full Code Here

      image.setWidth(width);
      image.setHeight(height);
        try {
            image.setScaleImage(JRImage.SCALE_IMAGE_FILL_FRAME);
           
            Barcode barcode = BarcodeFactory.createCode128(code);
            barcode.setDrawingText(false);
                image.setRenderer(
                        JRImageRenderer.getInstance(JRImageLoader.loadImageDataFromAWTImage(BarcodeImageHandler.getImage(barcode))
                        )
                );
        } catch (BarcodeException e) {
View Full Code Here

TOP

Related Classes of net.sourceforge.barbecue.Barcode

Copyright © 2018 www.massapicom. 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.