Class QRCode

java.lang.Object
java.awt.Component
java.awt.Canvas
com.idautomation.qrcode.QRCode
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class QRCode extends Canvas implements Serializable
This is the main QRCode class that generates the QRCode barcode image.
See Also:
  • Field Details

  • Constructor Details

    • QRCode

      public QRCode()
  • Method Details

    • setDataToEncode

      public void setDataToEncode(String newCode)
      Sets the code property.
      Parameters:
      newCode - the new value for the code variable.
      See Also:
    • getDataToEncode

      public String 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:
    • getQuietZone

      public int getQuietZone()
      Gets the quietZone property.
      Returns:
      the current value of the quietZone variable.
      See Also:
    • setLeftMarginCM

      public void setLeftMarginCM(double newMargin)
      Sets the leftMarginCM property.
      Parameters:
      newMargin - the new value for the leftMarginCM variable.
      See Also:
    • getLeftMarginCM

      public double getLeftMarginCM()
      Gets the leftMarginCM property.
      Returns:
      the current value of the leftMarginCM variable.
      See Also:
    • setTopMarginCM

      public void setTopMarginCM(double newMargin)
      Sets the topMarginCM property.
      Parameters:
      newMargin - the new value for the topMarginCM variable.
      See Also:
    • getTopMarginCM

      public double getTopMarginCM()
      Gets the topMarginCM property.
      Returns:
      the current value of the topMarginCM variable.
      See Also:
    • setBestMask

      public void setBestMask(boolean newVal)
      Sets the bestMask property.
      Parameters:
      newVal - the new value for the bestMask variable.
      See Also:
    • getBestMask

      public boolean getBestMask()
      Gets the bestMask property.
      Returns:
      the current value of the bestMask variable.
      See Also:
    • setApplyTilde

      public void setApplyTilde(boolean newVal)
      Sets the applyTilde property.
      Parameters:
      newVal - the new value for the applyTilde variable.
      See Also:
    • getApplyTilde

      public boolean getApplyTilde()
      Gets the applyTilde property.
      Returns:
      the current value of the applyTilde variable.
      See Also:
    • setVersion

      public void setVersion(int newVal)
      Sets the version property.
      Parameters:
      newVal - the new value for the version variable.
      See Also:
    • getVersion

      public int getVersion()
      Gets the version property.
      Returns:
      the current value of the version variable.
      See Also:
    • setErrorCorrectionLevel

      public void setErrorCorrectionLevel(String newVal)
      Sets the errorCorrectionLevel property.
      Parameters:
      newVal - the new value for the errorCorrectionLevel variable.
      See Also:
    • getErrorCorrectionLevel

      public String getErrorCorrectionLevel()
      Gets the errorCorrectionLevel property.
      Returns:
      the current value of the errorCorrectionLevel variable.
      See Also:
    • setEncodingMode

      public void setEncodingMode(String newVal)
      Sets the encodingMode property.
      Parameters:
      newVal - the new value for the encodingMode variable.
      See Also:
    • getEncodingMode

      public String getEncodingMode()
      Gets the encodingMode property.
      Returns:
      the current value of the encodingMode variable.
      See Also:
    • setBackground

      public void setBackground(Color newColor)
      Sets the backColor property.
      Overrides:
      setBackground in class Component
      Parameters:
      newColor - the new value for the backColor variable.
      See Also:
    • getBackground

      public Color getBackground()
      Gets the backColor property.
      Overrides:
      getBackground in class Component
      Returns:
      the current value of the backColor variable.
      See Also:
    • setForeground

      public void setForeground(Color newColor)
      Sets the barColor property.
      Overrides:
      setForeground in class Component
      Parameters:
      newColor - the new value for the barColor variable.
      See Also:
    • getForeground

      public Color getForeground()
      Gets the barColor property.
      Overrides:
      getForeground in class Component
      Returns:
      the current value of the barColor variable.
      See Also:
    • setPixelsPerCM

      public void setPixelsPerCM(int newRes)
      Sets the resolution property.
      Parameters:
      newRes - the new value for the resolution variable.
      See Also:
    • getPixelsPerCM

      public int getPixelsPerCM()
      Gets the resolution property.
      Returns:
      the current value of the resolution variable.
      See Also:
    • 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:
    • getAutoSize

      public boolean getAutoSize()
      Gets the autoSize property.
      Returns:
      the current value of the autoSize variable.
      See Also:
    • 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

      public Dimension getPreferredSize()
      Gets the size in pixels of the Preferred barcode image generated.
      Overrides:
      getPreferredSize in class Component
      Returns:
      Dimension(pWidth,pHeight)
      See Also:
    • getMinimumSize

      public Dimension getMinimumSize()
      Gets the minimum size in pixels of the barcode image generated.
      Overrides:
      getMinimumSize in class Component
      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:
    • getRotationAngle

      public int getRotationAngle()
      Gets the rotate property.
      Returns:
      the current value of the rotate variable.
      See Also:
    • paint

      public void paint(Graphics g2)
      Paints the barcode and rotates it if necessary
      Overrides:
      paint in class Canvas
    • createSVG

      public String createSVG()
    • createEPS

      public String createEPS()