com.idautomation.linear
Class BarCode

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Canvas
          extended bycom.idautomation.linear.BarCode
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

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

This is the main class that contains all linear barcode functionality. Please see our User Manual for complete details of barcode related properties.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class java.awt.Canvas
java.awt.Canvas.AccessibleAWTCanvas
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
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
          The color of the bars in the barcode; Default=black.
 double barHeightCM
          Bar height in CM; If 0 it will be calculated using H; Default=1.
protected  int barHeightPixels
           
 int barType
          This is the symbology of barcode.
 boolean checkCharacter
          If true, the checksum character will be calculated and appended to the code; Default =True; checksum characters cannot be displayed or disabled for Code 128 and UCC128.
 boolean checkCharacterInText
          If true, the checksum character will be appended to the human readable text; Default =True; checksum characters cannot by displayed or disabled for Code 128 and UCC128.
static int CODABAR
           
 char CODABARStartChar
          The start character for CODABAR; The default is A.
 char CODABARStopChar
          The stop character for CODABAR; The default is B.
 java.lang.String code
          The data to be encoded as a barcode.
static int CODE11
           
static int CODE128
           
 char Code128Set
          The character set to be used in code 128; Possible values are "0 for AUTO", "A", "B" or "C"; The recommended setting and the default is "0" (Automatic).
static int CODE39
           
static int CODE39EXT
           
static int CODE93
           
static int CODE93EXT
           
 java.lang.String codeText
          The text of the barcode after it is created.
protected  int currentX
          The current position of the painting cursor.
protected  int currentXStart
           
protected  int currentY
           
protected static int d
           
static int EAN13
           
static int EAN8
           
 double fBearerBarHori
          The value of the horizontal bearer bar.
 double fBearerBarVert
          The value of the vertical bearer bar.
 java.awt.Color fontColor
          The color of the humam readable text; Default=black.
 boolean guardBars
          If true, (default), guardbars in EAN and UPC codes will be longer than data bars.
 double H
          The height of bars in the barcode as a multiple of X; The default is 0.45.
 int height
          Initial preferred height property of the bean
protected  int hrLeftMarginPixels
           
 double I
          The space between 2 characters in code 39; This a multiple of X; The default is 1.;
static int IND25
           
static int INTELLIGENTMAIL
           
static int INTERLEAVED25
           
 double L
          The symbol length in CM.
 double leftMarginCM
          The left margin of the barcode (also know as quiet zone); The default is .3 CM.
protected  int leftMarginPixels
           
static int MAT25
           
static int MSI
           
 double N
          The wide to narrow ratio of barcode types that support this setting such as Code 39 and ITF; A value of 2 (default) means that wide bars will be 2*N in width.
protected  double narrowBarCM
           
protected  int narrowBarPixels
           
 int pHeight
          The preferred height of the barcode image in pixels after barcode is generated.
static int PLANET
           
static int POSTNET
           
 double postnetHeightShortBar
          Height in CM of POSTNET's short bars; The default is 0.125
 double postnetHeightTallBar
          Height in CM of POSTNET's tall bars; The default is 0.3
 boolean processTilde
          If true, numbers after the Tilde will be processed according to the rules in the user guide; this option is only available when the symbology is Code 128, and the character set is AUTO or 0.
 int pWidth
          The preferred width of the barcode image in pixels after barcode is generated.
 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
          The rotation angle; Valid values are 0 (default), 90, 180 & 270.
 boolean showText
          If true, the human readable text will be displayed with the barcode; Default =true.
 double supHeight
          Height of the supplement; This is a multiplicator of the height of the code; The default is 0.8 (80%).
 java.lang.String supplement
          This is the user defined 2 or 5 digit supplement for EAN or UPC codes.
 double supSeparationCM
          The separation in CM between the barcode and the supplement
 java.awt.Font textFont
          The font of the text in the barcode; Default = Arial.
 double textMarginCM
          The amount of space in CM between the barcode and the human readable text.
 double topMarginCM
          The top margin of the barcode (also know as quiet zone); The default is .2 CM
protected  int topMarginPixels
           
static int UCC128
           
static int UPCA
           
static int UPCE
           
 boolean UPCEANSupplement2
          If true, the 2 digit supplement for EAN or UPC codes is processed.
 boolean UPCEANSupplement5
          If true, the 5 digit supplement for EAN or UPC codes is processed.
 char UPCESystem
          The system to be used in UPCE; It can be "0", "1" or "2"(Auto); The default is "0".
 int ValSpliceText
          The number of digits to group together in the human readable text.
 float WhiteBarIncrease
          The percent of the XDimension to increase the white bars.
 int width
          Initial preferred width property of the bean
protected  double widthBarCM
           
protected  int widthBarPixels
           
 double X
          The size in CM of modules (narrow bars or spaces); The resolution is used to convert to pixels.
 
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
BarCode()
           
 
Method Summary
protected  void addBar(java.awt.Graphics g, int w, boolean black, int bartopmargin, boolean doPaint)
          adds a bar to the bar code at the currentX position.
protected  void calculateSizes()
          calculates L and converts size in CM to pixels
protected  void DemoDraw(java.awt.Graphics g, int demoX, int ybuf, int DemoTextH)
           
protected  void DrawBearerBars(java.awt.Graphics g, int bartopmargin, int bcwBB)
           
protected  int findChar(java.lang.String[][] table, java.lang.String c)
          find a char in a charset table
 boolean getAutoSize()
          Gets the autoSize property value.
 java.awt.Color getBackground()
          Gets the backColor property.
 double getBarHeightCM()
          Gets the barHeightCM property.
 double getBearerBarHorizontal()
          Gets the PropBearerBarHori property.
 double getBearerBarVertical()
          Gets the PropBearerBarVert property.
 int getCharacterGrouping()
          Gets the ValSpliceText property.
 boolean getCheckCharacter()
          Gets the checkCharacter property.
 boolean getCheckCharacterInText()
          Gets the checkCharacterInText property.
 java.lang.String getCODABARStartChar()
          Gets the CODABARStartChar property value.
 java.lang.String getCODABARStopChar()
          Gets the CODABARStopChar property value.
 java.lang.String getCode128Set()
          Gets the Code128Set property.
 java.lang.String getDataToEncode()
          Gets the code property.
 java.awt.Font getFont()
          Gets the textFont property value.
 java.awt.Color getForeground()
          Gets the barColor property value.
 double getLeftMarginCM()
          Gets the leftMarginCM property.
 java.awt.Dimension getMinimumSize()
          Gets the minimum size in pixels of the barcode image generated.
 double getNarrowToWideRatio()
          Gets the N property.
 int getPixelsPerCM()
          Gets the resolution property.
 double getPostnetHeightShort()
          Gets the postnetHeightShortBar property.
 double getPostnetHeightTall()
          Gets the postnetHeightTallBar property.
 java.awt.Dimension getPreferredSize()
          Gets the size in pixels of the Preferred barcode image generated.
 boolean getProcessTilde()
          Gets the processTilde property.
 int getRotationAngle()
          Gets the rotate property.
 boolean getShowText()
          Gets the showText property value.
 java.lang.String getSupplementToEncode()
          Gets the supplement property.
 int getSymbologyID()
          Gets the barType property.
 java.awt.Color getTextFontColor()
          Gets the fontColor property value.
 double getTextMarginCM()
          Gets the textMarginCM property value
 double getTopMarginCM()
          Gets the topMarginCM property.
 boolean getUPCEANSupplement2()
          Gets the UPCEANSupplement2 property value.
 boolean getUPCEANSupplement5()
          Gets the UPCEANSupplement5 property.
 java.lang.String getUPCESystem()
          Gets the UPCESystem property value.
 float getWhiteBarIncrease()
          Gets the WhiteBarIncrease property.
 double getXDimensionCM()
          Gets the X property.
protected  boolean isDigit(char n)
           
protected static double mod(double a, double b)
           
 void paint(java.awt.Graphics g2)
          paints the barcode and rotates it if necessary
protected  void paintBAR93(java.awt.Graphics g, boolean doPaint)
          paints a code 93 barcode
protected  void paintBAR93Ext(java.awt.Graphics g, boolean doPaint)
          paints a code 93 extended barcode
protected  void paintBasis(java.awt.Graphics g)
          paints the barcode
protected  void paintChar(java.awt.Graphics g, java.lang.String patternColor, java.lang.String patternBars, boolean doPaint)
          paints a character
protected  void paintChar2(java.awt.Graphics g, java.lang.String patternColor, java.lang.String patternBars, int bartopmargin, boolean doPaint)
          paints a character
protected  void paintCODABAR(java.awt.Graphics g, boolean doPaint)
          paints a CODABAR code
protected  void paintCODE11(java.awt.Graphics g, boolean doPaint)
          paints code 11 code
protected  void paintCode128(java.awt.Graphics g, boolean doPaint)
          paints a code 128 barcode from character set A, B or C and encode ASCII 0 to 31 in the barcode if it exists.
protected  void paintCODE39(java.awt.Graphics g, boolean doPaint)
          paints a code 39 code.
protected  void paintCODE39Ext(java.awt.Graphics g, boolean doPaint)
          paints a code 39 extended code
protected  void paintEAN13(java.awt.Graphics g, boolean doPaint)
          paints a EAN13 code.
protected  void paintEAN8(java.awt.Graphics g, boolean doPaint)
          paints a EAN8 code
protected  void paintGuardChar(java.awt.Graphics g, java.lang.String patternColor, java.lang.String patternBars, int bartopMargin, boolean doPaint)
          paints a guard character
protected  void paintIND25(java.awt.Graphics g, boolean doPaint)
          paints an industrial 2 of 5 code.
protected  void paintINTELLIGENTMAIL(java.awt.Graphics g, boolean paint)
           
protected  void paintInterleaved25(java.awt.Graphics g, boolean doPaint)
          paints an interleaved 2 of 5 code.
protected  void paintMAT25(java.awt.Graphics g, boolean doPaint)
          paints a matrix 2 of 5 code
protected  void paintMSI(java.awt.Graphics g, boolean doPaint)
          paints a MSI code
protected  void paintPLANET(java.awt.Graphics g, boolean doPaint)
          paints a PLANET code.
protected  void paintPOSTNET(java.awt.Graphics g, boolean doPaint)
          paints a Postnet code.
protected  void paintPostNetChar(java.awt.Graphics g, java.lang.String pattern)
          paints a Postnet char.
protected  void paintSup2(java.awt.Graphics g, java.lang.String chars, boolean doPaint)
          paints a 2 digit supplement
protected  void paintSup5(java.awt.Graphics g, java.lang.String chars, boolean doPaint)
          paints a 5 digit supplement
protected  void paintUCC128(java.awt.Graphics g, boolean doPaint)
          paints a Code 128 Code for EAN-128 and UCC-128 specifications which is a mandatory character set C start character and the FNC1 code.
protected  void paintUPCA(java.awt.Graphics g, boolean doPaint)
          paints a UPCA code.
protected  void paintUPCE(java.awt.Graphics g, boolean doPaint)
          paints a UPCE code
protected  java.awt.Image rotate(java.awt.Image im, int angle, int maxw, int maxh)
          rotates an image
 void setAutoSize(boolean newVal)
          Sets the autoSize property.
 void setBackground(java.awt.Color newColor)
          Sets the backColor property.
 void setBarHeightCM(double newBarHeight)
          Sets the barHeightCM property.
 void setBearerBarHorizontal(double newBearerBarHori)
          Sets the fBearerBarHori property.
 void setBearerBarVertical(double newBearerBarVert)
          Sets the fBearerBarVert property.
 void setCharacterGrouping(int newValSpliceText)
          Sets the ValSpliceText property.
 void setCheckCharacter(boolean newChk)
          Sets the checkCharacter property.
 void setCheckCharacterInText(boolean newVal)
          Sets the checkCharacterInText property.
 void setCODABARStartChar(java.lang.String newSet)
          Sets the CODABARStartChar property.
 void setCODABARStopChar(java.lang.String newSet)
          Sets the CODABARStopChar property.
 void setCode128Set(java.lang.String newSet)
          Sets the Code128Set property.
 void setDataToEncode(java.lang.String newCode)
          Sets the code property.
 void setFont(java.awt.Font newFont)
          Sets the textFont property.
 void setForeground(java.awt.Color newColor)
          Sets the barColor property.
 void setImageSize(int imgWidth, int imgHeight)
          Sets the size of the generated image, if used then autoSize is set to false.
 void setLeftMarginCM(double newMargin)
          Sets the leftMarginCM property.
 void setNarrowToWideRatio(double newN)
          Sets the N property.
 void setPixelsPerCM(int newRes)
          Sets the resolution property.
 void setPostnetHeightShort(double newHeight)
          Sets the postnetHeightShortBar property.
 void setPostnetHeightTall(double newHeight)
          Sets the postnetHeightTallBar property.
 void setProcessTilde(boolean pt)
          Sets the processTilde property.
 void setRotationAngle(int newRotate)
          Sets the rotate property.
 void setShowText(boolean newVal)
          Sets the showText property.
 void setSupplementToEncode(java.lang.String newCode)
          Sets the supplement property.
 void setSymbologyID(int newSym)
          Sets the barType property.
 void setTextFontColor(java.awt.Color newColor)
          Sets the fontColor property.
 void setTextMarginCM(double newMargin)
          Sets the textMarginCM property.
 void setTopMarginCM(double newMargin)
          Sets the topMarginCM property.
 void setUPCEANSupplement2(boolean newval)
          Sets the UPCEANSupplement2 property.
 void setUPCEANSupplement5(boolean newval)
          Sets the UPCEANSupplement5 property.
 void setUPCESystem(java.lang.String newSet)
          Sets the UPCESystem property.
 void setWhiteBarIncrease(float newWhiteBarIncrease)
          Sets the WhiteBarIncrease property.
 void setXDimensionCM(double newX)
          Sets the X property.
protected  java.lang.String spliceText(java.lang.String TextToSplice, int SpacingNumber)
           
protected  java.lang.String UPCEANCheck(java.lang.String s)
          Calculates the UPC/EAN check character.
 
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, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getAlignmentX, getAlignmentY, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFontMetrics, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, 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, 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, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CODE39

public static final int CODE39
See Also:
Constant Field Values

CODE39EXT

public static final int CODE39EXT
See Also:
Constant Field Values

INTERLEAVED25

public static final int INTERLEAVED25
See Also:
Constant Field Values

CODE11

public static final int CODE11
See Also:
Constant Field Values

CODABAR

public static final int CODABAR
See Also:
Constant Field Values

MSI

public static final int MSI
See Also:
Constant Field Values

UPCA

public static final int UPCA
See Also:
Constant Field Values

IND25

public static final int IND25
See Also:
Constant Field Values

MAT25

public static final int MAT25
See Also:
Constant Field Values

CODE93

public static final int CODE93
See Also:
Constant Field Values

EAN13

public static final int EAN13
See Also:
Constant Field Values

EAN8

public static final int EAN8
See Also:
Constant Field Values

UPCE

public static final int UPCE
See Also:
Constant Field Values

CODE128

public static final int CODE128
See Also:
Constant Field Values

CODE93EXT

public static final int CODE93EXT
See Also:
Constant Field Values

POSTNET

public static final int POSTNET
See Also:
Constant Field Values

PLANET

public static final int PLANET
See Also:
Constant Field Values

UCC128

public static final int UCC128
See Also:
Constant Field Values

INTELLIGENTMAIL

public static final int INTELLIGENTMAIL
See Also:
Constant Field Values

barType

public int barType
This is the symbology of barcode. Default = CODE128.

See Also:
setSymbologyID(int newSym), getSymbologyID(), User Manual

code

public java.lang.String code
The data to be encoded as a barcode.

See Also:
setDataToEncode(String newCode), getDataToEncode(), User Manual

textMarginCM

public double textMarginCM
The amount of space in CM between the barcode and the human readable text. Default is 0.3CM.

See Also:
setTextMarginCM(double newMargin), getTextMarginCM(), User Manual

checkCharacter

public boolean checkCharacter
If true, the checksum character will be calculated and appended to the code; Default =True; checksum characters cannot be displayed or disabled for Code 128 and UCC128.

See Also:
setCheckCharacter(boolean newChk), getCheckCharacter(), User Manual

checkCharacterInText

public boolean checkCharacterInText
If true, the checksum character will be appended to the human readable text; Default =True; checksum characters cannot by displayed or disabled for Code 128 and UCC128.

See Also:
setCheckCharacterInText(boolean newVal), getCheckCharacterInText(), User Manual

processTilde

public boolean processTilde
If true, numbers after the Tilde will be processed according to the rules in the user guide; this option is only available when the symbology is Code 128, and the character set is AUTO or 0.

See Also:
setProcessTilde(boolean pt), getProcessTilde(), User Manual

postnetHeightTallBar

public double postnetHeightTallBar
Height in CM of POSTNET's tall bars; The default is 0.3

See Also:
setPostnetHeightTall(double newHeight), getPostnetHeightTall(), User Manual

postnetHeightShortBar

public double postnetHeightShortBar
Height in CM of POSTNET's short bars; The default is 0.125

See Also:
setPostnetHeightShort(double newHeight), getPostnetHeightShort(), User Manual

leftMarginCM

public double leftMarginCM
The left margin of the barcode (also know as quiet zone); The default is .3 CM.

See Also:
setLeftMarginCM(double newMargin), getLeftMarginCM(), User Manual

d

protected static final int d
See Also:
Constant Field Values

topMarginCM

public double topMarginCM
The top margin of the barcode (also know as quiet zone); The default is .2 CM

See Also:
setTopMarginCM(double newMargin), getTopMarginCM(), User Manual

leftMarginPixels

protected int leftMarginPixels

topMarginPixels

protected int topMarginPixels

hrLeftMarginPixels

protected int hrLeftMarginPixels

supplement

public java.lang.String supplement
This is the user defined 2 or 5 digit supplement for EAN or UPC codes.

See Also:
setSupplementToEncode(String newCode), getSupplementToEncode(), User Manual

guardBars

public boolean guardBars
If true, (default), guardbars in EAN and UPC codes will be longer than data bars.


backColor

public java.awt.Color backColor
Background color.

See Also:
setBackground(Color newColor), getBackground(), User Manual

codeText

public java.lang.String codeText
The text of the barcode after it is created.


narrowBarPixels

protected int narrowBarPixels

widthBarPixels

protected int widthBarPixels

narrowBarCM

protected double narrowBarCM

widthBarCM

protected double widthBarCM

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.

See Also:
setPixelsPerCM(int newRes), getPixelsPerCM(), User Manual

barHeightPixels

protected int barHeightPixels

barHeightCM

public double barHeightCM
Bar height in CM; If 0 it will be calculated using H; Default=1.

See Also:
setBarHeightCM(double newBarHeight), getBarHeightCM(), User Manual

width

public int width
Initial preferred width property of the bean


height

public int height
Initial preferred height property of the bean


autoSize

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

See Also:
setAutoSize(boolean newVal), getAutoSize(), User Manual

pWidth

public int pWidth
The preferred width of the barcode image in pixels after barcode is generated.

See Also:
getPreferredSize(), User Manual

pHeight

public int pHeight
The preferred height of the barcode image in pixels after barcode is generated.

See Also:
getPreferredSize(), User Manual

showText

public boolean showText
If true, the human readable text will be displayed with the barcode; Default =true.

See Also:
setShowText(boolean newVal), getShowText(), User Manual

textFont

public java.awt.Font textFont
The font of the text in the barcode; Default = Arial.

See Also:
setFont(Font newFont), getFont(), User Manual

fontColor

public java.awt.Color fontColor
The color of the humam readable text; Default=black.

See Also:
setTextFontColor(Color newColor), getTextFontColor(), User Manual

barColor

public java.awt.Color barColor
The color of the bars in the barcode; Default=black.

See Also:
setForeground(Color newColor), getForeground(), User Manual

UPCESystem

public char UPCESystem
The system to be used in UPCE; It can be "0", "1" or "2"(Auto); The default is "0".

See Also:
setUPCESystem(String newSet), getUPCESystem(), User Manual

CODABARStartChar

public char CODABARStartChar
The start character for CODABAR; The default is A.

See Also:
setCODABARStartChar(String newSet), getCODABARStartChar(), User Manual

CODABARStopChar

public char CODABARStopChar
The stop character for CODABAR; The default is B.

See Also:
setCODABARStopChar(String newSet), getCODABARStopChar(), User Manual

UPCEANSupplement2

public boolean UPCEANSupplement2
If true, the 2 digit supplement for EAN or UPC codes is processed.

See Also:
setUPCEANSupplement2(boolean newval), getUPCEANSupplement2(), User Manual

UPCEANSupplement5

public boolean UPCEANSupplement5
If true, the 5 digit supplement for EAN or UPC codes is processed.

See Also:
setUPCEANSupplement5(boolean newval), getUPCEANSupplement5(), User Manual

Code128Set

public char Code128Set
The character set to be used in code 128; Possible values are "0 for AUTO", "A", "B" or "C"; The recommended setting and the default is "0" (Automatic).

See Also:
setCode128Set(String newSet), getCode128Set(), User Manual

X

public double X
The size in CM of modules (narrow bars or spaces); The resolution is used to convert to pixels.

See Also:
setXDimensionCM(double newX), getXDimensionCM(), User Manual

N

public double N
The wide to narrow ratio of barcode types that support this setting such as Code 39 and ITF; A value of 2 (default) means that wide bars will be 2*N in width.

See Also:
setNarrowToWideRatio(double newN), getNarrowToWideRatio(), User Manual

I

public double I
The space between 2 characters in code 39; This a multiple of X; The default is 1.;


H

public double H
The height of bars in the barcode as a multiple of X; The default is 0.45.


L

public double L
The symbol length in CM.


rotate

public int rotate
The rotation angle; Valid values are 0 (default), 90, 180 & 270.

See Also:
setRotationAngle(int newRotate), getRotationAngle(), User Manual

supSeparationCM

public double supSeparationCM
The separation in CM between the barcode and the supplement


supHeight

public double supHeight
Height of the supplement; This is a multiplicator of the height of the code; The default is 0.8 (80%).


currentX

protected int currentX
The current position of the painting cursor.


currentY

protected int currentY

currentXStart

protected int currentXStart

WhiteBarIncrease

public float WhiteBarIncrease
The percent of the XDimension to increase the white bars.

See Also:
setWhiteBarIncrease(float newWhiteBarIncrease), getWhiteBarIncrease(), User Manual

ValSpliceText

public int ValSpliceText
The number of digits to group together in the human readable text. Valid options are 3,4,or 5.

See Also:
setCharacterGrouping(int newValSpliceText), getCharacterGrouping(), User Manual

fBearerBarVert

public double fBearerBarVert
The value of the vertical bearer bar. This value is a function of the XDimension. Valid options are 0-10.

See Also:
setBearerBarVertical(double newBearerBarVert), getBearerBarVertical(), User Manual

fBearerBarHori

public double fBearerBarHori
The value of the horizontal bearer bar. This value is a function of the XDimension. Valid options are 0-10.

See Also:
setBearerBarHorizontal(double newBearerBarHori), getBearerBarHorizontal(), User Manual
Constructor Detail

BarCode

public BarCode()
Method Detail

setSymbologyID

public void setSymbologyID(int newSym)
Sets the barType property.

Parameters:
newSym - the new value for the barType variable.
See Also:
barType, User Manual

getSymbologyID

public int getSymbologyID()
Gets the barType property.

Returns:
the current value of the barType variable.
See Also:
barType, User Manual

setDataToEncode

public void setDataToEncode(java.lang.String newCode)
Sets the code property.

Parameters:
newCode - the new value for the newCodecode variable.
See Also:
code, User Manual

getDataToEncode

public java.lang.String getDataToEncode()
Gets the code property.

Returns:
the current value of the code variable.
See Also:
code, User Manual

setTextMarginCM

public void setTextMarginCM(double newMargin)
Sets the textMarginCM property.

Parameters:
newMargin - the new value for the textMarginCM variable.
See Also:
textMarginCM, User Manual

getTextMarginCM

public double getTextMarginCM()
Gets the textMarginCM property value

Returns:
the current value for the textMarginCM variable.
See Also:
textMarginCM, User Manual

setCheckCharacter

public void setCheckCharacter(boolean newChk)
Sets the checkCharacter property.

Parameters:
newChk - the new value for the checkCharacter variable.
See Also:
checkCharacter, User Manual

getCheckCharacter

public boolean getCheckCharacter()
Gets the checkCharacter property.

Returns:
the current value of the checkCharacter variable.
See Also:
checkCharacter, User Manual

setCheckCharacterInText

public void setCheckCharacterInText(boolean newVal)
Sets the checkCharacterInText property.

Parameters:
newVal - the new value for the checkCharacterInText variable.
See Also:
checkCharacterInText, User Manual

getCheckCharacterInText

public boolean getCheckCharacterInText()
Gets the checkCharacterInText property.

Returns:
the current value of the checkCharacterInText variable.
See Also:
checkCharacterInText, User Manual

setProcessTilde

public void setProcessTilde(boolean pt)
Sets the processTilde property.

Parameters:
pt - the new value for the processTilde variable.
See Also:
processTilde, User Manual

getProcessTilde

public boolean getProcessTilde()
Gets the processTilde property.

Returns:
the current string value of the processTilde variable.
See Also:
processTilde, User Manual

setPostnetHeightTall

public void setPostnetHeightTall(double newHeight)
Sets the postnetHeightTallBar property.

Parameters:
newHeight - the new value for the postnetHeightTallBar variable.
See Also:
postnetHeightTallBar, User Manual

getPostnetHeightTall

public double getPostnetHeightTall()
Gets the postnetHeightTallBar property.

Returns:
the current value of the postnetHeightTallBar variable.
See Also:
postnetHeightTallBar, User Manual

setPostnetHeightShort

public void setPostnetHeightShort(double newHeight)
Sets the postnetHeightShortBar property.

Parameters:
newHeight - the new value for the postnetHeightShortBar variable.
See Also:
postnetHeightShortBar, User Manual

getPostnetHeightShort

public double getPostnetHeightShort()
Gets the postnetHeightShortBar property.

Returns:
the current string value of the postnetHeightShortBar variable.
See Also:
postnetHeightShortBar, User Manual

setLeftMarginCM

public void setLeftMarginCM(double newMargin)
Sets the leftMarginCM property.

Parameters:
newMargin - the new value for the leftMarginCM variable.
See Also:
leftMarginCM, User Manual

getLeftMarginCM

public double getLeftMarginCM()
Gets the leftMarginCM property.

Returns:
the current string value of the leftMarginCM variable.
See Also:
leftMarginCM, User Manual

setTopMarginCM

public void setTopMarginCM(double newMargin)
Sets the topMarginCM property.

Parameters:
newMargin - the new value for the topMarginCM variable.
See Also:
topMarginCM, User Manual

getTopMarginCM

public double getTopMarginCM()
Gets the topMarginCM property.

Returns:
the current string value of the topMarginCM variable.
See Also:
topMarginCM, User Manual

setSupplementToEncode

public void setSupplementToEncode(java.lang.String newCode)
Sets the supplement property.

Parameters:
newCode - the new value for the supplement variable.
See Also:
supplement, User Manual

getSupplementToEncode

public java.lang.String getSupplementToEncode()
Gets the supplement property.

Returns:
the current string value of the supplement variable.
See Also:
supplement, User Manual

setBackground

public void setBackground(java.awt.Color newColor)
Sets the backColor property.

Parameters:
newColor - the new value for the backColor variable.
See Also:
backColor, User Manual

getBackground

public java.awt.Color getBackground()
Gets the backColor property.

Returns:
the current value of the backColor variable.
See Also:
backColor, User Manual

setPixelsPerCM

public void setPixelsPerCM(int newRes)
Sets the resolution property.

Parameters:
newRes - the new value for the resolution variable.
See Also:
resolution, User Manual

getPixelsPerCM

public int getPixelsPerCM()
Gets the resolution property.

Returns:
the current string value of the resolution variable.
See Also:
resolution, User Manual

setBarHeightCM

public void setBarHeightCM(double newBarHeight)
Sets the barHeightCM property.

Parameters:
newBarHeight - the new value for the barHeightCM variable.
See Also:
barHeightCM, User Manual

getBarHeightCM

public double getBarHeightCM()
Gets the barHeightCM property.

Returns:
the current value of the barHeightCM variable.
See Also:
barHeightCM, User Manual

setAutoSize

public void setAutoSize(boolean newVal)
Sets the autoSize property.

Parameters:
newVal - the new value for the autoSize variable.
See Also:
autoSize, User Manual

getAutoSize

public boolean getAutoSize()
Gets the autoSize property value.

Returns:
the current value of the autoSize variable.
See Also:
autoSize, User Manual

setImageSize

public void setImageSize(int imgWidth,
                         int imgHeight)
Sets the size of the generated image, if used then autoSize is set to false.

See Also:
User Manual

getPreferredSize

public java.awt.Dimension getPreferredSize()
Gets the size in pixels of the Preferred barcode image generated.

Returns:
Dimension(pWidth,pHeight)
See Also:
pWidth, pHeight, User Manual

getMinimumSize

public java.awt.Dimension getMinimumSize()
Gets the minimum size in pixels of the barcode image generated.

Returns:
Dimension(10,10)
See Also:
User Manual

setShowText

public void setShowText(boolean newVal)
Sets the showText property.

Parameters:
newVal - the new value for the showText variable.
See Also:
showText, User Manual

getShowText

public boolean getShowText()
Gets the showText property value.

Returns:
the current value of the showText variable.
See Also:
showText, User Manual

setFont

public void setFont(java.awt.Font newFont)
Sets the textFont property.

Parameters:
newFont - the new value for the textFont variable.
See Also:
textFont, User Manual

getFont

public java.awt.Font getFont()
Gets the textFont property value.

Specified by:
getFont in interface java.awt.MenuContainer
Returns:
the current value of the textFont variable.
See Also:
textFont, User Manual

setTextFontColor

public void setTextFontColor(java.awt.Color newColor)
Sets the fontColor property.

Parameters:
newColor - the new value for the fontColor variable.
See Also:
fontColor, User Manual

getTextFontColor

public java.awt.Color getTextFontColor()
Gets the fontColor property value.

Returns:
the current value of the fontColor variable.
See Also:
fontColor, User Manual

setForeground

public void setForeground(java.awt.Color newColor)
Sets the barColor property.

Parameters:
newColor - the new value for the barColor variable.
See Also:
barColor, User Manual

getForeground

public java.awt.Color getForeground()
Gets the barColor property value.

Returns:
the current value of the barColor variable.
See Also:
barColor, User Manual

setUPCESystem

public void setUPCESystem(java.lang.String newSet)
Sets the UPCESystem property.

Parameters:
newSet - the new value for the UPCESystem variable.
See Also:
UPCESystem, User Manual

getUPCESystem

public java.lang.String getUPCESystem()
Gets the UPCESystem property value.

Returns:
the current value of the UPCESystem variable.
See Also:
UPCESystem, User Manual

setCODABARStartChar

public void setCODABARStartChar(java.lang.String newSet)
Sets the CODABARStartChar property.

Parameters:
newSet - the new value for the CODABARStartChar variable.
See Also:
CODABARStartChar, User Manual

getCODABARStartChar

public java.lang.String getCODABARStartChar()
Gets the CODABARStartChar property value.

Returns:
the current value of the CODABARStartChar variable.
See Also:
CODABARStartChar, User Manual

setCODABARStopChar

public void setCODABARStopChar(java.lang.String newSet)
Sets the CODABARStopChar property.

Parameters:
newSet - the new value for the CODABARStopChar variable.
See Also:
CODABARStopChar, User Manual

getCODABARStopChar

public java.lang.String getCODABARStopChar()
Gets the CODABARStopChar property value.

Returns:
the current value of the CODABARStopChar variable.
See Also:
CODABARStopChar, User Manual

setUPCEANSupplement2

public void setUPCEANSupplement2(boolean newval)
Sets the UPCEANSupplement2 property.

See Also:
UPCEANSupplement2, User Manual

getUPCEANSupplement2

public boolean getUPCEANSupplement2()
Gets the UPCEANSupplement2 property value.

Returns:
the current value of the UPCEANSupplement2 variable.
See Also:
UPCEANSupplement2, User Manual

setUPCEANSupplement5

public void setUPCEANSupplement5(boolean newval)
Sets the UPCEANSupplement5 property.

Parameters:
newval - the new value for the UPCEANSupplement5 variable.
See Also:
UPCEANSupplement5, User Manual

getUPCEANSupplement5

public boolean getUPCEANSupplement5()
Gets the UPCEANSupplement5 property.

Returns:
the current string value of the UPCEANSupplement5 variable.
See Also:
UPCEANSupplement5, User Manual

setCode128Set

public void setCode128Set(java.lang.String newSet)
Sets the Code128Set property.

Parameters:
newSet - the new value for the Code128Set variable.
See Also:
Code128Set, User Manual

getCode128Set

public java.lang.String getCode128Set()
Gets the Code128Set property.

Returns:
the current string value of the Code128Set variable.
See Also:
Code128Set, User Manual

setXDimensionCM

public void setXDimensionCM(double newX)
Sets the X property.

Parameters:
newX - the new value for the X variable.
See Also:
X, User Manual

getXDimensionCM

public double getXDimensionCM()
Gets the X property.

Returns:
the current string value of the X variable.
See Also:
X, User Manual

setNarrowToWideRatio

public void setNarrowToWideRatio(double newN)
Sets the N property.

Parameters:
newN - the new value for the N variable.
See Also:
N, User Manual

getNarrowToWideRatio

public double getNarrowToWideRatio()
Gets the N property.

Returns:
the current string value of the N variable.
See Also:
N, User Manual

setRotationAngle

public void setRotationAngle(int newRotate)
Sets the rotate property.

Parameters:
newRotate - the new value for the rotate variable.
See Also:
rotate, User Manual

getRotationAngle

public int getRotationAngle()
Gets the rotate property.

Returns:
the current string value of the rotate variable.
See Also:
rotate, User Manual

setWhiteBarIncrease

public void setWhiteBarIncrease(float newWhiteBarIncrease)
Sets the WhiteBarIncrease property.

Parameters:
newWhiteBarIncrease - the new value for the WhiteBarIncrease variable.
See Also:
WhiteBarIncrease, User Manual

getWhiteBarIncrease

public float getWhiteBarIncrease()
Gets the WhiteBarIncrease property.

Returns:
the current string value of the WhiteBarIncrease variable.
See Also:
WhiteBarIncrease, User Manual

setCharacterGrouping

public void setCharacterGrouping(int newValSpliceText)
Sets the ValSpliceText property.

Parameters:
newValSpliceText - the new value for the variable.
See Also:
ValSpliceText, User Manual

getCharacterGrouping

public int getCharacterGrouping()
Gets the ValSpliceText property.

Returns:
the current value of ValSpliceText the variable.
See Also:
ValSpliceText, User Manual

setBearerBarVertical

public void setBearerBarVertical(double newBearerBarVert)
Sets the fBearerBarVert property.

Parameters:
newBearerBarVert - the new value for the fBearerBarVert variable.
See Also:
fBearerBarVert, User Manual

getBearerBarVertical

public double getBearerBarVertical()
Gets the PropBearerBarVert property.

Returns:
the current value of the PropBearerBarVert variable.
See Also:
fBearerBarVert, User Manual

setBearerBarHorizontal

public void setBearerBarHorizontal(double newBearerBarHori)
Sets the fBearerBarHori property.

Parameters:
newBearerBarHori - the new value for the fBearerBarHori variable.
See Also:
fBearerBarHori, User Manual

getBearerBarHorizontal

public double getBearerBarHorizontal()
Gets the PropBearerBarHori property.

Returns:
the current value of the PropBearerBarHori variable.
See Also:
fBearerBarHori, User Manual

addBar

protected void addBar(java.awt.Graphics g,
                      int w,
                      boolean black,
                      int bartopmargin,
                      boolean doPaint)
adds a bar to the bar code at the currentX position.


paintPostNetChar

protected void paintPostNetChar(java.awt.Graphics g,
                                java.lang.String pattern)
paints a Postnet char.


paintPOSTNET

protected void paintPOSTNET(java.awt.Graphics g,
                            boolean doPaint)
paints a Postnet code.


findChar

protected int findChar(java.lang.String[][] table,
                       java.lang.String c)
find a char in a charset table


paintPLANET

protected void paintPLANET(java.awt.Graphics g,
                           boolean doPaint)
paints a PLANET code.


paintInterleaved25

protected void paintInterleaved25(java.awt.Graphics g,
                                  boolean doPaint)
paints an interleaved 2 of 5 code.


paintIND25

protected void paintIND25(java.awt.Graphics g,
                          boolean doPaint)
paints an industrial 2 of 5 code.


UPCEANCheck

protected java.lang.String UPCEANCheck(java.lang.String s)
Calculates the UPC/EAN check character.


paintUPCA

protected void paintUPCA(java.awt.Graphics g,
                         boolean doPaint)
paints a UPCA code.


paintEAN13

protected void paintEAN13(java.awt.Graphics g,
                          boolean doPaint)
paints a EAN13 code.


isDigit

protected boolean isDigit(char n)

paintCode128

protected void paintCode128(java.awt.Graphics g,
                            boolean doPaint)
paints a code 128 barcode from character set A, B or C and encode ASCII 0 to 31 in the barcode if it exists.


paintUCC128

protected void paintUCC128(java.awt.Graphics g,
                           boolean doPaint)
paints a Code 128 Code for EAN-128 and UCC-128 specifications which is a mandatory character set C start character and the FNC1 code.


paintEAN8

protected void paintEAN8(java.awt.Graphics g,
                         boolean doPaint)
paints a EAN8 code


paintUPCE

protected void paintUPCE(java.awt.Graphics g,
                         boolean doPaint)
paints a UPCE code


paintSup2

protected void paintSup2(java.awt.Graphics g,
                         java.lang.String chars,
                         boolean doPaint)
paints a 2 digit supplement


paintSup5

protected void paintSup5(java.awt.Graphics g,
                         java.lang.String chars,
                         boolean doPaint)
paints a 5 digit supplement


paintMAT25

protected void paintMAT25(java.awt.Graphics g,
                          boolean doPaint)
paints a matrix 2 of 5 code


paintCODE39

protected void paintCODE39(java.awt.Graphics g,
                           boolean doPaint)
paints a code 39 code.


paintCODE11

protected void paintCODE11(java.awt.Graphics g,
                           boolean doPaint)
paints code 11 code


paintCODABAR

protected void paintCODABAR(java.awt.Graphics g,
                            boolean doPaint)
paints a CODABAR code


paintMSI

protected void paintMSI(java.awt.Graphics g,
                        boolean doPaint)
paints a MSI code


mod

protected static double mod(double a,
                            double b)

paintCODE39Ext

protected void paintCODE39Ext(java.awt.Graphics g,
                              boolean doPaint)
paints a code 39 extended code


paintBAR93

protected void paintBAR93(java.awt.Graphics g,
                          boolean doPaint)
paints a code 93 barcode


paintBAR93Ext

protected void paintBAR93Ext(java.awt.Graphics g,
                             boolean doPaint)
paints a code 93 extended barcode


paintChar

protected void paintChar(java.awt.Graphics g,
                         java.lang.String patternColor,
                         java.lang.String patternBars,
                         boolean doPaint)
paints a character


paintChar2

protected void paintChar2(java.awt.Graphics g,
                          java.lang.String patternColor,
                          java.lang.String patternBars,
                          int bartopmargin,
                          boolean doPaint)
paints a character


paintGuardChar

protected void paintGuardChar(java.awt.Graphics g,
                              java.lang.String patternColor,
                              java.lang.String patternBars,
                              int bartopMargin,
                              boolean doPaint)
paints a guard character


calculateSizes

protected void calculateSizes()
calculates L and converts size in CM to pixels


paint

public void paint(java.awt.Graphics g2)
paints the barcode and rotates it if necessary


paintBasis

protected void paintBasis(java.awt.Graphics g)
paints the barcode


rotate

protected java.awt.Image rotate(java.awt.Image im,
                                int angle,
                                int maxw,
                                int maxh)
rotates an image


spliceText

protected java.lang.String spliceText(java.lang.String TextToSplice,
                                      int SpacingNumber)

DrawBearerBars

protected void DrawBearerBars(java.awt.Graphics g,
                              int bartopmargin,
                              int bcwBB)

DemoDraw

protected void DemoDraw(java.awt.Graphics g,
                        int demoX,
                        int ybuf,
                        int DemoTextH)

paintINTELLIGENTMAIL

protected void paintINTELLIGENTMAIL(java.awt.Graphics g,
                                    boolean paint)