public class Barcode extends Widget
$weave, auDelay, autag, bindLevel, className, desktop, effects_, firstChild, id, insertingBefore_, inServer, lastChild, nChildren, nextSibling, parent, previousSibling, uuid, widgetName
Modifier and Type | Method and Description |
---|---|
int |
getBarWidth()
Returns the width of single bar (only for 1D barcode).
|
int |
getFontSize()
Returns the fontSize of barcode (only for 1D barcode).
|
String |
getHeight()
Returns height of the barcode component.
|
String |
getType()
Returns the encode and decode type of this component.
|
String |
getValue()
Returns the value of the barcode image.
|
boolean |
isDisplayValue()
Returns the visibility of the value of barcode component (only for 1D barcode).
|
static void |
registerLibrary(Function execFunc,
String libname,
Array types)
A method that register the barcode rendering library.
|
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 |
setHeight(String height)
Sets height of the barcode component.
|
void |
setType(String value)
Sets the encode and decode type of this component.
|
void |
setValue(String value)
Sets the value that will be encoded to the barcode image.
|
afterKeyDown_, beforeCtrlKeys_, getContext, getCtrlKeys, getOpenTooltip, getPopup, getTooltip, setContext, setContext, setCtrlKeys, setPopup, setPopup, setTooltip, setTooltip
$, $f, $f, $f, $init, $n, $n, $o, $s, $service, afterAnima_, afterParentChanged_, appendChild, appendChild, beforeParentChanged_, beforeSendAU_, bind_, bind, bindChildren_, bindDoubleTap_, bindMissingAncestors, bindSwipe_, bindTapHold_, canActivate, cleanDrag_, clear, clearCache, cloneDrag_, deferRedraw_, deferRedrawHTML_, detach, doBlur_, doClick_, doDoubleClick_, doFocus_, doKeyDown_, doKeyPress_, doKeyUp_, domAttrs_, domClass_, domListen_, doMouseDown_, doMouseMove_, doMouseOut_, doMouseOver_, doMouseUp_, domStyle_, domTextStyleAttr_, domTooltiptext_, domUnlisten_, doPaste_, doResizeScroll_, doRightClick_, doSelect_, doSwipe_, doTooltipOut_, doTooltipOver_, dropEffect_, extraBind_, fire, fireX, focus_, focus, forcerender, fromPageCoord, get, getAction, getCaveNode, getChildAt, getChildIndex, getClass, getCssflex, getDraggable, getDragMessage_, getDragNode, getDragOptions_, getDrop_, getDroppable, getElementsById, getElementsByName, getFirstNode_, getFloatZIndex_, getHflex, getId, getLeft, getMold, getOldWidget_, getPage, getRenderdefer, getSclass, getScrollLeft, getScrollTop, getStyle, getTabindex, getTextNode, getTooltiptext, getTop, getTopWidget, getVflex, getWidth, getZclass, getZIndex, hide, ignoreDescendantFloatUp_, ignoreDrag_, initDrag_, insertBefore, insertChildHTML_, isAutoId, isBinding, isFloating_, isListen, isRealElement, isRealVisible, isRealVisible, isVisible, isVisible, isWatchable_, listen, listenOnFitSize_, mimicMouseDown_, newInstance, nextUuid, onAfterSize, onChildAdded_, onChildRemoved_, onChildRenderDefer_, onChildReplaced_, onChildVisible_, onDrop_, redraw, redrawHTML_, register, removeChild, removeChild, removeChildHTML_, removeHTML_, replaceCavedChildren_, replaceChildHTML_, replaceHTML, replaceWidget, rerender, rerender, rerenderLater_, rerenderNow_, scrollIntoView, sendAU_, set, set, setAction, setChildren, setCssflex, setDomVisible_, setDraggable, setDroppable, setFloating_, setFloatZIndex_, setHflex, setId, setLeft, setListener, setListener, setListeners, setMold, setRenderdefer, setSclass, setScrollLeft, setScrollTop, setStyle, setTabindex, setTooltiptext, setTop, setTopmost, setVflex, setVisible, setWidth, setZclass, setZIndex, shallChildROD_, shallFireSizedLaterWhenAddChd_, shallIgnoreClick_, show, smartUpdate, unbind_, unbind, unbindChildren_, unbindDoubleTap_, unbindSwipe_, unbindTapHold_, uncloneDrag_, unlisten, unlistenOnFitSize_, updateDomClass_, updateDomStyle_, uuid, zsync
$init, $instanceof, $super, $super, $supers, $supers, afterInit, isAssignableFrom, isInstance, proxy
public void setType(String value)
registerLibrary(_global_.Function, _global_.String, _global_.Array)
value
- is one of the built-in types as above, or the custom type from the custom library.public String getType()
Default: "CODE128".
public void setValue(String value)
value
- to be encoded into barcode.public String getValue()
Default: "".
public void setHeight(String height)
height
- public String getHeight()
Default: "100px".
getHeight
in class Widget
Widget.getWidth()
public void setDisplayValue(boolean displayValue)
displayValue
- public boolean isDisplayValue()
Default: false.
public void setFontSize(int fontSize)
fontSize
- public int getFontSize()
Default: 10.
public void setBarWidth(int barWidth)
barWidth
- public int getBarWidth()
Default: 2.
public static void registerLibrary(Function execFunc, String libname, Array types)
Note: If you want to use more barcode type besides the default library, you can use the registerLibrary method to register your own library in order to handle the specific type.
execFunc
- The function combines the library you want to use and the barcode widget. The name of the function can be ambiguous, and you can set the first parameter as barcode widget we provide. For example, function mybarcode (wgt) {/...../}. And you can get the canvas inside the dom of widget by canvas = wgt.$n().querySelector('canvas'). After you get it, you can provide the canvas for the library which you want to use.
libname
- The library name you use.types
- An array of types which your library can handle.Copyright © 2005-2023 Potix Corporation. All Rights Reserved.