Package com.idautomation.qrcode
Class QRCode
java.lang.Object
java.awt.Component
java.awt.Canvas
com.idautomation.qrcode.QRCode
- All Implemented Interfaces:
ImageObserver,MenuContainer,Serializable,Accessible
This is the main QRCode class that generates the QRCode barcode image.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.awt.Component
Component.BaselineResizeBehavior -
Field Summary
FieldsFields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanGets the applyTilde property.booleanGets the autoSize property.Gets the backColor property.booleanGets the bestMask property.Gets the code property.Gets the encodingMode property.Gets the errorCorrectionLevel property.Gets the barColor property.doubleGets the leftMarginCM property.Gets the minimum size in pixels of the barcode image generated.intGets the resolution property.Gets the size in pixels of the Preferred barcode image generated.intGets the quietZone property.intGets the rotate property.doubleGets the topMarginCM property.intGets the version property.doubleGets the X property.voidPaints the barcode and rotates it if necessaryvoidsetApplyTilde(boolean newVal) Sets the applyTilde property.voidsetAutoSize(boolean newVal) Sets the autoSize property.voidsetBackground(Color newColor) Sets the backColor property.voidsetBestMask(boolean newVal) Sets the bestMask property.voidsetDataToEncode(String newCode) Sets the code property.voidsetEncodingMode(String newVal) Sets the encodingMode property.voidsetErrorCorrectionLevel(String newVal) Sets the errorCorrectionLevel property.voidsetForeground(Color newColor) Sets the barColor property.voidsetImageSize(int imgWidth, int imgHeight) Sets the size of the generated image, if used then autoSize is set to false.voidsetLeftMarginCM(double newMargin) Sets the leftMarginCM property.voidsetPixelsPerCM(int newRes) Sets the resolution property.voidsetQuietZone(int newQuietZone) Sets the quietZone property.voidsetRotationAngle(int newRotate) Sets the rotate property.voidsetTopMarginCM(double newMargin) Sets the topMarginCM property.voidsetVersion(int newVal) Sets the version property.voidsetXDimensionCM(double newX) Sets the X property.Methods inherited from class java.awt.Canvas
addNotify, createBufferStrategy, createBufferStrategy, getAccessibleContext, getBufferStrategy, updateMethods 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, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, 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, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, revalidate, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setMixingCutoutShape, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, validate
-
Field Details
-
code
Data to be encoded in a QRCode symbol.
-
-
Constructor Details
-
QRCode
public QRCode()
-
-
Method Details
-
setDataToEncode
Sets the code property.- Parameters:
newCode- the new value for the code variable.- See Also:
-
getDataToEncode
Gets the code property.- Returns:
- the current value of the code variable.
- See Also:
-
setQuietZone
public void setQuietZone(int newQuietZone) Sets the quietZone property.- Parameters:
newQuietZone- the new value for the quietZone variable.- See Also:
-
quietZone- User Manual
-
getQuietZone
public int getQuietZone()Gets the quietZone property.- Returns:
- the current value of the quietZone variable.
- See Also:
-
quietZone- User Manual
-
setLeftMarginCM
public void setLeftMarginCM(double newMargin) Sets the leftMarginCM property.- Parameters:
newMargin- the new value for the leftMarginCM variable.- See Also:
-
leftMarginCM- User Manual
-
getLeftMarginCM
public double getLeftMarginCM()Gets the leftMarginCM property.- Returns:
- the current value of the leftMarginCM variable.
- See Also:
-
leftMarginCM- User Manual
-
setTopMarginCM
public void setTopMarginCM(double newMargin) Sets the topMarginCM property.- Parameters:
newMargin- the new value for the topMarginCM variable.- See Also:
-
topMarginCM- User Manual
-
getTopMarginCM
public double getTopMarginCM()Gets the topMarginCM property.- Returns:
- the current value of the topMarginCM variable.
- See Also:
-
topMarginCM- User Manual
-
setBestMask
public void setBestMask(boolean newVal) Sets the bestMask property.- Parameters:
newVal- the new value for the bestMask variable.- See Also:
-
bestMask- User Manual
-
getBestMask
public boolean getBestMask()Gets the bestMask property.- Returns:
- the current value of the bestMask variable.
- See Also:
-
bestMask- User Manual
-
setApplyTilde
public void setApplyTilde(boolean newVal) Sets the applyTilde property.- Parameters:
newVal- the new value for the applyTilde variable.- See Also:
-
applyTilde- User Manual
-
getApplyTilde
public boolean getApplyTilde()Gets the applyTilde property.- Returns:
- the current value of the applyTilde variable.
- See Also:
-
applyTilde- User Manual
-
setVersion
public void setVersion(int newVal) Sets the version property.- Parameters:
newVal- the new value for the version variable.- See Also:
-
version- User Manual
-
getVersion
public int getVersion()Gets the version property.- Returns:
- the current value of the version variable.
- See Also:
-
version- User Manual
-
setErrorCorrectionLevel
Sets the errorCorrectionLevel property.- Parameters:
newVal- the new value for the errorCorrectionLevel variable.- See Also:
-
errorCorrectionLevel- User Manual
-
getErrorCorrectionLevel
Gets the errorCorrectionLevel property.- Returns:
- the current value of the errorCorrectionLevel variable.
- See Also:
-
errorCorrectionLevel- User Manual
-
setEncodingMode
Sets the encodingMode property.- Parameters:
newVal- the new value for the encodingMode variable.- See Also:
-
encodingMode- User Manual
-
getEncodingMode
Gets the encodingMode property.- Returns:
- the current value of the encodingMode variable.
- See Also:
-
encodingMode- User Manual
-
setBackground
Sets the backColor property.- Overrides:
setBackgroundin classComponent- Parameters:
newColor- the new value for the backColor variable.- See Also:
-
backColor- User Manual
-
getBackground
Gets the backColor property.- Overrides:
getBackgroundin classComponent- Returns:
- the current value of the backColor variable.
- See Also:
-
backColor- User Manual
-
setForeground
Sets the barColor property.- Overrides:
setForegroundin classComponent- Parameters:
newColor- the new value for the barColor variable.- See Also:
-
barColor- User Manual
-
getForeground
Gets the barColor property.- Overrides:
getForegroundin classComponent- Returns:
- the current value of the barColor variable.
- See Also:
-
barColor- User Manual
-
setPixelsPerCM
public void setPixelsPerCM(int newRes) Sets the resolution property.- Parameters:
newRes- the new value for the resolution variable.- See Also:
-
resolution- User Manual
-
getPixelsPerCM
public int getPixelsPerCM()Gets the resolution property.- Returns:
- the current value of the resolution variable.
- See Also:
-
resolution- User Manual
-
setXDimensionCM
public void setXDimensionCM(double newX) Sets the X property.- Parameters:
newX- the new value for the X variable.- See Also:
-
getXDimensionCM
public double getXDimensionCM()Gets the X property.- Returns:
- the current value of the X variable.
- See Also:
-
setAutoSize
public void setAutoSize(boolean newVal) Sets the autoSize property.- Parameters:
newVal- the new value for the autoSize variable.- See Also:
-
autoSize- User Manual
-
getAutoSize
public boolean getAutoSize()Gets the autoSize property.- Returns:
- the current value of the autoSize variable.
- See Also:
-
autoSize- User Manual
-
setImageSize
public void setImageSize(int imgWidth, int imgHeight) Sets the size of the generated image, if used then autoSize is set to false.- See Also:
-
getPreferredSize
Gets the size in pixels of the Preferred barcode image generated.- Overrides:
getPreferredSizein classComponent- Returns:
- Dimension(pWidth,pHeight)
- See Also:
-
pWidthpHeight- User Manual
-
getMinimumSize
Gets the minimum size in pixels of the barcode image generated.- Overrides:
getMinimumSizein classComponent- Returns:
- Dimension(8,8)
- See Also:
-
setRotationAngle
public void setRotationAngle(int newRotate) Sets the rotate property.- Parameters:
newRotate- the new value for the rotate variable.- See Also:
-
rotate- User Manual
-
getRotationAngle
public int getRotationAngle()Gets the rotate property.- Returns:
- the current value of the rotate variable.
- See Also:
-
rotate- User Manual
-
paint
Paints the barcode and rotates it if necessary -
createSVG
-
createEPS
-