JBarCodePro1
Class BarCodeBean

java.lang.Object
  |
  +--java.awt.Component
        |
        +dsx.JBarCodePro1.BarCodeBean
            

public class BarCodeBean
extends java.awt.Component
implements java.io.Serializable

See Also:
Serialized Form

Field Summary
static int ALIGNCENTER
           
static int ALIGNLEFT
           
static int ALIGNRIGHT
           
static int BAR11
           
static int BAR128
           
static int BARIN25
           
static int BAR39
           
static int BAR93
           
static int BAREAN128
           
static int BAREAN13
           
static int BAREAN8
           
static int BARHIBCEAN128
           
static int BARHIBCIN25
           
static int BARHIBCLIC128
           
static int BARHIBCLIC39
           
static int BARJAN13
           
static int BARJAN8
           
static int BarMSI
           
static int BARUPCA
           
static int BARUPCE
           
static int BORDERNBROKENLINE
           
static int BORDERNONE
           
static int BORDERNSOLIDLINE
           
static int BORDERWBROKENLINE
           
static int BORDERWSOLIDLINE
           
static int CODABAR
           
static int CODE128A
           
static int CODE128AUTO
           
static int CODE128B
           
static int CODE128C
           
static int EXTBAR39
           
protected  int m_Symbol
           
static  int ORIENT0
           
static  int ORIENT90
           
static  int ORIENT180
           
static  int ORIENT270
           
   
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Constructor Summary
BarCodeBean()
          Creates new BarCodeBean
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
           
 java.awt.Color getBackground()
           
 int getBar128Type()
           
 boolean getBarBearerMode()
           
 int getBarBorderStyle()
           
 java.lang.String getBarBottomComment()
           
 java.awt.Font getBarBottomCommentFont()
           
 boolean getBarCheckEnable()
           
 int getBarCommentAlignStyle()
           
 short getBarHeight()
           
 boolean getBarHRDisplay()
           
 java.awt.Font getBarHRFont()
           
 java.lang.String getBarMessage()
           
 short getBarNarrowWidth()
           
 short getBarOrientation()
           
 short getBarQuietZone()
           
 float getBarRatio()
           
 java.lang.String getBarSupplement()
           
 int getBarSymbology()
           
 java.lang.String getBarTopComment()
           
 java.awt.Font getBarTopCommentFont()
           
 boolean getBarTransparent()
           
 java.awt.Color getForeground()
           
 java.awt.Dimension getPreferredSize()
           
 boolean IsOpaque()
           
 void paint(java.awt.Graphics g)
           
protected  void paintBar(java.awt.Graphics g,Point ptLeftTop)
           
 boolean putPngImageToFile(java.lang.String sFileName)
           
 boolean putPngImageToStream(java.io.OutputStream os)
           
 void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
           
 void setBackground(java.awt.Color colorBG)
           
 void setBar128Type(int iType)
           
 void setBarBearerMode(boolean bMode)
           
 void setBarBorderStyle(int istyle)
           
 void setBarBottomComment(java.lang.String bottomComment)
           
 void setBarBottomCommentFont(java.awt.Font bottomFont)
           
 void setBarCheckEnable(boolean bCheck)
           
 void setBarCommentAlignStyle(int istyle)
           
 void setBarHeight(short shHeight)
           
 void setBarHRDisplay(boolean bDisplay)
           
 void setBarHRFont(java.awt.Font fnewFont)
           
 void setBarMessage(java.lang.String value)
           
 void setBarNarrowWidth(short shWidth)
           
 void setBarOrientation(int iOrient)
           
 void setBarQuietZone(short shQuietZone)
           
 void setBarRatio(float fRatio)
           
 void setBarSupplement(java.lang.String value)
           
 void setBarSymbology(int iSymbol)
           
 void setBarTopComment(java.lang.String topComment)
           
 void setBarTopCommentFont(java.awt.Font topFont)
           
 void setBarTransparent(boolean btran)
           
 void setForeground(java.awt.Color colorBar)
           
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hide, imageUpdate, inside, isDisplayable, isEnabled, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processInputMethodEvent, processMouseEvent, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_Symbol

protected int m_Symbol

BAR11

public static final int BAR11

CODABAR

public static final int CODABAR

BARMSI

public static final int BARMSI

BAR39

public static final int BAR39

EXTBAR39

public static final int EXTBAR39

BAR93

public static final int BAR93

BAR128

public static final int BAR128

BAREAN128

public static final int BAREAN128

BARUPCA

public static final int BARUPCA

BARUPCE

public static final int BARUPCE

BAREAN13

public static final int BAREAN13

BAREAN8

public static final int BAREAN8

BARJAN13

public static final int BARJAN13

BARJAN8

public static final int BARJAN8

BARHIBCLIC39

public static final int BARHIBCLIC39

BARHIBCLIC128

public static final int BARHIBCLIC128

BARHIBCEAN128

public static final int BARHIBCEAN128

BARHIBCIN25

public static final int BARHIBCIN25

BARIN25

public static final int BARIN25

BORDERNONE

public static final int BORDERNONE

BORDERNBROKENLINE

public static final int BORDERNBROKENLINE

BORDERWBROKENLINE

public static final int BORDERWBROKENLINE

BORDERNSOLIDLINE

public static final int BORDERNSOLIDLINE

BORDERWSOLIDLINE

public static final int BORDERWSOLIDLINE

ALIGNCENTER

public static final int ALIGNCENTER

ALIGNLEFT

public static final int ALIGNLEFT

ALIGNRIGHT

public static final int ALIGNRIGHT

CODE128A

public static final int CODE128A

CODE128B

public static final int CODE128B

CODE128C

public static final int CODE128C

CODE128AUTO

public static final int CODE128AUTO

ORIENT0

public static final int ORIENT0

ORIENT90

public static final int ORIENT90

ORIENT180

public static final int ORIENT180

ORIENT270

public static final int ORIENT270
Constructor Detail

BarCodeBean

public BarCodeBean()
Default constructor
Method Detail

putPngImageToStream

public boolean putPngImageToStream(java.io.OutputStream os)

Convert barcode into a PNG image and put it to an output stream. This function can be used to save barcode into a file, to send the barcode to browsers

putPngImageToFile

public boolean putPngImageToFile(java.lang.String sFileName)
     Convert barcode into a  PNG image and put it to a file
	sFileName:  image file name

getPreferredSize

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

Returns barcode's dimension in points


getBar128Type

public int getBar128Type()


Returns Code 128's type. Possible values are

	
  • CODE128A: if barcode is code 128A
  • CODE128B: if barcode is code 128B
  • CODE128C: if barcode is code 128C

  • setBar128Type

    public void setBar128Type(int iType)
    Sets Code 128's type.  Please refer to getBar128Type() for details

    getBarSymbology

    public int getBarSymbology()
    
    
    Returns barcode's symbology. Possible values are
     
    ValueDescription of Symbologies
    BAR11Code 11
    CODABARCodabar
    BARMSIPresley or MSI
    BAR39Code 39
    EXTBAR39Extended Code 39
    BAR93Code 93
    BAR128Code 128
    BAREAN128EAN 128
    BARUPCAUPCA
    BARUPCEUPCE
    BAREAN13EAN13
    BAREAN8EAN8
    BARJAN13JAN13
    BARJAN8 JAN8
    BARHIBCLIC39HIBC with Code 39
    BARHIBCLIC128HIBC with Code 128
    BARHIBCEAN128HIBC with EAN 128
    BARHIBCIN25HIBC with Interleaved 2 of 5
    BARIN25Interleaved 2 of 5

    setBarSymbology

    
    
    public void setBarSymbology(int iSymbol)
    
    
    Sets barcode's symbology. Please refer to getBarSymbology() for details about the values of iSymbol

    getBackground

    public java.awt.Color getBackground()
    Returns the background color of the barcode
    Overrides:
    getBackground in class java.awt.Component

    setBackground

    public void setBackground(java.awt.Color colorBG)
    Sets the background color which is used to draw the background when barcode is not drawn transparently
    Overrides:
    setBackground in class java.awt.Component

    getForeground

    public java.awt.Color getForeground()
    Returns the foreground color
    Overrides:
    getForeground in class java.awt.Component

    setForeground

    public void setForeground(java.awt.Color colorBar)
    Sets the foreground color which is used to draw the bars and texts
    Overrides:
    setForeground in class java.awt.Component

    getBarMessage

    public java.lang.String getBarMessage()
    Returns barcode's message

    setBarMessage

    public void setBarMessage(java.lang.String value)
    Sets the message to be converted to the barcode

    getBarSupplement

    public java.lang.String getBarSupplement()
    Returns barcode's supplement. It is valid only if barcode's symbology is BARUPCA, BARUPCE, BAREAN13, BAREAN8, BARJAN13, BARJAN8

    setBarSupplement

    public void setBarSupplement(java.lang.String value)
    Sets barcode's supplement. It is valid only if barcode's symbology is BARUPCA, BARUPCE, BAREAN13, BAREAN8, BARJAN13, BARJAN8

    getBarTopComment

    public java.lang.String getBarTopComment()
    Returns a string specifying top comment

    setBarTopComment

    public void setBarTopComment(java.lang.String topComment)
    Sets top comment of the barcode

    getBarBottomComment

    public java.lang.String getBarBottomComment()
    Returns bottom comment of the barcode

    setBarBottomComment

    public void setBarBottomComment(java.lang.String bottomComment)
    Sets bottom comment of the barcode

    getBarHeight

    public short getBarHeight()
    Returns barcode's height in Point(1/72 inch) unit

    setBarHeight

    public void setBarHeight(short shHeight)
    Sets barcode's height in Point(1/72 inch) unit;

    getBarOrientation

    public int getBarOrientation()
    Returns barcode's orientation, it must be one of ORIENT0, ORIENT90, ORIENT180, ORIENT270.

    getBarOrientation

    public void setBarOrientation(int iOrient)
    Sets barcode's orientation, iOrient must be one of ORIENT0, ORIENT90, ORIENT180, ORIENT270.

    getBarQuietZone

    public short getBarQuietZone()
    Returns width of the quiet zone in Point(1/72 inch) unit

    setBarQuietZone

    public void setBarQuietZone(short shQuietZone)
    Sets barcode's quiet zone in Point(1/72 inch) unit

    getBarRatio

    public float getBarRatio()
    Returns barcode's ratio which is wide bar ove narrow bar

    setBarRatio

    public void setBarRatio(float fRatio)
    Sets barcode's ratio

    getBarHRFont

    public java.awt.Font getBarHRFont()
    Returns barcode's font for human readable message

    setBarHRFont

    public void setBarHRFont(java.awt.Font fnewFont)
    Sets barcode's font for human readable message

    getBarTopCommentFont

    public java.awt.Font getBarTopCommentFont()
    Returns barcode's font for top comment

    setBarTopCommentFont

    public void setBarTopCommentFont(java.awt.Font topFont)
    Sets barcode's font for top comment

    getBarBottomCommentFont

    public java.awt.Font getBarBottomCommentFont()
    Returns barcode's font for bottom comment

    setBarBottomCommentFont

    public void setBarBottomCommentFont(java.awt.Font bottomFont)
    Sets barcode's font for bottom comment

    getBarTransparent

    public boolean getBarTransparent()
    Returns if the barcode is drawn transparently

    setBarTransparent

    public void setBarTransparent(boolean btran)
    Specifies if the barcode is drawn transparently.

    getBarCheckEnable

    public boolean getBarCheckEnable()
    Returns if check digits is enabled

    setBarCheckEnable

    public void setBarCheckEnable(boolean bCheck)
    Specifies if check digits is enabled

    getBarHRDisplay

    public boolean getBarHRDisplay()
    Returns if human readable is displayed

    setBarHRDisplay

    public void setBarHRDisplay(boolean bDisplay)
    Specifies if human readable message is displayed

    getBarBearerMode

    public boolean getBarBearerMode()
    Returns if bearer bar is drawn

    setBarBearerMode

    public void setBarBearerMode(boolean bMode)
    Specifies if bearer bar is drawn

    getBarBorderStyle

    public int getBarBorderStyle()
    Returns border style of the barcode, possible values are
    BORDERNONE No border is drawn
    BORDERNBROKENLINE Border is drawn in thin broken lines
    BORDERWBROKENLINE Border is drawn in thick broken lines
    BORDERNSOLIDLINE Border is drawn in thin solid lines
    BORDERWSOLIDLINE Border is drawn in thick solid lines
     
    

    setBarBorderStyle

    public void setBarBorderStyle(int istyle)
    Sets the border style of the barcode

    getBarCommentAlignStyle

    public int getBarCommentAlignStyle()
    Returns comment's align style, possible values are
    ALIGNCENTERTop and bottom comments are aligned with barcode in center
    ALIGNLEFT  Top and bottom comments are aligned with barcode in left
    ALIGNRIGHT Top and bottom comments are aligned with barcode in right

     


    setBarCommentAlignStyle

    public void setBarCommentAlignStyle(int istyle)
    Sets the comment align style of the barcode

    getBarNarrowWidth

    public short getBarNarrowWidth()
    Returns the width of the barcode in Point(1/72 inch) unit

    setBarNarrowWidth

    public void setBarNarrowWidth(short shWidth)
    Sets the barwidth of the barcode in Point(1/72 inch) unit

    paintBar

    protected void paintBar(java.awt.Graphics g,Point ptLeftTop)
    Paint the barocde.   g is the Graphics object; ptLeftTop specifies the left top postion of the barcode. Use this method to either render or print the barcode in any Graphic object.

    paint

    public void paint(java.awt.Graphics g)
    Overrides:
    paint in class java.awt.Component

    IsOpaque

    public boolean IsOpaque()

    addPropertyChangeListener

    public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
    Overrides:
    addPropertyChangeListener in class java.awt.Component

    removePropertyChangeListener

    public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
    Overrides:
    removePropertyChangeListener in class java.awt.Component