Package org.zkoss.zkmax.zul

## Class Barcode

- java.lang.Object
- - org.zkoss.zk.ui.AbstractComponent
  - - org.zkoss.zk.ui.HtmlBasedComponent
    - - org.zkoss.zul.impl.XulElement
      - - org.zkoss.zkmax.zul.Barcode

- All Implemented Interfaces:
    `java.io.Serializable`, `java.lang.Cloneable`, `Component`, `Scope`, `ComponentCtrl`

      public class Barcode
      extends XulElement

  Represents a barcode

  A barcode is a component to handle 1D and 2D barcode image.

  Since:
    8.6.0
  See Also:
    Serialized Form

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.zkoss.zk.ui.HtmlBasedComponent

      `HtmlBasedComponent.ExtraCtrl`

    - ### Nested classes/interfaces inherited from class org.zkoss.zk.ui.AbstractComponent

      `AbstractComponent.Children, AbstractComponent.ForwardInfo, AbstractComponent.TargetInfo`

  - ### Field Summary

    - ### Fields inherited from class org.zkoss.zk.ui.HtmlBasedComponent

      `_zclass`

    - ### Fields inherited from interface org.zkoss.zk.ui.Component

      `APPLICATION_SCOPE, COMPONENT_SCOPE, DESKTOP_SCOPE, PAGE_SCOPE, REQUEST_SCOPE, SESSION_SCOPE, SPACE_SCOPE`

    - ### Fields inherited from interface org.zkoss.zk.ui.sys.ComponentCtrl

      `AFTER_CHILD_ADDED, AFTER_CHILD_REMOVED, AFTER_CLONED, AFTER_PAGE_ATTACHED, AFTER_PAGE_DETACHED, AFTER_PARENT_CHANGED, CE_BUSY_IGNORE, CE_DUPLICATE_IGNORE, CE_IMPORTANT, CE_NON_DEFERRABLE, CE_REPEAT_IGNORE`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `Barcode()` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `int` | `getBarWidth()` | Returns the width of single bar (only for 1D barcode).
    `boolean` | `getDisplayValue()` | Returns the visibility of the value of barcode component (only for 1D barcode).
    `int` | `getFontSize()` | Returns the fontSize of barcode (only for 1D barcode).
    `java.lang.String` | `getType()` | Returns the encoded and decoded type of this component.
    `java.lang.String` | `getValue()` | Returns the value of the barcode image.
    `protected void` | `renderProperties​(ContentRenderer renderer)` | Renders the content of this component, excluding the enclosing tags and children.
    `void` | `setBarWidth​(int barWidth)` | Sets the width of single bar.
    `void` | `setDisplayValue​(boolean displayValue)` | Sets the visibility of the value of barcode component.
    `void` | `setFontSize​(int fontSize)` | Sets the fontSize of barcode.
    `void` | `setType​(java.lang.String type)` | Sets the encode and decode type of this component.
    `void` | `setValue​(java.lang.String value)` | Sets the value that will be encoded to the barcode image.

    - ### Methods inherited from class org.zkoss.zul.impl.XulElement

      `clone, getContext, getCtrlKeys, getPopup, getPropertyAccess, getTooltip, setContext, setContext, setContextAttributes, setCtrlKeys, setPopup, setPopup, setPopupAttributes, setTooltip, setTooltip, setTooltipAttributes`

    - ### Methods inherited from class org.zkoss.zk.ui.HtmlBasedComponent

      `addSclass, evalCSSFlex, focus, getAction, getClientAction, getDraggable, getDroppable, getExtraCtrl, getHeight, getHflex, getLeft, getRenderdefer, getSclass, getStyle, getTabindex, getTabindexInteger, getTooltiptext, getTop, getVflex, getWidth, getZclass, getZindex, getZIndex, removeSclass, removeSclass, service, setAction, setClass, setClientAction, setDraggable, setDroppable, setFocus, setHeight, setHeight0, setHeightDirectly, setHflex, setHflex0, setHflexDirectly, setLeft, setLeftDirectly, setRenderdefer, setSclass, setStyle, setTabindex, setTabindex, setTooltiptext, setTop, setTopDirectly, setVflex, setVflex0, setVflexDirectly, setWidth, setWidth0, setWidthDirectly, setZclass, setZindex, setZIndex, setZIndexDirectly`

    - ### Methods inherited from class org.zkoss.zk.ui.AbstractComponent

      `addAnnotation, addCallback, addClientEvent, addEventHandler, addEventListener, addEventListener, addForward, addForward, addForward, addForward, addMoved, addRedrawCallback, addScopeListener, addShadowRoot, addShadowRootBefore, addSharedEventHandlerMap, appendChild, applyProperties, beforeChildAdded, beforeChildRemoved, beforeParentChanged, destroyIndexCacheMap, detach, didActivate, didActivate, didDeserialize, didDeserialize, disableBindingAnnotation, disableClientUpdate, disableHostChanged, enableBindingAnnotation, enableHostChanged, getAnnotatedProperties, getAnnotatedPropertiesBy, getAnnotation, getAnnotations, getAnnotations, getAttribute, getAttribute, getAttribute, getAttributeOrFellow, getAttributes, getAttributes, getAuService, getAutag, getCallback, getChildren, getClientAttribute, getClientDataAttribute, getClientEvents, getDefaultMold, getDefinition, getDesktop, getEventHandler, getEventHandlerNames, getEventListenerMap, getEventListeners, getFellow, getFellow, getFellowIfAny, getFellowIfAny, getFellows, getFirstChild, getForwards, getId, getIndexCacheMap, getLastChild, getMold, getNextSibling, getPage, getParent, getPreviousSibling, getRedrawCallback, getRoot, getShadowFellowIfAny, getShadowRoots, getShadowVariable, getShadowVariable, getShadowVariable0, getSpaceOwner, getSpecialRendererOutput, getStubonly, getSubBindingAnnotationCount, getTemplate, getTemplateNames, getUuid, getWidgetAttributeNames, getWidgetClass, getWidgetListener, getWidgetListenerNames, getWidgetOverride, getWidgetOverrideNames, hasAttribute, hasAttribute, hasAttribute, hasAttributeOrFellow, hasBindingAnnotation, hasFellow, hasFellow, hasSubBindingAnnotation, initIndexCacheMap, insertBefore, invalidate, isChildable, isDisabledHostChanged, isInitialized, isInvalidated, isListenerAvailable, isVisible, onChildAdded, onChildRemoved, onPageAttached, onPageDetached, onParentChanged, onWrongValue, query, queryAll, redraw, redrawChildren, removeAttribute, removeAttribute, removeAttribute, removeCallback, removeChild, removeEventListener, removeForward, removeForward, removeRedrawCallback, removeScopeListener, removeShadowRoot, render, render, render, renderPropertiesOnly, replace, response, response, response, service, sessionDidActivate, sessionWillPassivate, setAttribute, setAttribute, setAttribute, setAuService, setAutag, setClientAttribute, setClientDataAttribute, setDefinition, setDefinition, setId, setMold, setPage, setPageBefore, setParent, setStubonly, setStubonly, setSubBindingAnnotationCount, setTemplate, setVisible, setVisibleDirectly, setWidgetClass, setWidgetListener, setWidgetOverride, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdateWidgetListener, smartUpdateWidgetOverride, toString, updateByClient, updateSubBindingAnnotationCount, willPassivate, willPassivate, willSerialize, willSerialize`

    - ### Methods inherited from class java.lang.Object

      `equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### Barcode

          public Barcode()

  - ### Method Detail

    - #### getType

          public java.lang.String getType()

      Returns the encoded and decoded type of this component. The built-in types are
      - CODE family: CODE39, CODE128, CODE128A, CODE128B, CODE128C
      - EAN family: EAN13, EAN8, EAN5, EAN2
      - ITF family: ITF14, ITF
      - MSI family: MSI, MSI10, MSI11, MSI1010, MSI1110
      - others: UPC, PHARMACODE , CODABAR, QR
      Some of the types have character and length limit. You can check it at https://en.wikipedia.org/wiki/Barcode

      Default: "CODE128".

      Returns:
        A value of the barcode current type.

    - #### setType

          public void setType​(java.lang.String type)

      Sets the encode and decode type of this component. Example: type="code128", type="qr"
      Parameters:
        `type` - decide the render type function.

    - #### getValue

          public java.lang.String getValue()

      Returns the value of the barcode image.

      Default: "".

      Returns:
        The barcode's value

    - #### setValue

          public void setValue​(java.lang.String value)

      Sets the value that will be encoded to the barcode image.
      Parameters:
        `value` - The value to be encoded into barcode.

    - #### getDisplayValue

          public boolean getDisplayValue()

      Returns the visibility of the value of barcode component (only for 1D barcode).

      Default: false.

      Returns:
        true if displaying value is enable.

    - #### setDisplayValue

          public void setDisplayValue​(boolean displayValue)

      Sets the visibility of the value of barcode component.
      Parameters:
        `displayValue` - Whether to show the value text or not, only for 1D barcode.

    - #### getFontSize

          public int getFontSize()

      Returns the fontSize of barcode (only for 1D barcode).

      Default: 10.

      Returns:
        the font size of the barcode text.

    - #### setFontSize

          public void setFontSize​(int fontSize)

      Sets the fontSize of barcode.
      Parameters:
        `fontSize` - The fontSize of the barcode text, only for 1D barcode.

    - #### getBarWidth

          public int getBarWidth()

      Returns the width of single bar (only for 1D barcode).

      Default: 2.

      Returns:
        the single bar width

    - #### setBarWidth

          public void setBarWidth​(int barWidth)

      Sets the width of single bar.
      Parameters:
        `barWidth` - The single width of the 1D barcode bar. It would affect the total width of the barcode;

    - #### renderProperties

          protected void renderProperties​(ContentRenderer renderer)
                                   throws java.io.IOException

      Description copied from class: `HtmlBasedComponent`
      Renders the content of this component, excluding the enclosing tags and children.

      See also ZK Client-side Reference: Property Rendering

      Overrides:
        `renderProperties` in class `XulElement`
      Throws:
        `java.io.IOException`