com.idautomation.datamatrix
Class DataMatrix

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Canvas
              |
              +--com.idautomation.datamatrix.DataMatrix
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

public class DataMatrix
extends java.awt.Canvas
implements java.io.Serializable

This is the main DataMatrix class that generates the DataMatrix barcode image.

See Also:
Serialized Form

Field Summary
 boolean autoSize
          If true will automatically size the control canvas to fit the barcode at design or runtime; Default =True.
 java.awt.Color backColor
          Background color.
 java.awt.Color barColor
          Color of the modules.
static int C104X104
           
static int C10X10
           
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
           
 java.lang.String code
          Data to be painted in a Data Matrix symbol.
 java.lang.String codeText
          Text to display after encoding.
 int dotPixels
           
static int E_ASCII
           
static int E_AUTO
           
static int E_BASE256
           
static int E_C40
           
static int E_NONE
           
static int E_TEXT
           
 int encoding
          The encoding mode; valid values are E_ASCII (default), E_C40, E_TEXT or E_BASE256.
 java.awt.Color fontColor
           
 double H
          Height of bars; This a multiplicator of X.
 int height
          Initial preferred height property of the bean
 double I
           
 double L
          Symbol lentgh in CM.
 int margin
           
 double marginCM
          Margin of the Barcode (also know as quite zone).
 double N
           
 int pHeight
          Preferred height of the image after it is generated
 int preferredFormat
          The preferred format represented by a number; valid values are from 0 (10X10) to 23 (144X144) and from 24 (8X18) to 29 (16X48); The default value is -1 which sets this to automatic; this is also documented in the user manual.
 boolean processTilde
          If true ("Y") the tilde (~) will be processed as explained in the Data Matrix user guide.
 int pWidth
          Preferred width of the image after it is generated
 boolean reBuild
           
 int resolution
          The resolution used to create the X dimension and other measurements in pixels; Default is 38 Pixels Per CM which is about 96 DPI.
 int rotate
          Rotation angle; valid values are 0 (default), 90, 180 & 270.
 java.awt.Font textFont
          Font of the text.
 int width
          Initial preferred width property of the bean
 double X
          The size in CM of modules, default is .06; usually adjustable in increments of .03CM because (X * resolution) is used to convert to pixels; use setPixelsPerCM to change; if X * resolution = < 1, X will be set to one pixel.
 
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
DataMatrix()
           
 
Method Summary
 boolean getAutoSize()
          If true will automatically size the control canvas to fit the barcode at design or runtime; Default =True.
 java.awt.Color getBackground()
           
 java.lang.String getDataToEncode()
           
 int getEncodingMode()
          Gets the encoding mode represented by a number; valid values are 0=E_ASCII (default), 1=E_C40, 2=E_TEXT or 3=E_BASE256.
 java.awt.Color getForeground()
          Gets the color of the modules.
 double getMarginCM()
           
 java.awt.Dimension getMinimumSize()
           
 int getPixelsPerCM()
           
 int getPreferredFormat()
          Gets the preferred format represented by a number.
 java.awt.Dimension getPreferredSize()
          Returns the size in pixels appropriate for the generated image after it is generated.
 boolean getProcessTilde()
           
 int getRotationAngle()
           
 double getXDimensionCM()
          Gets the size in CM of modules.
 void paint(java.awt.Graphics g2)
          Paints the barcode and rotates it if necessary
 void setAutoSize(boolean newVal)
          If true will automatically size the control canvas to fit the barcode at design or runtime; Default =True.
 void setBackground(java.awt.Color newColor)
          Background color.
 void setDataToEncode(java.lang.String newCode)
           
 void setEncodingMode(int newMode)
          Sets the encoding mode represented by a number; valid values are 0=E_ASCII (default), 1=E_C40, 2=E_TEXT or 3=E_BASE256.
 void setForeground(java.awt.Color newColor)
          Cets the color of the modules.
 void setMarginCM(double newMargin)
          Margin of the Barcode (also know as quite zone).
 void setPixelsPerCM(int newRes)
          Resolution used to convert from CM to pixels; Default is 38.
 void setPreferredFormat(int newFormat)
          Sets the preferred format represented by a number; valid values are from 0 (10X10) to 23 (144X144) and from 24 (8X18) to 29 (16X48); The default value is -1 which sets this to automatic; this is also documented in the user manual.
 void setProcessTilde(boolean newVal)
          If true ("Y") the tilde (~) will be processed as explained in the Data Matrix user guide.
 void setRotationAngle(int newRotate)
          Rotation angle; valid values are 0 (default), 90, 180 & 270.
 void setXDimensionCM(double newX)
          Sets the size in CM of modules, default is .06; usually adjustable in increments of .03CM because (X * resolution) is used to convert to pixels; use setPixelsPerCM to change; if X * resolution = < 1, X will be set to one pixel.
 
Methods inherited from class java.awt.Canvas
addNotify, getAccessibleContext
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, deliverEvent, disable, dispatchEvent, doLayout, enable, enable, enableInputMethods, getAlignmentX, getAlignmentY, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getGraphics, getGraphicsConfiguration, getHeight, getInputContext, getInputMethodRequests, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getName, getParent, getPeer, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, 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, print, printAll, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFont, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, update, validate
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

code

public java.lang.String code
Data to be painted in a Data Matrix symbol.

marginCM

public double marginCM
Margin of the Barcode (also know as quite zone). The default is .06 CM

backColor

public java.awt.Color backColor
Background color.

codeText

public java.lang.String codeText
Text to display after encoding.

resolution

public int resolution
The resolution used to create the X dimension and other measurements in pixels; Default is 38 Pixels Per CM which is about 96 DPI. 96 DPI is the resolution of the web browser; this setting works best when using the servlet. Enter 118 to create a 300 DPI image.

N

public double N

X

public double X
The size in CM of modules, default is .06; usually adjustable in increments of .03CM because (X * resolution) is used to convert to pixels; use setPixelsPerCM to change; if X * resolution = < 1, X will be set to one pixel.

width

public int width
Initial preferred width property of the bean

height

public int height
Initial preferred height property of the bean

pWidth

public int pWidth
Preferred width of the image after it is generated

pHeight

public int pHeight
Preferred height of the image after it is generated

autoSize

public boolean autoSize
If true will automatically size the control canvas to fit the barcode at design or runtime; Default =True.

textFont

public java.awt.Font textFont
Font of the text.

fontColor

public java.awt.Color fontColor

barColor

public java.awt.Color barColor
Color of the modules.

I

public double I

H

public double H
Height of bars; This a multiplicator of X. The default is 0.45.

L

public double L
Symbol lentgh in CM.

rotate

public int rotate
Rotation angle; valid values are 0 (default), 90, 180 & 270.

dotPixels

public int dotPixels

margin

public int margin

processTilde

public boolean processTilde
If true ("Y") the tilde (~) will be processed as explained in the Data Matrix user guide. If not it will be treated as a normal character; Default =False.

encoding

public int encoding
The encoding mode; valid values are E_ASCII (default), E_C40, E_TEXT or E_BASE256.

E_AUTO

public static int E_AUTO

E_ASCII

public static int E_ASCII

E_C40

public static int E_C40

E_TEXT

public static int E_TEXT

E_BASE256

public static int E_BASE256

E_NONE

public static int E_NONE

reBuild

public boolean reBuild

preferredFormat

public int preferredFormat
The preferred format represented by a number; valid values are from 0 (10X10) to 23 (144X144) and from 24 (8X18) to 29 (16X48); The default value is -1 which sets this to automatic; this is also documented in the user manual.

C10X10

public static final int C10X10

C12X12

public static final int C12X12

C14X14

public static final int C14X14

C16X16

public static final int C16X16

C18X18

public static final int C18X18

C20X20

public static final int C20X20

C22X22

public static final int C22X22

C24X24

public static final int C24X24

C26X26

public static final int C26X26

C32X32

public static final int C32X32

C36X36

public static final int C36X36

C40X40

public static final int C40X40

C44X44

public static final int C44X44

C48X48

public static final int C48X48

C52X52

public static final int C52X52

C64X64

public static final int C64X64

C72X72

public static final int C72X72

C80X80

public static final int C80X80

C88X88

public static final int C88X88

C96X96

public static final int C96X96

C104X104

public static final int C104X104

C120X120

public static final int C120X120

C132X132

public static final int C132X132

C144X144

public static final int C144X144

C8X18

public static final int C8X18

C8X32

public static final int C8X32

C12X26

public static final int C12X26

C12X36

public static final int C12X36

C16X36

public static final int C16X36

C16X48

public static final int C16X48
Constructor Detail

DataMatrix

public DataMatrix()
Method Detail

setDataToEncode

public void setDataToEncode(java.lang.String newCode)

getDataToEncode

public java.lang.String getDataToEncode()

setMarginCM

public void setMarginCM(double newMargin)
Margin of the Barcode (also know as quite zone). The default is .06 CM

getMarginCM

public double getMarginCM()

setBackground

public void setBackground(java.awt.Color newColor)
Background color.
Overrides:
setBackground in class java.awt.Component

getBackground

public java.awt.Color getBackground()
Overrides:
getBackground in class java.awt.Component

setPixelsPerCM

public void setPixelsPerCM(int newRes)
Resolution used to convert from CM to pixels; Default is 38.

getPixelsPerCM

public int getPixelsPerCM()

setXDimensionCM

public void setXDimensionCM(double newX)
Sets the size in CM of modules, default is .06; usually adjustable in increments of .03CM because (X * resolution) is used to convert to pixels; use setPixelsPerCM to change; if X * resolution = < 1, X will be set to one pixel.

getXDimensionCM

public double getXDimensionCM()
Gets the size in CM of modules.

setAutoSize

public void setAutoSize(boolean newVal)
If true will automatically size the control canvas to fit the barcode at design or runtime; Default =True.

getAutoSize

public boolean getAutoSize()
If true will automatically size the control canvas to fit the barcode at design or runtime; Default =True.

getPreferredSize

public java.awt.Dimension getPreferredSize()
Returns the size in pixels appropriate for the generated image after it is generated.
Overrides:
getPreferredSize in class java.awt.Component

getMinimumSize

public java.awt.Dimension getMinimumSize()
Overrides:
getMinimumSize in class java.awt.Component

setForeground

public void setForeground(java.awt.Color newColor)
Cets the color of the modules.
Overrides:
setForeground in class java.awt.Component

getForeground

public java.awt.Color getForeground()
Gets the color of the modules.
Overrides:
getForeground in class java.awt.Component

setRotationAngle

public void setRotationAngle(int newRotate)
Rotation angle; valid values are 0 (default), 90, 180 & 270.

getRotationAngle

public int getRotationAngle()

setProcessTilde

public void setProcessTilde(boolean newVal)
If true ("Y") the tilde (~) will be processed as explained in the Data Matrix user guide. If not it will be treated as a normal character; Default =False.

getProcessTilde

public boolean getProcessTilde()

setEncodingMode

public void setEncodingMode(int newMode)
Sets the encoding mode represented by a number; valid values are 0=E_ASCII (default), 1=E_C40, 2=E_TEXT or 3=E_BASE256.

getEncodingMode

public int getEncodingMode()
Gets the encoding mode represented by a number; valid values are 0=E_ASCII (default), 1=E_C40, 2=E_TEXT or 3=E_BASE256.

setPreferredFormat

public void setPreferredFormat(int newFormat)
Sets the preferred format represented by a number; valid values are from 0 (10X10) to 23 (144X144) and from 24 (8X18) to 29 (16X48); The default value is -1 which sets this to automatic; this is also documented in the user manual.

getPreferredFormat

public int getPreferredFormat()
Gets the preferred format represented by a number.

paint

public void paint(java.awt.Graphics g2)
Paints the barcode and rotates it if necessary
Overrides:
paint in class java.awt.Canvas