Class BarCode

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

public class BarCode extends Canvas implements Serializable
This is the main class that contains all linear barcode functionality. Please see our User Manual for complete details of barcode related properties.
See Also:
  • Field Details

  • Constructor Details

    • BarCode

      public BarCode()
  • Method Details

    • setSymbologyID

      public void setSymbologyID(int newSym)
      Sets the barType property.
      Parameters:
      newSym - the new value for the barType variable.
      See Also:
    • getSymbologyID

      public int getSymbologyID()
      Gets the barType property.
      Returns:
      the current value of the barType variable.
      See Also:
    • setDataToEncode

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

      public String getDataToEncode()
      Gets the code property.
      Returns:
      the current value of the code variable.
      See Also:
    • setCheckCharacter

      public void setCheckCharacter(boolean newChk)
      Sets the checkCharacter property.
      Parameters:
      newChk - the new value for the checkCharacter variable.
      See Also:
    • getCheckCharacter

      public boolean getCheckCharacter()
      Gets the checkCharacter property.
      Returns:
      the current value of the checkCharacter variable.
      See Also:
    • setCheckCharacterInText

      public void setCheckCharacterInText(boolean newVal)
      Sets the checkCharacterInText property.
      Parameters:
      newVal - the new value for the checkCharacterInText variable.
      See Also:
    • getCheckCharacterInText

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

      public void setPostnetHeightTall(double newHeight)
      Sets the postnetHeightTallBar property.
      Parameters:
      newHeight - the new value for the postnetHeightTallBar variable.
      See Also:
    • getPostnetHeightTall

      public double getPostnetHeightTall()
      Gets the postnetHeightTallBar property.
      Returns:
      the current value of the postnetHeightTallBar variable.
      See Also:
    • setPostnetHeightShort

      public void setPostnetHeightShort(double newHeight)
      Sets the postnetHeightShortBar property.
      Parameters:
      newHeight - the new value for the postnetHeightShortBar variable.
      See Also:
    • getPostnetHeightShort

      public double getPostnetHeightShort()
      Gets the postnetHeightShortBar property.
      Returns:
      the current string value of the postnetHeightShortBar 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 string value of the resolution 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 string 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 string value of the topMarginCM variable.
      See Also:
    • setTextMarginCM

      public void setTextMarginCM(double newMargin)
      Sets the textMarginCM property.
      Parameters:
      newMargin - the new value for the textMarginCM variable.
      See Also:
    • getTextMarginCM

      public double getTextMarginCM()
      Gets the textMarginCM property value
      Returns:
      the current value for the textMarginCM variable.
      See Also:
    • setSupplementToEncode

      public void setSupplementToEncode(String newCode)
      Sets the supplement property.
      Parameters:
      newCode - the new value for the supplement variable.
      See Also:
    • getSupplementToEncode

      public String getSupplementToEncode()
      Gets the supplement property.
      Returns:
      the current string value of the supplement 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:
    • setBarHeightCM

      public void setBarHeightCM(double newBarHeight)
      Sets the barHeightCM property.
      Parameters:
      newBarHeight - the new value for the barHeightCM variable.
      See Also:
    • getBarHeightCM

      public double getBarHeightCM()
      Gets the barHeightCM property.
      Returns:
      the current value of the barHeightCM 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 value.
      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(10,10)
      See Also:
    • setShowText

      public void setShowText(boolean newVal)
      Sets the showText property.
      Parameters:
      newVal - the new value for the showText variable.
      See Also:
    • getShowText

      public boolean getShowText()
      Gets the showText property value.
      Returns:
      the current value of the showText variable.
      See Also:
    • setFont

      public void setFont(Font newFont)
      Sets the textFont property.
      Overrides:
      setFont in class Component
      Parameters:
      newFont - the new value for the textFont variable.
      See Also:
    • getFont

      public Font getFont()
      Gets the textFont property value.
      Specified by:
      getFont in interface MenuContainer
      Overrides:
      getFont in class Component
      Returns:
      the current value of the textFont variable.
      See Also:
    • setTextFontColor

      public void setTextFontColor(Color newColor)
      Sets the fontColor property.
      Parameters:
      newColor - the new value for the fontColor variable.
      See Also:
    • getTextFontColor

      public Color getTextFontColor()
      Gets the fontColor property value.
      Returns:
      the current value of the fontColor 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 value.
      Overrides:
      getForeground in class Component
      Returns:
      the current value of the barColor variable.
      See Also:
    • setUPCESystem

      public void setUPCESystem(String newSet)
      Sets the UPCESystem property.
      Parameters:
      newSet - the new value for the UPCESystem variable.
      See Also:
    • getUPCESystem

      public String getUPCESystem()
      Gets the UPCESystem property value.
      Returns:
      the current value of the UPCESystem variable.
      See Also:
    • setCODABARStartChar

      public void setCODABARStartChar(String newSet)
      Sets the CODABARStartChar property.
      Parameters:
      newSet - the new value for the CODABARStartChar variable.
      See Also:
    • getCODABARStartChar

      public String getCODABARStartChar()
      Gets the CODABARStartChar property value.
      Returns:
      the current value of the CODABARStartChar variable.
      See Also:
    • setCODABARStopChar

      public void setCODABARStopChar(String newSet)
      Sets the CODABARStopChar property.
      Parameters:
      newSet - the new value for the CODABARStopChar variable.
      See Also:
    • getCODABARStopChar

      public String getCODABARStopChar()
      Gets the CODABARStopChar property value.
      Returns:
      the current value of the CODABARStopChar variable.
      See Also:
    • setUPCEANSupplement2

      public void setUPCEANSupplement2(boolean newval)
      Sets the UPCEANSupplement2 property.
      Parameters:
      newVal - the new value for the UPCEANSupplement2 variable.
      See Also:
    • getUPCEANSupplement2

      public boolean getUPCEANSupplement2()
      Gets the UPCEANSupplement2 property value.
      Returns:
      the current value of the UPCEANSupplement2 variable.
      See Also:
    • setUPCEANSupplement5

      public void setUPCEANSupplement5(boolean newval)
      Sets the UPCEANSupplement5 property.
      Parameters:
      newval - the new value for the UPCEANSupplement5 variable.
      See Also:
    • getUPCEANSupplement5

      public boolean getUPCEANSupplement5()
      Gets the UPCEANSupplement5 property.
      Returns:
      the current string value of the UPCEANSupplement5 variable.
      See Also:
    • setCode128Set

      public void setCode128Set(String newSet)
      Sets the Code128Set property.
      Parameters:
      newSet - the new value for the Code128Set variable.
      See Also:
    • getCode128Set

      public String getCode128Set()
      Gets the Code128Set property.
      Returns:
      the current string value of the Code128Set 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 string value of the X variable.
      See Also:
    • setNarrowToWideRatio

      public void setNarrowToWideRatio(double newN)
      Sets the N property.
      Parameters:
      newN - the new value for the N variable.
      See Also:
    • getNarrowToWideRatio

      public double getNarrowToWideRatio()
      Gets the N property.
      Returns:
      the current string value of the N 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 string value of the rotate variable.
      See Also:
    • setWhiteBarIncrease

      public void setWhiteBarIncrease(float newWhiteBarIncrease)
      Sets the WhiteBarIncrease property.
      Parameters:
      newWhiteBarIncrease - the new value for the WhiteBarIncrease variable.
      See Also:
    • getWhiteBarIncrease

      public float getWhiteBarIncrease()
      Gets the WhiteBarIncrease property.
      Returns:
      the current string value of the WhiteBarIncrease variable.
      See Also:
    • setCharacterGrouping

      public void setCharacterGrouping(int newValSpliceText)
      Sets the ValSpliceText property.
      Parameters:
      newValSpliceText - the new value for the variable.
      See Also:
    • getCharacterGrouping

      public int getCharacterGrouping()
      Gets the ValSpliceText property.
      Returns:
      the current value of ValSpliceText the variable.
      See Also:
    • setBearerBarVertical

      public void setBearerBarVertical(int newBearerBarVert)
      Sets the fBearerBarVert property.
      Parameters:
      newBearerBarVert - the new value for the fBearerBarVert variable.
      See Also:
    • getBearerBarVertical

      public int getBearerBarVertical()
      Gets the PropBearerBarVert property.
      Returns:
      the current value of the PropBearerBarVert variable.
      See Also:
    • setBearerBarHorizontal

      public void setBearerBarHorizontal(int newBearerBarHori)
      Sets the fBearerBarHori property.
      Parameters:
      newBearerBarHori - the new value for the fBearerBarHori variable.
      See Also:
    • getBearerBarHorizontal

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

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