📄 barcode.java
字号:
int l;
int i1;
if(_orientation == 0 || _orientation == 2)
{
l = i;
i1 = j;
} else
{
l = j;
i1 = i;
}
simpledimension.width = l;
simpledimension.height = i1;
return abyte0;
}
public void saveImage(int i, int j, int k, boolean flag, int l, String s, String s1)
throws Exception
{
File file = new File(s1);
FileOutputStream fileoutputstream = new FileOutputStream(file);
Object obj;
if(i == 3)
obj = new JpgEncoder();
else
obj = new PngEncoder();
Frame frame = new Frame();
frame.addNotify();
Image image = prepareImage(frame, j, k, flag, l, ((ImageEncoder) (obj)).use2ColorSource(), s);
((ImageEncoder) (obj)).encode(image, _clrFore.getColor(), _clrBack.getColor(), _figureTransparent, fileoutputstream);
fileoutputstream.close();
frame.dispose();
}
public void saveImage(int i, int j, int k, boolean flag, String s)
throws Exception
{
saveImage(i, j, k, flag, null, s);
}
public void saveImage(int i, int j, int k, boolean flag, String s, String s1)
throws Exception
{
saveImage(i, j, k, flag, 1, s, s1);
}
public void saveSimpleImage(int i, int j, int k, boolean flag, int l, String s, String s1)
throws Exception
{
File file = new File(s1);
FileOutputStream fileoutputstream = new FileOutputStream(file);
Object obj;
if(i == 3)
obj = new JpgEncoder();
else
obj = new PngEncoder();
SimpleDimension simpledimension = new SimpleDimension(0, 0);
byte abyte0[] = prepareSimpleImage(j, k, flag, l, ((ImageEncoder) (obj)).use2ColorSource(), s, simpledimension);
((ImageEncoder) (obj)).encode(abyte0, simpledimension.width, simpledimension.height, _clrFore, _clrBack, _figureTransparent, fileoutputstream);
fileoutputstream.close();
}
public void saveSimpleImage(int i, int j, int k, boolean flag, String s)
throws Exception
{
saveSimpleImage(i, j, k, flag, null, s);
}
public void saveSimpleImage(int i, int j, int k, boolean flag, String s, String s1)
throws Exception
{
saveSimpleImage(i, j, k, flag, 1, s, s1);
}
public void setAddOnCaption(String s)
{
setAddOnCaption(s.toCharArray());
}
public void setAddOnCaption(char ac[])
{
if(ac != null)
{
_acAddOnMsg = new char[ac.length];
System.arraycopy(ac, 0, _acAddOnMsg, 0, ac.length);
} else
{
_acAddOnMsg = null;
}
}
public boolean setAddOnData(String s)
throws InvalidAddOnDataException
{
return setAddOnData(s.toCharArray());
}
public boolean setAddOnData(char ac[])
throws InvalidAddOnDataException
{
_bAddOnDataInvalid = true;
if(ac != null)
{
_acOrigAddOnData = new char[ac.length];
System.arraycopy(ac, 0, _acOrigAddOnData, 0, ac.length);
}
if(!_symbol.setAddOnText(ac))
{
if(_throwDataError)
throw new InvalidAddOnDataException();
else
return false;
} else
{
_bAddOnDataInvalid = false;
return true;
}
}
public void setAddOnTextAlign(int i)
{
_addOnTextAlign = i;
}
public void setBackColor(Color color)
{
_clrBack = new SimpleColor(color);
}
public void setBackSimpleColor(SimpleColor simplecolor)
{
_clrBack = simplecolor;
}
public int setBarTypeWidth(int i, int j)
{
return _symbol.setBarExt(i, j);
}
public void setBarcodeType(int i)
throws ClassNotFoundException, InstantiationException, IllegalAccessException, BarcodeNotSupportedException
{
changeBarcodeType(i);
}
public void setCaption(String s)
{
setCaption(s.toCharArray());
}
public void setCaption(char ac[])
{
if(ac != null)
{
_acMsg = new char[ac.length];
System.arraycopy(ac, 0, _acMsg, 0, ac.length);
} else
{
_acMsg = null;
}
}
public void setCheckCharShowMode(int i)
{
_checkCharShowMode = i;
}
public int setClearArea(int i, int j)
{
return _symbol.setMargin(i, j);
}
public void setClearAreaBottom(int i)
{
setClearArea(4, i);
}
public void setClearAreaLeft(int i)
{
setClearArea(1, i);
}
public void setClearAreaMiddle(int i)
{
setClearArea(5, i);
}
public void setClearAreaRight(int i)
{
setClearArea(3, i);
}
public void setClearAreaTop(int i)
{
setClearArea(2, i);
}
public boolean setData(String s)
throws InvalidDataException
{
return setData(s.toCharArray());
}
public boolean setData(char ac[])
throws InvalidDataException
{
switch(_license.getLicenseType())
{
case 3: // '\003'
case 4: // '\004'
return true;
}
_bDataInvalid = true;
if(ac != null)
{
_acOrigData = new char[ac.length];
System.arraycopy(ac, 0, _acOrigData, 0, ac.length);
}
if(!_symbol.setText(_acOrigData))
{
if(_throwDataError)
throw new InvalidDataException();
else
return false;
} else
{
_bDataInvalid = false;
return true;
}
}
public void setExtraText(String s)
{
if(s == null)
s = "";
if(_license.getLicenseType() != 2 && _extraTextPosition == -1)
_extraTextPosition = 0;
if(_license.getLicenseType() != 2 && _license.getLicenseType() != 5)
{
_extraText = s;
} else
{
_extraText = _extraTextPrefix;
if(s.length() > 0)
_extraText += "\n" + s;
}
}
public void setExtraTextPosition(int i)
{
if(_license.getLicenseType() != 2)
switch(i)
{
case 0: // '\0'
case 1: // '\001'
_extraTextPosition = i;
return;
case -1:
default:
return;
}
else
return;
}
public void setExtraTopText(String s)
{
setExtraText(s);
}
public void setFigureTransparent(boolean flag)
{
_figureTransparent = flag;
}
public void setFont(Font font)
{
_font = new SimpleFont(font);
}
public void setForeColor(Color color)
{
_clrFore = new SimpleColor(color);
}
public void setForeSimpleColor(SimpleColor simplecolor)
{
_clrFore = simplecolor;
}
public void setHorzAlign(int i)
{
_horzAlign = i;
}
public int setInterCharSpace(int i)
{
return _symbol.setInterCharExt(i);
}
public void setInvalidDataAction(int i)
{
_invalidDataAction = i;
}
public void setOrientation(int i)
{
_orientation = i;
}
public void setRetainAspectRatio(boolean flag)
{
_retainAspectRatio = flag;
}
public void setShowCode39StartStop(boolean flag)
{
_showCode39StartStop = flag;
}
public void setSimpleFont(SimpleFont simplefont)
{
_font = simplefont;
}
public int setSpaceTypeWidth(int i, int j)
{
return _symbol.setSpaceExt(i, j);
}
public void setStretchText(boolean flag)
{
_stretchText = flag;
}
public void setTextAlign(int i)
{
_textAlign = i;
}
public void setThrowDataError(boolean flag)
{
_throwDataError = flag;
}
public void setUniBarHeight(boolean flag)
{
_uniBarHeight = flag;
}
public void setUpcSmallFont(boolean flag)
{
_upcSmallFont = flag;
}
public void setVertAlign(int i)
{
_vertAlign = i;
}
public static int[] simpleBitmapToPixelArray(byte abyte0[], int i, int j, int k, int l)
{
boolean flag;
if((l == 0 || l == 255) && (k == 0 || k == 255))
flag = true;
else
flag = false;
int i1 = i;
int j1 = j;
int ai[] = new int[i1 * j1];
int k1 = (i1 + 7) / 8;
int l1 = 8 - i1 % 8;
if(l1 == 8)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -