|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Canvas
com.java4less.raztec.AztecCode
public class AztecCode
This class creates Aztec Code symbols. Since it is a subclass of java.awt.Canvas it can be added to any Java container.
Image files can be created with the following code:
AztecCode barcode=new AztecCode();
barcode.setCode("ABC");
barcode.setSize(300,300);
com.java4less.encoder.ImageEncoder be= new com.java4less.encoder.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://users.boone.net/wbrameld/pngencoder
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);
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 | |
---|---|
AztecCode()
|
Method Summary | |
---|---|
boolean |
getAutoConfigurate()
allow automatic selection of a larger configuration (than the preferred) if code is too large. |
java.awt.Color |
getbackColor()
background color. |
java.awt.Color |
getbarColor()
color of the bars. |
java.lang.String |
getCode()
text to be painted as barcode. |
int[] |
getCodeBinary()
bytes to be painted as barcode. |
int |
getConfigurationType()
use this property to define which formats can be used: CONFIGURATION_ANY (any), CONFIGURATION_COMPACT (only compact formats) or CONFIGURATION_FULL (only full range formats). |
int |
getCurrentX()
get last X possition. |
int |
getCurrentY()
get last Y possition. |
int |
getEncoding()
Encoding, NORMAL or BINARY |
int |
getErrorCorrectionLevel()
Error correction level (5% to 95%). |
java.lang.String |
getFileId()
file id in structured append |
int |
getMargin()
margin of the barcode (also know as quite zone). |
double |
getModuleSize()
size (width) of the bars (module). |
java.lang.String |
getName()
Returns "RAztecCode". |
int |
getPreferredConfiguration()
use this configuration if possible |
boolean |
getProcessTilde()
process tilde. |
boolean |
getReaderInitilization()
activate reader initialization bit |
boolean |
getRedraw()
Redraw symbol |
int |
getRune()
Aztec rune's. |
boolean |
getStructuredAppend()
activate structured append |
int |
getStructuredAppendCounter()
number of symbols in structured append (value 2 to 26) |
int |
getStructuredAppendIndex()
current symbol in structured append (value 1 to 26) |
void |
paint(java.awt.Graphics g)
paints the symbol. |
void |
setAutoConfigurate(boolean pt)
allow automatic selection of a larger configuration (than the preferred) if code is too large. |
void |
setbackColor(java.awt.Color c)
background color. |
void |
setbarColor(java.awt.Color c)
color of the bars. |
void |
setCode(int[] c)
bytes to be painted as barcode. |
void |
setCode(java.lang.String c)
text to be painted as barcode. |
void |
setConfigurationType(int pt)
use this property to define which formats can be used: CONFIGURATION_ANY (any), CONFIGURATION_COMPACT (only compact formats) or CONFIGURATION_FULL (only full range formats). |
void |
setEncoding(int d)
Encoding, NORMAL or BINARY |
void |
setErrorCorrectionLevel(int d)
Error correction level (5% to 95%). |
void |
setFileId(java.lang.String s)
file id in structured append |
void |
setMargin(int d)
margin of the barcode (also know as quite zone). |
void |
setModuleSize(int d)
size (width) of the bars (module). |
void |
setPreferredConfiguration(int r)
use this configuration if possible |
void |
setProcessTilde(boolean pt)
process tilde. |
void |
setReaderInitilization(boolean b)
activate reader initialization bit |
void |
setRedraw(boolean b)
Redraw symbol. |
void |
setRune(int e)
Aztec rune's. |
void |
setStructuredAppend(boolean b)
activate structured append |
void |
setStructuredAppendCounter(int i)
number of symbols in structured append (value 2 to 26) |
void |
setStructuredAppendIndex(int i)
current symbol in structured append (value 1 to 26) |
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, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, 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, getMousePosition, 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, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, 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, setMaximumSize, setMinimumSize, setName, setPreferredSize, 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 int CONFIGURATION_ANY
public static int CONFIGURATION_COMPACT
public static int CONFIGURATION_FULL
public static int CONFIGURATION_15X15_COMPACT
public static int CONFIGURATION_19X19
public static int CONFIGURATION_19X19_COMPACT
public static int CONFIGURATION_23X23
public static int CONFIGURATION_23X23_COMPACT
public static int CONFIGURATION_27X27
public static int CONFIGURATION_27X27_COMPACT
public static int CONFIGURATION_31X31
public static int CONFIGURATION_37X37
public static int CONFIGURATION_41X41
public static int CONFIGURATION_45X45
public static int CONFIGURATION_49X49
public static int CONFIGURATION_53X53
public static int CONFIGURATION_57X57
public static int CONFIGURATION_61X61
public static int CONFIGURATION_67X67
public static int CONFIGURATION_71X71
public static int CONFIGURATION_75X75
public static int CONFIGURATION_79X79
public static int CONFIGURATION_83X83
public static int CONFIGURATION_87X87
public static int CONFIGURATION_91X91
public static int CONFIGURATION_95X95
public static int CONFIGURATION_101X101
public static int CONFIGURATION_105X105
public static int CONFIGURATION_109X109
public static int CONFIGURATION_113X113
public static int CONFIGURATION_117X117
public static int CONFIGURATION_121X121
public static int CONFIGURATION_125X125
public static int CONFIGURATION_131X131
public static int CONFIGURATION_135X135
public static int CONFIGURATION_139X139
public static int CONFIGURATION_143X143
public static int CONFIGURATION_147X147
public static int CONFIGURATION_151X151
public static int ENC_NORMAL
public static int ENC_BINARY
Constructor Detail |
---|
public AztecCode()
Method Detail |
---|
public int getPreferredConfiguration()
public void setPreferredConfiguration(int r)
public java.lang.String getCode()
public void setCode(java.lang.String c)
public int[] getCodeBinary()
public void setCode(int[] c)
public int getMargin()
public void setMargin(int d)
public int getEncoding()
public void setEncoding(int d)
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 java.lang.String getName()
getName
in class java.awt.Component
public double getModuleSize()
public void setModuleSize(int d)
public int getErrorCorrectionLevel()
public void setErrorCorrectionLevel(int d)
public boolean getProcessTilde()
public void setProcessTilde(boolean pt)
public boolean getRedraw()
public void setRedraw(boolean b)
public boolean getAutoConfigurate()
public void setAutoConfigurate(boolean pt)
public int getConfigurationType()
public void setConfigurationType(int pt)
public void setStructuredAppend(boolean b)
public boolean getStructuredAppend()
public void setFileId(java.lang.String s)
public java.lang.String getFileId()
public void setStructuredAppendCounter(int i)
public int getStructuredAppendCounter()
public void setStructuredAppendIndex(int i)
public int getStructuredAppendIndex()
public void setReaderInitilization(boolean b)
public boolean getReaderInitilization()
public void paint(java.awt.Graphics g)
paint
in class java.awt.Canvas
public void setRune(int e)
public int getRune()
public int getCurrentX()
public int getCurrentY()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |