JBarCodePro
Class BarCodeBean
java.lang.Object
|
+--java.awt.Component
|
+--java.awt.Container
|
+--javax.swing.JComponent
|
+--dsx.JBarCodePro2.BarCodeBean
- public class BarCodeBean
- extends javax.swing.JComponent
- implements java.io.Serializable
- See Also:
- Serialized Form
Inner classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent |
Fields inherited from class javax.swing.JComponent |
accessibleContext,
listenerList,
TOOL_TIP_TEXT_KEY,
ui,
UNDEFINED_CONDITION,
WHEN_ANCESTOR_OF_FOCUSED_COMPONENT,
WHEN_FOCUSED,
WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT,
CENTER_ALIGNMENT,
LEFT_ALIGNMENT,
RIGHT_ALIGNMENT,
TOP_ALIGNMENT |
Constructor Summary |
BarCodeBean()
Creates new BarCodeBean |
Methods inherited from class javax.swing.JComponent |
addAncestorListener,
addNotify,
addVetoableChangeListener,
computeVisibleRect,
contains,
createToolTip,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
fireVetoableChange,
getAccessibleContext,
getActionForKeyStroke,
getAlignmentX,
getAlignmentY,
getAutoscrolls,
getBorder,
getBounds,
getClientProperty,
getComponentGraphics,
getConditionForKeyStroke,
getDebugGraphicsOptions,
getGraphics,
getHeight,
getInsets,
getInsets,
getLocation,
getMaximumSize,
getMinimumSize,
getNextFocusableComponent,
getRegisteredKeyStrokes,
getRootPane,
getSize,
getToolTipLocation,
getToolTipText,
getToolTipText,
getTopLevelAncestor,
getUIClassID,
getVisibleRect,
getWidth,
getX,
getY,
grabFocus,
hasFocus,
isDoubleBuffered,
isFocusCycleRoot,
isFocusTraversable,
isLightweightComponent,
isManagingFocus,
isOpaque,
isOptimizedDrawingEnabled,
isPaintingTile,
isRequestFocusEnabled,
isValidateRoot,
paintBorder,
paintChildren,
paintComponent,
paintImmediately,
paintImmediately,
paramString,
processComponentKeyEvent,
processFocusEvent,
processKeyEvent,
processMouseMotionEvent,
putClientProperty,
registerKeyboardAction,
registerKeyboardAction,
removeAncestorListener,
removeNotify,
removeVetoableChangeListener,
repaint,
repaint,
requestDefaultFocus,
requestFocus,
resetKeyboardActions,
reshape,
revalidate,
scrollRectToVisible,
setAlignmentX,
setAlignmentY,
setAutoscrolls,
setBorder,
setDebugGraphicsOptions,
setDoubleBuffered,
setEnabled,
setFont,
setMaximumSize,
setMinimumSize,
setNextFocusableComponent,
setOpaque,
setPreferredSize,
setRequestFocusEnabled,
setToolTipText,
setUI,
setVisible,
unregisterKeyboardAction,
update,
updateUI |
Methods inherited from class java.awt.Container |
add,
add,
add,
add,
add,
addContainerListener,
addImpl,
countComponents,
deliverEvent,
doLayout,
findComponentAt,
findComponentAt,
getComponent,
getComponentAt,
getComponentAt,
getComponentCount,
getComponents,
getLayout,
insets,
invalidate,
isAncestorOf,
layout,
list,
list,
locate,
minimumSize,
paintComponents,
preferredSize,
printComponents,
processContainerEvent,
processEvent,
remove,
remove,
removeAll,
removeContainerListener,
setLayout,
validate,
validateTree |
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 |
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
BARPOSTNET
public static final int BARPOSTNET
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
SCALEENGLISH
public static final int SCALEENGLISH
SCALEMETRIC
public static final int SCALEMETRIC
SCALEPOINT
public static final int SCALEPOINT
ORIENT0
public static final int ORIENT0
ORIENT90
public static final int ORIENT90
ORIENT180
public static final int ORIENT180
ORIENT270
public static final int ORIENT270
CODE128A
public static final int CODE128A
CODE128B
public static final int CODE128B
CODE128C
public static final int CODE128C
CODE128AUTO
public static final int CODE128AUTO
BarCodeBean
public BarCodeBean()
- Default constructor
putPngImageToStream
public boolean putPngImageToStream(java.io.OutputStream os)
- Convert barcode into PNG image and put it in
output stream. This function can be used to save barcode into a file,
to send the image of the barcode to a browser. Note: All dimensions of the barcode are converted into Point(1/72 inch).
POSTNET barcode is not supported.
putPngImageToFile
public boolean putPngImageToFile(java.lang.String sFileName)
-
Convert barcode into PNG image and put it in a
file. Note: All dimensions of the barcode
are converted into Point(1/72 inch). POSTNET barcode is not
supported.
sFileName: image file name
getBarImage
public java.awt.Image getBarImage()
Returns Image of the barcode;
getBarScaleMode
public int getBarScaleMode()
-
Returns the unit system used in physical dimension such as height, narrow bar width, quiet zone, etc. Possible values are
- SCALEENGLISH: if dimension is in mils(0.001 inch)
- SCALEMETRIC: if dimension is in metric(0.01millimeter)
- SCALEPOINT: if dimension is in points(1/72 inch)
setBarScaleMode
public void setBarScaleMode(int iUnit)
Sets the unit system used in physical dimension. Please refer to getBarScaleMode()
getPreferredSize
public java.awt.Dimension getPreferredSize()
- Overrides:
- getPreferredSize in class
javax.swing.JComponent
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
Value | Description of Symbologies |
BAR11 | Code 11 |
CODABAR | Codabar |
BARMSI | Presley or MSI |
BAR39 | Code 39 |
EXTBAR39 | Extended Code 39 |
BAR93 | Code 93 |
BAR128 | Code 128 |
BAREAN128 | EAN 128 |
BARUPCA | UPCA |
BARUPCE | UPCE |
BAREAN13 | EAN13 |
BAREAN8 | EAN8 |
BARJAN13 | JAN13 |
BARJAN8 | JAN8 |
BARHIBCLIC39 | HIBC with Code 39 |
BARHIBCLIC128 | HIBC with Code 128 |
BARHIBCEAN128 | HIBC with EAN 128 |
BARHIBCIN25 | HIBC with Interleaved 2 of 5 |
BARIN25 | Interleaved 2 of 5 |
BARPOSTNET | PostNet |
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
javax.swing.JComponent
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
javax.swing.JComponent
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. The unit of the returned value depends on the value set by setScaledMode()
setBarHeight
public void setBarHeight(short shHeight)
-
Sets barcode's height. The value passed is in the unit set by by setScaledMode()
getBarQuietZone
public short getBarQuietZone()
-
Returns barcode's quiet zone. The returned value is in the unit set by setScaledMode()
setBarQuietZone
public void setBarQuietZone(short shQuietZone)
-
Sets barcode's quiet zone. The value passed in shQuietZone is in the unit set by setScaledMode()
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
getBarOrientation
public int getBarOrientation()
-
Returns barcode's orientation, possible values are
ORIENT0 | 0 degree |
RIENT90 | 90 clockwise |
ORIENT180 | 180 clockwise |
ORIENT270 | 270 clockwise |
-
setBarOrientation
public void setBarOrientation(int iOrient)
-
Sets barcode's orientation
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
ALIGNCENTER | Top 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 unit specifed in setBarScaledMode()
setBarNarrowWidth
public void setBarNarrowWidth(short shWidth)
-
Sets the barwidth of the barcode in unit specifed in setBarScaledMode()
paintBar
protected void paintBar(java.awt.Graphics g)
-
paint
public void paint(java.awt.Graphics g)
- Overrides:
- paint in class
javax.swing.JComponent
print
public void print(java.awt.Graphics g)
- Print the barocde.
-
- Overrides:
- print in class java.awt.Container
IsOpaque
public boolean IsOpaque()
addPropertyChangeListener
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
- Overrides:
- addPropertyChangeListener in class
javax.swing.JComponent
removePropertyChangeListener
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
- Overrides:
- removePropertyChangeListener in class
javax.swing.JComponent