com.idautomation.maxicode
Class MaxiCode

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Canvas
              |
              +--com.idautomation.maxicode.MaxiCode
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

public class MaxiCode
extends java.awt.Canvas

this class paints a maxicode symbol

See Also:
Serialized Form

Field Summary
 java.awt.Color backColor
           
 java.awt.Color color
           
 double L
          length in mm of the symbol
 int offsetX
          paint the symbol at these coordinates
 int offsetY
          paint the symbol at these coordinates
 
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
MaxiCode()
          Constructor
 
Method Summary
 int[][] createPattern()
          creates a hexagon pattern, if a standard cannot be used.
 boolean getAutoResize()
          if true the image will be resized to fit the size of the barcode
 java.lang.String getCountry()
          country code (modes 2 and 3)
 java.lang.String getData()
          data to be encoded.
 int getHHexagon()
          Height of hexagon modules (pixels)
 int getMode()
          maxicode mode.
 java.lang.String getName()
          Returns "MaxiCode".
 int getNumberOfCodes()
          number of symbol in structured appended mode
 int getPositionOfCode()
          number of symbol in structured appended mode
 java.awt.Dimension getPreferredSize()
          returns size needed to draw the symbol
 boolean getProcessTilde()
           
 int getResolution()
          Get current resolution of the printer (in dpi)
 int getRotation()
          rotation angle.
 java.lang.String getServiceClass()
          service class (modes 2 and 3).
 int getWHexagon()
          width of hexagon modules (pixels)
 java.lang.String getZipCode()
          postal code (modes 2 and 3)
 void paint(java.awt.Graphics g)
          paints the maxicode symbol.
 void setAutoResize(boolean b)
          if true the image will be resized to fit the size available for the component.
 void setCountry(java.lang.String c)
          country code (modes 2 and 3)
 void setData(java.lang.String d)
          data to be encoded.
 void setHexagonPattern(int[][] p)
          set a user defined pattern for the hexagons.
 boolean setL(double l)
          Set length of length symbol.
 void setMode(int m)
          maxicode mode.
 void setNumberOfCodes(int n)
          number of symbol in structured appended mode
 void setPositionOfCode(int n)
          number of symbol in structured appended mode
 void setProcessTilde(boolean pt)
           
 void setRedraw(boolean b)
          force recalculating the symbol next time paint() is called
 boolean setResolution(int r)
          Set resolution of the printer (in dpi).
 void setRotation(int r)
          rotation angle.
 void setServiceClass(java.lang.String s)
          service class (modes 2 and 3).
 void setZipCode(java.lang.String zp)
          postal code (modes 2 and 3)
 
Methods inherited from class java.awt.Canvas
addNotify, getAccessibleContext
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, deliverEvent, disable, dispatchEvent, doLayout, enable, enable, enableInputMethods, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getInputContext, getInputMethodRequests, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getParent, getPeer, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, 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, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFont, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, update, validate
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

color

public java.awt.Color color

backColor

public java.awt.Color backColor

L

public double L
length in mm of the symbol

offsetX

public int offsetX
paint the symbol at these coordinates

offsetY

public int offsetY
paint the symbol at these coordinates
Constructor Detail

MaxiCode

public MaxiCode()
Constructor
Method Detail

getProcessTilde

public boolean getProcessTilde()

setProcessTilde

public void setProcessTilde(boolean pt)

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 java.lang.String getName()
Returns "MaxiCode".
Overrides:
getName in class java.awt.Component

getWHexagon

public int getWHexagon()
width of hexagon modules (pixels)

getHHexagon

public int getHHexagon()
Height of hexagon modules (pixels)

setMode

public void setMode(int m)
maxicode mode. Values range from 2 to 6

getMode

public int getMode()
maxicode mode. Values range from 2 to 6

getZipCode

public java.lang.String getZipCode()
postal code (modes 2 and 3)

setZipCode

public void setZipCode(java.lang.String zp)
postal code (modes 2 and 3)

getServiceClass

public java.lang.String getServiceClass()
service class (modes 2 and 3).

setServiceClass

public void setServiceClass(java.lang.String s)
service class (modes 2 and 3).

getCountry

public java.lang.String getCountry()
country code (modes 2 and 3)

setCountry

public void setCountry(java.lang.String c)
country code (modes 2 and 3)

getData

public java.lang.String getData()
data to be encoded. In modes 2 and 3 if the postal code is empty it will be extracted from the begining of this string (see maxicode specifications)

setData

public void setData(java.lang.String d)
data to be encoded. In modes 2 and 3 if the postal code is empty it will be extracted from the begining of this string (see maxicode specifications)

getNumberOfCodes

public int getNumberOfCodes()
number of symbol in structured appended mode

setNumberOfCodes

public void setNumberOfCodes(int n)
number of symbol in structured appended mode

getPositionOfCode

public int getPositionOfCode()
number of symbol in structured appended mode

setPositionOfCode

public void setPositionOfCode(int n)
number of symbol in structured appended mode

getRotation

public int getRotation()
rotation angle. It can be 0,90,180 or 270

setRotation

public void setRotation(int r)
rotation angle. It can be 0,90,180 or 270

getPreferredSize

public java.awt.Dimension getPreferredSize()
returns size needed to draw the symbol
Overrides:
getPreferredSize in class java.awt.Component

setAutoResize

public void setAutoResize(boolean b)
if true the image will be resized to fit the size available for the component. This is used to show the symbol on the screen.

getAutoResize

public boolean getAutoResize()
if true the image will be resized to fit the size of the barcode

setResolution

public boolean setResolution(int r)
Set resolution of the printer (in dpi). The default is 200 dpi.

getResolution

public int getResolution()
Get current resolution of the printer (in dpi)

setL

public boolean setL(double l)
Set length of length symbol. The default is 25.5 millimeters.

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(java.awt.Graphics g)
paints the maxicode symbol.
Overrides:
paint in class java.awt.Canvas