|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Canvas | +--com.java4less.rss.BarCode
Class used to create EAN and UPC barcodes with or without 2D component. This is a canvas object where the barcode will be painted. Example of use:
BarCode r=new BarCode(); r.setSymbology(r.EAN128); r.setCode("0193812345678901"); r.setHumanReadableCode("(01)93812345678901"); // create a composite barcode r.setEAN128WithCCC(true); r.setSecondaryCode("10ABCD123456#4103898765432108"); r.setSize(300,300); new ImageEncoder(r,"JPEG","c:\\barcode.jpg");
Field Summary | |
static int |
EAN128
|
static int |
EAN13
|
static int |
EAN8
|
double |
H
height of bars. |
int |
L
Symbol lentgh as multiplier of X. |
static int |
RSS14
|
static int |
RSSEXPANDED
|
static int |
RSSLIMITED
|
static int |
UPCA
|
static int |
UPCE
|
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 | |
void |
barHeight2D(int h)
bar height of the 2D component |
java.awt.Color |
getBackColor()
background color. |
java.awt.Color |
getBarColor()
color of the bars. |
int |
getBarHeight()
bar height in pixels. |
int |
getBarHeight2D()
bar height of the 2D component |
java.lang.String |
getBarType()
gets the symbology as String, valid values are EAN13, EAN8, UPCA, UPCE and EAN128 |
int |
getCCCColumns()
number of columns for the CC-C symbol when used with EAN128. |
java.lang.String |
getCode()
text to be painted as barcode. |
boolean |
getEAN128WithCCC()
if true the EAN128 will be linked to a CCC barcode, otherwise to a CC-A or CC-B |
boolean |
getEANUPCPrintFlag()
print first digit of the encoded value |
java.awt.Color |
getFontColor()
color of the human readable text. |
boolean |
getGuardBars()
if true (default), guardbars in EAN and UPC codes will be longer than data bars. |
double |
getH()
height of bars. |
java.lang.String |
getHumanReadableCode()
human readable version of the text to be painted as barcode. |
int |
getLeftMargin()
left margin of the barcode (also know as quite zone). |
java.lang.String |
getName()
Returns name of the component |
boolean |
getProcessTilde()
process ~ in code? |
int |
getRotate()
rotation angle. |
java.lang.String |
getSecondaryCode()
text to be painted as 2D component in the barcode. |
double |
getSupHeight()
height of the supplement. |
java.lang.String |
getSuplement()
supplement for EAN or UPC barcode |
int |
getSupSeparation()
Separation in pixels between the barcode and the supplement |
int |
getSymbology()
symbology to be used, EAN13, EAN8, UPCE, UPCA or EAN128 |
java.awt.Font |
getTextFont()
font of the text. |
int |
getTopMargin()
top margin of the barcode (also know as quite zone). |
boolean |
getUPCEANSupplement2()
2 digit supplement for EAN or UPC codes. |
boolean |
getUPCEANSupplement5()
5 digit supplement for EAN or UPC codes. |
java.lang.String |
getUPCESytem()
system to be used in UPCE. |
int |
getX()
size in pixels of modules (narrow bars or spaces). |
void |
paint(java.awt.Graphics g2)
paints the barcode and rotates it if necessary |
void |
setBackColor(java.awt.Color c)
background color. |
void |
setBarColor(java.awt.Color c)
color of the bars. |
void |
setBarHeight(int d)
bar height in pixels. |
void |
setBarType(java.lang.String t)
sets the symbology as String, valid values are EAN13, EAN8, UPCA, UPCE and EAN128 |
void |
setCCCColumns(int c)
number of columns for the CC-C symbol when used with EAN128. |
void |
setCode(java.lang.String c)
text to be painted as barcode. |
void |
setEAN128WithCCC(boolean b)
if true the EAN128 will be linked to a CCC barcode, otherwise to a CC-A or CC-B |
void |
setEANUPCPrintFlag(boolean b)
print first digit of the encoded value |
void |
setFontColor(java.awt.Color c)
color of the human readable text. |
void |
setGuardBars(boolean b)
if true (default), guardbars in EAN and UPC codes will be longer than data bars. |
void |
setH(double d)
height of bars. |
void |
setHumanReadableCode(java.lang.String c)
human readable version of the text to be painted as barcode. |
void |
setLeftMargin(int d)
|
void |
setProcessTilde(boolean pt)
process ~ in code? |
void |
setRotate(int i)
rotation angle. |
void |
setSecondaryCode(java.lang.String c)
text to be painted as 2D component in the barcode. |
void |
setSupHeight(double d)
height of the supplement. |
void |
setSuplement(java.lang.String c)
|
void |
setSupSeparation(int d)
Separation in pixels between the barcode and the supplement |
void |
setSymbology(int c)
symbology to be used, EAN13, EAN8, UPCE, UPCA or EAN128 |
void |
setTextFont(java.awt.Font f)
font of the text. |
void |
setTopMargin(int d)
top margin of the barcode (also know as quite zone). |
void |
setUPCEANSupplement2(boolean b)
2 digit supplement for EAN or UPC codes. |
void |
setUPCEANSupplement5(boolean b)
5 digit supplement for EAN or UPC codes. |
void |
setUPCESytem(java.lang.String d)
system to be used in UPCE. |
void |
setX(int d)
|
Methods inherited from class java.awt.Canvas |
addNotify, createBufferStrategy, createBufferStrategy, getAccessibleContext, getBufferStrategy, update |
Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, dispatchEvent, doLayout, enable, enable, enableInputMethods, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getParent, getPeer, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, 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, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, validate |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int UPCA
public static final int EAN13
public static final int EAN8
public static final int UPCE
public static final int EAN128
public static final int RSS14
public static final int RSSLIMITED
public static final int RSSEXPANDED
public double H
public int L
Constructor Detail |
public BarCode()
Method Detail |
public int getCCCColumns()
public void setCCCColumns(int c)
public boolean getEANUPCPrintFlag()
public void setEANUPCPrintFlag(boolean b)
public boolean getEAN128WithCCC()
public void setEAN128WithCCC(boolean b)
public int getBarHeight2D()
public void barHeight2D(int h)
public java.lang.String getCode()
public void setCode(java.lang.String c)
public java.lang.String getSecondaryCode()
public void setSecondaryCode(java.lang.String c)
public java.lang.String getHumanReadableCode()
public void setHumanReadableCode(java.lang.String c)
public int getSymbology()
public void setSymbology(int c)
public java.lang.String getBarType()
public void setBarType(java.lang.String t)
public int getLeftMargin()
public void setLeftMargin(int d)
public int getTopMargin()
public void setTopMargin(int d)
public java.lang.String getSuplement()
public void setSuplement(java.lang.String c)
public boolean getGuardBars()
public void setGuardBars(boolean b)
public java.awt.Color getBackColor()
public void setBackColor(java.awt.Color c)
public int getBarHeight()
public void setBarHeight(int d)
public java.awt.Font getTextFont()
public void setTextFont(java.awt.Font f)
public java.awt.Color getFontColor()
public void setFontColor(java.awt.Color c)
public java.awt.Color getBarColor()
public void setBarColor(java.awt.Color c)
public java.lang.String getUPCESytem()
public void setUPCESytem(java.lang.String d)
public boolean getUPCEANSupplement2()
public void setUPCEANSupplement2(boolean b)
public boolean getUPCEANSupplement5()
public void setUPCEANSupplement5(boolean b)
public int getX()
getX
in class java.awt.Component
public void setX(int d)
public double getH()
public void setH(double d)
public int getRotate()
public void setRotate(int i)
public int getSupSeparation()
public void setSupSeparation(int d)
public double getSupHeight()
public void setSupHeight(double d)
public java.lang.String getName()
getName
in class java.awt.Component
public boolean getProcessTilde()
public void setProcessTilde(boolean pt)
public void paint(java.awt.Graphics g2)
paint
in class java.awt.Canvas
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |