|
||||||||||
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.onecode.OneCode
This class creates OneCode symbols. Since it is a subclass of java.awt.Canvas it can be added to any Java container.
OneCode barcode=new OneCode();
barcode.setRoutingCode("");
barcode.setBarcodeIdentifier(01);
barcode.setSpecialServices(234);
barcode.setCustomerIdentifier(567094);
barcode.setSequenceNumber(987654321);
barcode.setSize(300,300);
ImageEncoder be= new ImageEncoder(barcode,"JPEG","barcode.jpg");
If you want to create gif or png files you will need to download the encoders:
- gif encoder from http://www.acme.com/resources/classes/Acme.tar.gz
- png encoder http://209.51.137.74/pngencoder-1.0.jar
The barcode can also be painted in a external graphic context, for example an image:
java.awt.image.BufferedImage im=new java.awt.image.BufferedImage(barcode.getWidth(),barcode.getHeight(),java.awt.image.BufferedImage.TYPE_INT_RGB);
Graphics g2=im.createGraphics();
barcode.paint(g2);
Field Summary |
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 | |
OneCode()
|
Method Summary | |
java.awt.Color |
getBackColor()
background color. |
int |
getBarcodeIdentifier()
barcode Identifier (2 digits, second digit must be 0-4) |
java.awt.Color |
getBarColor()
color of the bars. |
int |
getBarHeight()
length of bars without ascender and descender |
int |
getBarSpacing()
space between bars |
int |
getBarWidth()
size (width) of the bars (module). |
int |
getCurrentX()
get last X possition. |
int |
getCurrentY()
get last Y possition. |
int |
getCustomerIdentifier()
customer Identifier (6 digits) |
int |
getExtendedBarHeight()
height of full bar with ascender and descender |
java.awt.Color |
getFontColor()
font color for user text |
int |
getLeftMargin()
left margin of the barcode (also know as quite zone). |
java.lang.String |
getName()
Returns "OneCode". |
int |
getQuiteZone()
distance between bars and text |
boolean |
getRedraw()
Redraw symbol |
java.lang.String |
getRoutingCode()
routing code 0, 5, 9 or 11 digits |
int |
getSequenceNumber()
sequence number ( 9 digits ) |
int |
getSpecialServices()
Special Services (3 digits) |
java.awt.Font |
getTextFont()
font for user text |
int |
getTopMargin()
top margin of the barcode (also know as quite zone). |
java.lang.String[] |
getUserTextBottom()
user text be displayed below the barcode |
java.lang.String[] |
getUserTextTop()
user text be displayed over the barcode |
void |
paint(java.awt.Graphics g)
paints the symbol. |
void |
setBackColor(java.awt.Color c)
background color. |
void |
setBarcodeIdentifier(int i)
barcode Identifier (2 digits, second digit must be 0-4) |
void |
setBarColor(java.awt.Color c)
color of the bars. |
void |
setBarHeight(int b)
length of bars without ascender and descender |
void |
setBarSpacing(int d)
space between bars |
void |
setBarWidth(int d)
size (width) of the bars (module). |
void |
setCustomerIdentifier(int i)
customer Identifier (6 digits) |
void |
setExtendedBarHeight(int b)
height of full bar with ascender and descender |
void |
setFontColor(java.awt.Color c)
font color for user text |
void |
setLeftMargin(int d)
left margin of the barcode (also know as quite zone). |
void |
setQuiteZone(int b)
distance between bars and text |
void |
setRedraw(boolean b)
Redraw symbol. |
void |
setRoutingCode(java.lang.String s)
routing code 0, 5, 9 or 11 digits |
void |
setSequenceNumber(int n)
sequence number ( 9 digits ) |
void |
setSpecialServices(int i)
Special Services (3 digits) |
void |
setTextFont(java.awt.Font f)
font for user text |
void |
setTopMargin(int d)
top margin of the barcode (also know as quite zone). |
void |
setUserTextBottom(java.lang.String[] t)
user text be displayed below the barcode |
void |
setUserTextTop(java.lang.String[] t)
user text be displayed over the barcode |
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, 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, 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 |
Constructor Detail |
public OneCode()
Method Detail |
public java.awt.Color getFontColor()
public void setFontColor(java.awt.Color c)
public java.awt.Font getTextFont()
public void setTextFont(java.awt.Font f)
public int getSpecialServices()
public void setSpecialServices(int i)
public int getBarcodeIdentifier()
public void setBarcodeIdentifier(int i)
public int getCustomerIdentifier()
public void setCustomerIdentifier(int i)
public int getSequenceNumber()
public void setSequenceNumber(int n)
n
- public java.lang.String getRoutingCode()
public void setRoutingCode(java.lang.String s)
public int getLeftMargin()
public void setLeftMargin(int d)
public int getTopMargin()
public void setTopMargin(int d)
public boolean getRedraw()
public void setRedraw(boolean b)
public java.awt.Color getBackColor()
public void setBackColor(java.awt.Color c)
public java.awt.Color getBarColor()
public void setBarColor(java.awt.Color c)
public int getBarSpacing()
public void setBarSpacing(int d)
public int getBarHeight()
public void setBarHeight(int b)
public int getExtendedBarHeight()
public void setExtendedBarHeight(int b)
public int getQuiteZone()
public void setQuiteZone(int b)
public java.lang.String[] getUserTextTop()
public void setUserTextTop(java.lang.String[] t)
public java.lang.String[] getUserTextBottom()
public void setUserTextBottom(java.lang.String[] t)
public java.lang.String getName()
getName
in class java.awt.Component
public int getBarWidth()
public void setBarWidth(int d)
public void paint(java.awt.Graphics g)
paint
in class java.awt.Canvas
public int getCurrentX()
public int getCurrentY()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |