com.java4less.rbarcode
Class BarCodeFacade

java.lang.Object
  extended by com.java4less.rbarcode.BarCodeFacade
All Implemented Interfaces:
IBarcodeGenerator

public class BarCodeFacade
extends java.lang.Object
implements IBarcodeGenerator

helper class for creating barcodes with just one method. Used by webservices and plugins.


Constructor Summary
BarCodeFacade()
           
 
Method Summary
 void createBarcode(java.util.Properties properties)
          create barcode image from properties file
 void createBarcode(java.lang.String type, java.lang.String value, java.lang.String set, java.lang.String processTilde, java.lang.String text, int rotate, int barHeight, int X, int N, java.lang.String barColor, java.lang.String fontColor, java.lang.String backColor, java.lang.String textFont, int leftMargin, int topMargin, boolean checksum, java.util.Properties properties)
          genrate barcode
 void createBarcode(java.lang.String type, java.lang.String value, java.lang.String set, java.lang.String processTilde, java.lang.String text, int rotate, int barHeight, int X, int N, java.lang.String barColor, java.lang.String fontColor, java.lang.String backColor, java.lang.String textFont, int leftMargin, int topMargin, java.util.Properties properties)
           
 java.awt.Image createBarcodeImage(java.lang.String type, java.lang.String value, java.lang.String set, java.lang.String processTilde, java.lang.String text, int rotate, int barHeight, int X, int N, java.lang.String barColor, java.lang.String fontColor, java.lang.String backColor, java.lang.String textFont, int leftMargin, int topMargin, boolean generateCheckCharacter, java.util.Properties properties)
          genrate barcode
 java.awt.Image createBarcodeImage(java.lang.String type, java.lang.String value, java.lang.String set, java.lang.String processTilde, java.lang.String text, int rotate, int barHeight, int X, int N, java.lang.String barColor, java.lang.String fontColor, java.lang.String backColor, java.lang.String textFont, int leftMargin, int topMargin, java.util.Properties properties)
          genrate barcode
 java.awt.Image createImage()
          create image for the generated barcode
 BarCode getBarcode()
          return barcode object
 void paintBarcode(java.awt.Graphics g)
          paint barcode on external graphics
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BarCodeFacade

public BarCodeFacade()
Method Detail

getBarcode

public BarCode getBarcode()
return barcode object

Returns:

createBarcodeImage

public java.awt.Image createBarcodeImage(java.lang.String type,
                                         java.lang.String value,
                                         java.lang.String set,
                                         java.lang.String processTilde,
                                         java.lang.String text,
                                         int rotate,
                                         int barHeight,
                                         int X,
                                         int N,
                                         java.lang.String barColor,
                                         java.lang.String fontColor,
                                         java.lang.String backColor,
                                         java.lang.String textFont,
                                         int leftMargin,
                                         int topMargin,
                                         boolean generateCheckCharacter,
                                         java.util.Properties properties)
genrate barcode

Parameters:
type - type of barcode to create. Valid values are: BAR39, BAR38EXT, CODE128, CODE11, CODABAR,CODE93, CODE93EXT, MSI, IND25, MAT25, INTERLEAVED25, EAN13, EAN8, EAN128, UPCA, UPCE or POSTNET
value - value to be encoded
set - value A, B or C (for type CODE128 only)
processTilde - See http://www.java4less.com/barcodes/barcodes.php?info=guide
text - value to be displayed below the barcode
rotate - rotation of the barcode, currently only value 0 supported
barHeight - height of bars in pixels
X - width of narrow bars in pixels
N - multiplier for wide bars. A value of 2, means that wide bars will be 2 times the width of narrow bars. The default vaue is 2
barColor - Color of bars. Valid values are RED, BLACK, BLUE, CYAN, DARKGRAY, GRAY, GREEN, LIGHTGRAY, MAGENTA, PINK, WHITE or YELLOW. You can also use the RGB value.
fontColor - color of the text.
backColor - background color.
font - font of the text, for example "ARIAL|BOLD|10", the format is
leftMargin - margin in pixels
topMargin - margin in pixels
generateCheckCharacter -
properties - currently ignored, use null
Returns:

createBarcodeImage

public java.awt.Image createBarcodeImage(java.lang.String type,
                                         java.lang.String value,
                                         java.lang.String set,
                                         java.lang.String processTilde,
                                         java.lang.String text,
                                         int rotate,
                                         int barHeight,
                                         int X,
                                         int N,
                                         java.lang.String barColor,
                                         java.lang.String fontColor,
                                         java.lang.String backColor,
                                         java.lang.String textFont,
                                         int leftMargin,
                                         int topMargin,
                                         java.util.Properties properties)
genrate barcode

Parameters:
type - type of barcode to create. Valid values are: BAR39, BAR38EXT, CODE128, CODE11, CODABAR,CODE93, CODE93EXT, MSI, IND25, MAT25, INTERLEAVED25, EAN13, EAN8, EAN128, UPCA, UPCE or POSTNET
value - value to be encoded
set - value A, B or C (for type CODE128 only)
processTilde - See http://www.java4less.com/barcodes/barcodes.php?info=guide
text - value to be displayed below the barcode
rotate - rotation of the barcode, currently only value 0 supported
barHeight - height of bars in pixels
X - width of narrow bars in pixels
N - multiplier for wide bars. A value of 2, means that wide bars will be 2 times the width of narrow bars. The default vaue is 2
barColor - Color of bars. Valid values are RED, BLACK, BLUE, CYAN, DARKGRAY, GRAY, GREEN, LIGHTGRAY, MAGENTA, PINK, WHITE or YELLOW. You can also use the RGB value.
fontColor - color of the text.
backColor - background color.
font - font of the text, for example "ARIAL|BOLD|10", the format is
leftMargin - margin in pixels
topMargin - margin in pixels
properties - currently ignored, use null
Returns:

createBarcode

public void createBarcode(java.lang.String type,
                          java.lang.String value,
                          java.lang.String set,
                          java.lang.String processTilde,
                          java.lang.String text,
                          int rotate,
                          int barHeight,
                          int X,
                          int N,
                          java.lang.String barColor,
                          java.lang.String fontColor,
                          java.lang.String backColor,
                          java.lang.String textFont,
                          int leftMargin,
                          int topMargin,
                          java.util.Properties properties)

createBarcode

public void createBarcode(java.lang.String type,
                          java.lang.String value,
                          java.lang.String set,
                          java.lang.String processTilde,
                          java.lang.String text,
                          int rotate,
                          int barHeight,
                          int X,
                          int N,
                          java.lang.String barColor,
                          java.lang.String fontColor,
                          java.lang.String backColor,
                          java.lang.String textFont,
                          int leftMargin,
                          int topMargin,
                          boolean checksum,
                          java.util.Properties properties)
genrate barcode

Parameters:
type - BAR39, CODE128, EAN128, EAN8, EAN13, UPCA, UPCE etc ..
value -
set -
processTilde -
text -
rotate -
barHeight -
X -
N -
barColor -
fontColor -
backColor -
font -
leftMargin -
topMargin -
checksum -

createImage

public java.awt.Image createImage()
create image for the generated barcode

Specified by:
createImage in interface IBarcodeGenerator
Returns:

createBarcode

public void createBarcode(java.util.Properties properties)
create barcode image from properties file

Specified by:
createBarcode in interface IBarcodeGenerator

paintBarcode

public void paintBarcode(java.awt.Graphics g)
Description copied from interface: IBarcodeGenerator
paint barcode on external graphics

Specified by:
paintBarcode in interface IBarcodeGenerator