com.java4less.rdatamatrix
Class RDataMatrix

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Canvas
          extended by com.java4less.rbarcode.BarCode
              extended by com.java4less.rdatamatrix.RDataMatrix
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible
Direct Known Subclasses:
RDataMatrixBean

public class RDataMatrix
extends BarCode

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:

All sizes and formats (from 10x10 till 144x144)
Ascii, text , C40 and Base256 (for binary data) encoding.
The "Extended Channel Interpretation and Structured append
Configuration of colors and size of modules (points).

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

See Also:
Serialized Form

Field Summary
static int C104X104
           
static int C10X10
          C10x10 to C144x144 are the possible formats of the barcode (see Data Matrix Manual for more information about formats).
static int C120X120
           
static int C12X12
           
static int C12X26
           
static int C12X36
           
static int C132X132
           
static int C144X144
           
static int C14X14
           
static int C16X16
           
static int C16X36
           
static int C16X48
           
static int C18X18
           
static int C20X20
           
static int C22X22
           
static int C24X24
           
static int C26X26
           
static int C32X32
           
static int C36X36
           
static int C40X40
           
static int C44X44
           
static int C48X48
           
static int C52X52
           
static int C64X64
           
static int C72X72
           
static int C80X80
           
static int C88X88
           
static int C8X18
           
static int C8X32
           
static int C96X96
           
 byte[] codeBinary
          bytes for binary encoding
 int dotPixels
          Size in pixels of the square modules that made up the symbol.
static int E_ASCII
          ascii encoding (see Data Matrix Manual for more information ).
static int E_AUTO
          automatic encoding.
static int E_BASE256
          base 256 encoding.
static int E_C40
          c40 encoding (see Data Matrix Manual for more information ).
static int E_NONE
           
static int E_TEXT
          text encoding (see Data Matrix Manual for more information ).
 int encoding
          selects the encoding you want to use: E_AUTO, E_ASCII (default), E_C40, E_TEXT or E_BASE256.
 int margin
          margin in pixels of the symbol
 int preferredFormat
          if -1 (default) , the class wil automatically select the format of the symbol.
 boolean processTilde
          if true (default is false) the class will process the ~ character in the input data (see help file for more information ).
 boolean reBuild
          set this field to true if you want to redraw the symbol.
 
Fields inherited from class com.java4less.rbarcode.BarCode
backColor, BAR39, BAR39EXT, barColor, barHeightCM, barType, checkCharacter, CODABAR, CODABARStartChar, CODABARStopChar, code, CODE11, CODE128, Code128Set, CODE93, CODE93EXT, codeText, DATAMATRIX, EAN128, EAN13, EAN8, fontColor, guardBars, H, I, IND25, INTERLEAVED25, L, leftMarginCM, MAT25, MSI, MSI_CHECKSUM_10, MSI_CHECKSUM_10_10, MSI_CHECKSUM_11, MSI_CHECKSUM_11_10, MSIChecksum, N, PDF417, POSTNET, postnetHeightShortBar, postnetHeightTallBar, resolution, rotate, supHeight, supplement, supSeparationCM, textFont, textOnTop, topMarginCM, UPCA, UPCE, UPCEANSupplement2, UPCEANSupplement5, UPCESytem, X
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
RDataMatrix()
           
 
Method Summary
 int[][] getBarcodeAsArray()
          returns the barcode as an array where the values=0 are white dots and the values !=0 are black dots
 int getCalculatedFormat()
           
 int getPaintedHeight()
           
 int getPaintedWidth()
           
 
Methods inherited from class com.java4less.rbarcode.BarCode
getAiLen, getEAN128Text, getFixedFieldLen, getPaintedArea, paint, print
 
Methods inherited from class java.awt.Canvas
addNotify, createBufferStrategy, createBufferStrategy, getAccessibleContext, getBufferStrategy, update
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, dispatchEvent, doLayout, enable, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, preferredSize, prepareImage, prepareImage, printAll, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, validate
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

dotPixels

public int dotPixels
Size in pixels of the square modules that made up the symbol.


margin

public int margin
margin in pixels of the symbol


processTilde

public boolean processTilde
if true (default is false) the class will process the ~ character in the input data (see help file for more information ).


reBuild

public boolean reBuild
set this field to true if you want to redraw the symbol.


codeBinary

public byte[] codeBinary
bytes for binary encoding


C10X10

public static final int C10X10
C10x10 to C144x144 are the possible formats of the barcode (see Data Matrix Manual for more information about formats). C104 x C104 means that the size of the symbol will be 104 x104 square modules.

See Also:
Constant Field Values

C12X12

public static final int C12X12
See Also:
Constant Field Values

C14X14

public static final int C14X14
See Also:
Constant Field Values

C16X16

public static final int C16X16
See Also:
Constant Field Values

C18X18

public static final int C18X18
See Also:
Constant Field Values

C20X20

public static final int C20X20
See Also:
Constant Field Values

C22X22

public static final int C22X22
See Also:
Constant Field Values

C24X24

public static final int C24X24
See Also:
Constant Field Values

C26X26

public static final int C26X26
See Also:
Constant Field Values

C32X32

public static final int C32X32
See Also:
Constant Field Values

C36X36

public static final int C36X36
See Also:
Constant Field Values

C40X40

public static final int C40X40
See Also:
Constant Field Values

C44X44

public static final int C44X44
See Also:
Constant Field Values

C48X48

public static final int C48X48
See Also:
Constant Field Values

C52X52

public static final int C52X52
See Also:
Constant Field Values

C64X64

public static final int C64X64
See Also:
Constant Field Values

C72X72

public static final int C72X72
See Also:
Constant Field Values

C80X80

public static final int C80X80
See Also:
Constant Field Values

C88X88

public static final int C88X88
See Also:
Constant Field Values

C96X96

public static final int C96X96
See Also:
Constant Field Values

C104X104

public static final int C104X104
See Also:
Constant Field Values

C120X120

public static final int C120X120
See Also:
Constant Field Values

C132X132

public static final int C132X132
See Also:
Constant Field Values

C144X144

public static final int C144X144
See Also:
Constant Field Values

C8X18

public static final int C8X18
See Also:
Constant Field Values

C8X32

public static final int C8X32
See Also:
Constant Field Values

C12X26

public static final int C12X26
See Also:
Constant Field Values

C12X36

public static final int C12X36
See Also:
Constant Field Values

C16X36

public static final int C16X36
See Also:
Constant Field Values

C16X48

public static final int C16X48
See Also:
Constant Field Values

encoding

public int encoding
selects the encoding you want to use: E_AUTO, E_ASCII (default), E_C40, E_TEXT or E_BASE256.


E_ASCII

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).


E_C40

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.


E_TEXT

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.


E_BASE256

public static int E_BASE256
base 256 encoding. This is mainly used for binary data.


E_NONE

public static int E_NONE

E_AUTO

public static int E_AUTO
automatic encoding. The class decides dinamically which encoding is more apporpiate for the data you want to encode.


preferredFormat

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).

Constructor Detail

RDataMatrix

public RDataMatrix()
Method Detail

getCalculatedFormat

public int getCalculatedFormat()

getPaintedWidth

public int getPaintedWidth()

getPaintedHeight

public int getPaintedHeight()

getBarcodeAsArray

public int[][] getBarcodeAsArray()
returns the barcode as an array where the values=0 are white dots and the values !=0 are black dots

Returns: