Class MaxiCode

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

public class MaxiCode extends Canvas
This class paints a maxicode symbol.
See Also:
  • Field Details

  • Constructor Details

    • MaxiCode

      public MaxiCode()
      Constructor
  • Method Details

    • setForeground

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

      public Color getForeground()
      Gets the color property value.
      Overrides:
      getForeground in class Component
      Returns:
      the current value of the color 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:
    • setL

      public boolean setL(double l)
      Sets the L property.
      Parameters:
      l - the new value for the L variable.
      See Also:
    • setResolution

      public boolean setResolution(int r)
      Sets the resolution property.
      Parameters:
      r - the new value for the resolution variable.
      See Also:
    • getResolution

      public int getResolution()
      Gets the resolution property.
      Returns:
      the current value of the resolution variable.
      See Also:
    • setProcessTilde

      public void setProcessTilde(boolean pt)
      Sets the processTilde property.
      Parameters:
      pt - the new value for the processTilde variable.
      See Also:
    • getProcessTilde

      public boolean getProcessTilde()
      Gets the processTilde property.
      Returns:
      the current string value of th processTildee variable.
      See Also:
    • setHexagonPattern

      public void setHexagonPattern(int[][] p)
      set a user defined pattern for the hexagons. For example: int[ ][ ] pattern = { {0,0,0,0,0,0,0}, {0,0,0,1,1,0,0}, {0,0,1,1,1,1,0}, {0,1,1,1,1,1,1}, {0,1,1,1,1,1,1}, {0,1,1,1,1,1,1}, {0,0,1,1,1,1,0}, {0,0,0,1,1,0,0}, }; myMaxicode.setPattern(pattern);
    • getName

      public String getName()
      Returns "MaxiCode".
      Overrides:
      getName in class Component
    • getWHexagon

      public int getWHexagon()
      Width of hexagon modules (pixels)
      See Also:
    • getHHexagon

      public int getHHexagon()
      Height of hexagon modules (pixels)
      See Also:
    • setMode

      public void setMode(int m)
      Sets the mode property.
      Parameters:
      m - the new value for the mode variable.
      See Also:
    • getMode

      public int getMode()
      Gets the mode property.
      Returns:
      the current value of the mode variable.
      See Also:
    • setZipCode

      public void setZipCode(String zp)
      Sets the zipCode property.
      Parameters:
      zp - the new value for the zipCode variable.
      See Also:
    • getZipCode

      public String getZipCode()
      Gets the zipCode property.
      Returns:
      the current value of the zipCode variable.
      See Also:
    • setServiceClass

      public void setServiceClass(String s)
      Sets the serviceClass property.
      Parameters:
      s - the new value for the serviceClass variable.
      See Also:
    • getServiceClass

      public String getServiceClass()
      Gets the serviceClass property.
      Returns:
      the current value of the serviceClass variable.
      See Also:
    • setCountry

      public void setCountry(String c)
      Sets the country property.
      Parameters:
      c - the new value for the country variable.
      See Also:
    • getCountry

      public String getCountry()
      Gets the country property.
      Returns:
      the current value of the country variable.
      See Also:
    • setData

      public void setData(String d)
      Sets the dataStr property.
      Parameters:
      d - the new value for the dataStr variable.
      See Also:
    • getData

      public String getData()
      Gets the dataStr property.
      Returns:
      the current value of the dataStr variable.
      See Also:
    • setNumberOfCodes

      public void setNumberOfCodes(int n)
      Sets the numberOfCodes property.
      Parameters:
      n - the new value for the numberOfCodes variable.
      See Also:
    • getNumberOfCodes

      public int getNumberOfCodes()
      Gets the numberOfCodes property.
      Returns:
      the current value of the numberOfCodes variable.
      See Also:
    • setPositionOfCode

      public void setPositionOfCode(int n)
      Sets the positionOfCode property.
      Parameters:
      n - the new value for the positionOfCode variable.
      See Also:
    • getPositionOfCode

      public int getPositionOfCode()
      Gets the positionOfCode property.
      Returns:
      the current value of the positionOfCode variable.
      See Also:
    • setRotation

      public void setRotation(int r)
      Sets the rotation property.
      Parameters:
      r - the new value for the rotation variable.
      See Also:
    • getRotation

      public int getRotation()
      Gets the rotation property.
      Returns:
      the current value of the rotation variable.
      See Also:
    • getPreferredSize

      public Dimension getPreferredSize()
      Returns size needed to draw the symbol.
      Overrides:
      getPreferredSize in class Component
      See Also:
    • setAutoResize

      public void setAutoResize(boolean b)
      Sets the autoResize property.
      Parameters:
      b - the new value for the autoResize variable.
      See Also:
    • getAutoResize

      public boolean getAutoResize()
      Gets the autoResize property.
      Returns:
      the current value of the autoResize 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:
    • createPattern

      public int[][] createPattern()
      creates a hexagon pattern, if a standard cannot be used.
    • setRedraw

      public void setRedraw(boolean b)
      Force recalculating the symbol next time paint() is called
    • paint

      public void paint(Graphics g)
      paints the maxicode symbol.
      Overrides:
      paint in class Canvas