com.aspose.barcode.barcodecontrol

Class BarCodeGeneratorControl

  • java.lang.Object
    • java.awt.Component
      • java.awt.Container
        • javax.swing.JComponent
          • javax.swing.JLabel
            • com.aspose.barcode.barcodecontrol.BarCodeGeneratorControl
  • All Implemented Interfaces:
    IBarCodeGeneratorControl, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, javax.swing.SwingConstants


    public class BarCodeGeneratorControl
    extends javax.swing.JLabel
    implements IBarCodeGeneratorControl
    See Also:
    Serialized Form
    • Nested Class Summary

      • Nested classes/interfaces inherited from class javax.swing.JLabel

        javax.swing.JLabel.AccessibleJLabel
      • Nested classes/interfaces inherited from class javax.swing.JComponent

        javax.swing.JComponent.AccessibleJComponent
      • Nested classes/interfaces inherited from class java.awt.Container

        java.awt.Container.AccessibleAWTContainer
      • Nested classes/interfaces inherited from class java.awt.Component

        java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
    • Field Summary

      • Fields inherited from class javax.swing.JLabel

        labelFor
      • Fields inherited from class javax.swing.JComponent

        listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
      • Fields inherited from class java.awt.Component

        accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
      • Fields inherited from interface javax.swing.SwingConstants

        BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
      • Fields inherited from interface java.awt.image.ImageObserver

        ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
    • Constructor Summary

      Constructors 
      Constructor and Description
      BarCodeGeneratorControl()
      Initializes a new instance of the class.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      protected void dispose(boolean disposing)
      Releases resource.
      AutoSizeMode getAutoSizeMode()
      Gets the mode by which the barcode automatically resizes.
      java.awt.Color getBackgroundColor()
      Background color of the barcode image.
      Unit getBarCodeHeight()
      BarCode image height when property is set to AutoSizeMode.Nearest or AutoSizeMode.Interpolation.
      Padding getBarcodePaddings()
      Gets Barcode paddings parameters .
      java.lang.String getBarcodeType()
      BarCode's encode type (symbology).
      Unit getBarCodeWidth()
      BarCode image width when property is set to AutoSizeMode.Nearest or AutoSizeMode.Interpolation.
      java.awt.Color getBarColor()
      Bars color.
      Unit getBarHeight()
      Height of 1D barcodes' bars.
      BorderParameters getBorderParameters()
      Gets Border parameters .
      CaptionUI getCaptionAbove()
      Caption Above the BarCode image.
      CaptionUI getCaptionBelow()
      Caption Above the BarCode image.
      boolean getChecksumAlwaysShow()
      Always display checksum digit in the human readable text for Code128 and GS1Code128 barcodes.
      java.lang.String getCodeText()
      Data to be encoded, different types of BarCode may have different CodeText length restrictions.
      CodetextParametersUI getCodeTextParameters()
      Gets CodeText parameters .
      boolean getEnableEscape()
      Indicates whether explains the character "\" as an escape character in CodeText property.
      BaseEncodeType getEncodeType()
      BarCode's encode type (symbology).
      boolean getFilledBars()
      Gets a value indicating whether bars filled.
      float getResolution()
      Gets the resolution of the BarCode image.
      float getRotationAngle()
      BarCode image rotation angle, measured in degree, e.g.
      SpecificParametersUI getSpecific()
      Specific parameters
      boolean getThrowExceptionWhenCodeTextIncorrect()
      Only for 1D barcodes.
      float getWideNarrowRatio()
      Wide bars to Narrow bars ratio.
      Unit getXDimension()
      X-dimension is the smallest width of the unit of BarCode bars or spaces.
      EnableChecksum isChecksumEnabled() 
      protected void paintComponent(java.awt.Graphics g) 
      void setAutoSizeMode(AutoSizeMode value)
      Sets the mode by which the barcode automatically resizes.
      void setBackgroundColor(java.awt.Color value)
      Background color of the barcode image.
      void setBarcodeType(java.lang.String value)
      BarCode's encode type (symbology).
      void setBarColor(java.awt.Color value)
      Bars color.
      void setChecksumAlwaysShow(boolean value)
      Always display checksum digit in the human readable text for Code128 and GS1Code128 barcodes.
      void setChecksumEnabled(EnableChecksum value)
      Enable checksum during generation 1D barcodes.
      void setCodeText(java.lang.String value)
      Data to be encoded, different types of BarCode may have different CodeText length restrictions.
      void setEnableEscape(boolean value)
      Indicates whether explains the character "\" as an escape character in CodeText property.
      void setEncodeType(BaseEncodeType value)
      BarCode's encode type (symbology).
      void setFilledBars(boolean value)
      Gets a value indicating whether bars filled.
      void setResolution(float value)
      Sets the resolution of the BarCode image.
      void setRotationAngle(float value)
      BarCode image rotation angle, measured in degree, e.g.
      void setThrowExceptionWhenCodeTextIncorrect(boolean value)
      Only for 1D barcodes.
      void setWideNarrowRatio(float value)
      Wide bars to Narrow bars ratio.
      • Methods inherited from class javax.swing.JLabel

        checkHorizontalKey, checkVerticalKey, getAccessibleContext, getDisabledIcon, getDisplayedMnemonic, getDisplayedMnemonicIndex, getHorizontalAlignment, getHorizontalTextPosition, getIcon, getIconTextGap, getLabelFor, getText, getUI, getUIClassID, getVerticalAlignment, getVerticalTextPosition, imageUpdate, paramString, setDisabledIcon, setDisplayedMnemonic, setDisplayedMnemonic, setDisplayedMnemonicIndex, setHorizontalAlignment, setHorizontalTextPosition, setIcon, setIconTextGap, setLabelFor, setText, setUI, setVerticalAlignment, setVerticalTextPosition, updateUI
      • Methods inherited from class javax.swing.JComponent

        addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
      • Methods inherited from class java.awt.Container

        add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
      • Methods inherited from class java.awt.Component

        action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • BarCodeGeneratorControl

        public BarCodeGeneratorControl()
        Initializes a new instance of the class.
    • Method Detail

      • dispose

        protected void dispose(boolean disposing)
        Releases resource.
        Parameters:
        disposing - true to release both managed and unmanaged resources; false to release only unmanaged resources.
      • paintComponent

        protected void paintComponent(java.awt.Graphics g)
        Overrides:
        paintComponent in class javax.swing.JComponent
      • getCodeText

        public java.lang.String getCodeText()
        Data to be encoded, different types of BarCode may have different CodeText length restrictions.
      • setCodeText

        public void setCodeText(java.lang.String value)
        Data to be encoded, different types of BarCode may have different CodeText length restrictions.
      • getBarcodeType

        public java.lang.String getBarcodeType()
        BarCode's encode type (symbology). Use to get current symbology.
      • setBarcodeType

        public void setBarcodeType(java.lang.String value)
        BarCode's encode type (symbology). Use to get current symbology.
      • getAutoSizeMode

        public AutoSizeMode getAutoSizeMode()
        Gets the mode by which the barcode automatically resizes. Default value is AutoSizeMode.NONE.
      • setAutoSizeMode

        public void setAutoSizeMode(AutoSizeMode value)
        Sets the mode by which the barcode automatically resizes. Default value is AutoSizeMode.NONE.
      • getCaptionAbove

        public CaptionUI getCaptionAbove()
        Caption Above the BarCode image. See .
      • getCaptionBelow

        public CaptionUI getCaptionBelow()
        Caption Above the BarCode image. See .
      • getXDimension

        public Unit getXDimension()
        X-dimension is the smallest width of the unit of BarCode bars or spaces. Increase this will increase the whole barcode image width. Ignored if property is set to AutoSizeMode.Nearest or AutoSizeMode.Interpolation.
      • getBarHeight

        public Unit getBarHeight()
        Height of 1D barcodes' bars. Ignored if property is set to AutoSizeMode.Nearest or AutoSizeMode.Interpolation.
      • getBarCodeHeight

        public Unit getBarCodeHeight()
        BarCode image height when property is set to AutoSizeMode.Nearest or AutoSizeMode.Interpolation.
      • getBarCodeWidth

        public Unit getBarCodeWidth()
        BarCode image width when property is set to AutoSizeMode.Nearest or AutoSizeMode.Interpolation.
      • getBarColor

        public java.awt.Color getBarColor()
        Bars color.
      • setBarColor

        public void setBarColor(java.awt.Color value)
        Bars color.
        Parameters:
        value -
      • getBarcodePaddings

        public Padding getBarcodePaddings()
        Gets Barcode paddings parameters .
      • getChecksumAlwaysShow

        public boolean getChecksumAlwaysShow()
        Always display checksum digit in the human readable text for Code128 and GS1Code128 barcodes.
      • setChecksumAlwaysShow

        public void setChecksumAlwaysShow(boolean value)
        Always display checksum digit in the human readable text for Code128 and GS1Code128 barcodes.
      • setChecksumEnabled

        public void setChecksumEnabled(EnableChecksum value)
        Enable checksum during generation 1D barcodes. Default is treated as Yes for symbology which must contain checksum, as No where checksum only possible. Checksum is possible: Code39 Standard/Extended, Standard2of5, Interleaved2of5, Matrix2of5, ItalianPost25, DeutschePostIdentcode, DeutschePostLeitcode, VIN, Codaba Checksum always used: Rest symbology
      • getEnableEscape

        public boolean getEnableEscape()
        Indicates whether explains the character "\" as an escape character in CodeText property. Used for Pdf417, DataMatrix, Code128 only If the EnableEscape is true, "\" will be explained as a special escape character. Otherwise, "\" acts as normal characters. Aspose.BarCode supports inputing decimal ascii code and mnemonic for ASCII control-code characters. For example, \013 and \\CR stands for CR.
      • setEnableEscape

        public void setEnableEscape(boolean value)
        Indicates whether explains the character "\" as an escape character in CodeText property. Used for Pdf417, DataMatrix, Code128 only If the EnableEscape is true, "\" will be explained as a special escape character. Otherwise, "\" acts as normal characters. Aspose.BarCode supports inputing decimal ascii code and mnemonic for ASCII control-code characters. For example, \013 and \\CR stands for CR.
      • getThrowExceptionWhenCodeTextIncorrect

        public boolean getThrowExceptionWhenCodeTextIncorrect()
        Only for 1D barcodes. If codetext is incorrect and value set to true - exception will be thrown. Otherwise codetext will be corrected to match barcode's specification. Exception always will be thrown for: Databar symbology if codetext is incorrect. Exception always will not be thrown for: AustraliaPost, SingapurePost, Code39Extended, Code93Extended, Code16K, Code128 symbology if codetext is incorrect.
      • setThrowExceptionWhenCodeTextIncorrect

        public void setThrowExceptionWhenCodeTextIncorrect(boolean value)
        Only for 1D barcodes. If codetext is incorrect and value set to true - exception will be thrown. Otherwise codetext will be corrected to match barcode's specification. Exception always will be thrown for: Databar symbology if codetext is incorrect. Exception always will not be thrown for: AustraliaPost, SingapurePost, Code39Extended, Code93Extended, Code16K, Code128 symbology if codetext is incorrect.
      • getWideNarrowRatio

        public float getWideNarrowRatio()
        Wide bars to Narrow bars ratio. Default value: 3, that is, wide bars are 3 times as wide as narrow bars. Used for ITF, PZN, PharmaCode, Standard2of5, Interleaved2of5, Matrix2of5, ItalianPost25, IATA2of5, VIN, DeutschePost, OPC, Code32, DataLogic2of5, PatchCode, Code39Extended, Code39Standard
        Returns:
        The WideNarrowRatio parameter value is less than or equal to 0.
      • setWideNarrowRatio

        public void setWideNarrowRatio(float value)
        Wide bars to Narrow bars ratio. Default value: 3, that is, wide bars are 3 times as wide as narrow bars. Used for ITF, PZN, PharmaCode, Standard2of5, Interleaved2of5, Matrix2of5, ItalianPost25, IATA2of5, VIN, DeutschePost, OPC, Code32, DataLogic2of5, PatchCode, Code39Extended, Code39Standard
        Parameters:
        value - The WideNarrowRatio parameter value is less than or equal to 0.
      • getCodeTextParameters

        public CodetextParametersUI getCodeTextParameters()
        Gets CodeText parameters .
      • getFilledBars

        public boolean getFilledBars()
        Gets a value indicating whether bars filled. Only for 1D barcodes.
      • setFilledBars

        public void setFilledBars(boolean value)
        Gets a value indicating whether bars filled. Only for 1D barcodes.
      • getBackgroundColor

        public java.awt.Color getBackgroundColor()
        Background color of the barcode image.
      • setBackgroundColor

        public void setBackgroundColor(java.awt.Color value)
        Background color of the barcode image.
      • getResolution

        public float getResolution()
        Gets the resolution of the BarCode image. One value for both dimensions. Default value: 96 dpi.
        Returns:
        The Resolution parameter value is less than or equal to 0.
      • setResolution

        public void setResolution(float value)
        Sets the resolution of the BarCode image. One value for both dimensions. Default value: 96 dpi.
        Parameters:
        value - The Resolution parameter value is less than or equal to 0.
      • getBorderParameters

        public BorderParameters getBorderParameters()
        Gets Border parameters .
      • getRotationAngle

        public float getRotationAngle()
        BarCode image rotation angle, measured in degree, e.g. RotationAngle = 0 or RotationAngle = 360 means no rotation. If RotationAngle NOT equal to 90, 180, 270 or 0, it may increase the difficulty for the scanner to read the image.
        Specified by:
        getRotationAngle in interface IBarCodeGeneratorControl
      • setRotationAngle

        public void setRotationAngle(float value)
        BarCode image rotation angle, measured in degree, e.g. RotationAngle = 0 or RotationAngle = 360 means no rotation. If RotationAngle NOT equal to 90, 180, 270 or 0, it may increase the difficulty for the scanner to read the image.
        Specified by:
        setRotationAngle in interface IBarCodeGeneratorControl