Class Aztec

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

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

  • Constructor Details

    • Aztec

      public Aztec()
  • 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:
    • 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:
    • 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:
    • 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.
    • getPreferredSize

      public Dimension getPreferredSize()
      Returns the size in pixels appropriate for the generated image after it is generated.
      Overrides:
      getPreferredSize in class Component
    • 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:
    • 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:
    • 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:
    • setNumberOfSymbols

      public void setNumberOfSymbols(int value)
      Sets the numOfSym property.
      Parameters:
      value - the new value for the numOfSym variable.
      See Also:
    • getNumberOfSymbols

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

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

      public int getErrorCorrectionLevel()
      Gets the ecl property.
      Returns:
      the current value of the ecl variable.
      See Also:
    • setMessageAppend

      public void setMessageAppend(String value)
      Sets the codeApp property.
      Parameters:
      value - the new value for the codeApp variable.
      See Also:
    • getMessageAppend

      public String getMessageAppend()
      Gets the codeApp property.
      Returns:
      the current value of the codeApp variable.
      See Also:
    • setReaderInitialization

      public void setReaderInitialization(boolean value)
      Sets the readerInit property.
      Parameters:
      value - the new value for the readerInit variable.
      See Also:
    • getReaderInitialization

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

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

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

      public String createSVG()
    • createEPS

      public String createEPS()
    • paint

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