All Packages Class Hierarchy This Package Previous Next Index
java.lang.Object | +----java.awt.Component | +----java.awt.Canvas | +----MSBBarCode.BarCode | +----MSBBarCode.RDataMatrix
The class RDataMatrix is a subclass of BarCode (which is a subclass of java.awt.Canvas) that creates data matrix barcode symbols. Data Matrix is a two-dimensional (2D) matrix symbology which is made up of square modules arranged within a perimeter finder pattern. It can encode up to 3116 characters from the entire 256 byte ASCII character set and it supports advanced encoding error checking and correction algorithms (reed-solomon). This algorithms allow the recognition of barcodes that are up to 60% damaged.
Other features are:
The following example illustrates how to create a bar code:
RDataMatrix cb=new RDataMatrix();
cb.dotPixels=4; // set size of the square modules, in pixels
cb.encoding=cb.E_AUTO; // set type of encoding
cb.barColor=java.awt.Color.red; // set color of bacode
cb.code="This is a test";
myForm.add(cb); // add the barcode to your form or container
This documents only describes de fields of the class. You are recommended to read Data Matrix Manual for further information.
public int dotPixels
Size in pixels of the square modules that made up the symbol.
public int margin
margin in pixels of the symbol
public boolean processTilde
if true (default is false) the class will process the ~ character in the input data (see Data Matrix Manual for more information ).
public static final int C10X10
public static final int C12X12
public static final int C14X14
public static final int C16X16
public static final int C18X18
public static final int C20X20
public static final int C22X22
public static final int C24X24
public static final int C26X26
public static final int C32X32
public static final int C36X36
public static final int C40X40
public static final int C44X44
public static final int C48X48
public static final int C52X52
public static final int C64X64
public static final int C72X72
public static final int C80X80
public static final int C88X88
public static final int C96X96
public static final int C104X104
public static final int C120X120
public static final int C132X132
public static final int C144X144
public static final int C8X18
public static final int C8X32
public static final int C12X26
public static final int C12X36
public static final int C16X36
public static final int C16X48
public int encoding
selects the encoding you want to use: E_AUTO, E_ASCII (default), E_C40, E_TEXT or E_BASE256.
public static int E_ASCII
ascii encoding (see Data Matrix Manual for more information ). This is appropiate for data that contains mainly ascii characters (1-127).
public static int E_C40
c40 encoding (see Data Matrix Manual for more information ). This is appropiate for data that contains mainly upper case characters and digits.
public static int E_TEXT
text encoding (see Data Matrix Manual for more information ). This is appropiate for data that contains mainly lower case characters and digits.
public static int E_BASE256
base 256 encoding. This is mainly used for binary data.
public static int E_NONE
no encoding. You are responsible for encoding the data.
public static int E_AUTO
automatic encoding. The class decides dinamically which encoding is more apporpiate for the data you want to encode.
public int preferredFormat
if -1 (default) , the class wil automatically select the format of the symbol. Otherwise you must specify a value (C10X10 till C144X144).
public boolean reBuild
set this field to true if you want to redraw the symbol.
public RDataMatrix()
protected void paintBasis(Graphics g)
paints the barcode in the specified graphic context.
All Packages Class Hierarchy This Package Previous Next Index