亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? barcodetool.java

?? 這是個國外JAVA愛好者寫的條形碼生成器
?? JAVA
字號:
/***********************************************************************************************************************
Copyright (c) 2003, International Barcode Consortium
All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

    * Redistributions of source code must retain the above copyright notice, this list of
      conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright notice, this list of
      conditions and the following disclaimer in the documentation and/or other materials
      provided with the distribution.
    * Neither the name of the International Barcode Consortium nor the names of any contributors may be used to endorse
      or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************************************************************/

///CLOVER:OFF

package net.sourceforge.barbecue; 

import net.sourceforge.barbecue.BarcodeImageHandler;
import net.sourceforge.barbecue.formatter.SVGFormatter;
import net.sourceforge.barbecue.formatter.FormattingException;

import javax.swing.event.DocumentListener;
import javax.swing.event.DocumentEvent;
import javax.swing.*;
import java.io.File;
import java.io.FileWriter;
import java.io.OutputStream;
import java.lang.reflect.Method;
import java.awt.*;
import java.awt.event.WindowAdapter;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.awt.print.PrinterJob;

/**
 * Contributed by Ryan Martell.
 *
 * @author  rmartell
 * @author <a href="mailto:opensource@ianbourke.com">Ian Bourke</a>
 */
public class BarcodeTool extends JFrame {
    private static final String [] barcodeData= {
        "Code128", "Creates a Code 128 barcode that dynamically switches between character sets to "+
            "give the smallest possible encoding. This will encode  all numeric characters, "+
            "upper and lower case alpha characters and control characters  from the standard "+
            "ASCII character set. The size of the barcode created will be the  smallest possible "+
            "for the given data, and use of this \"optimal\" encoding will  generally give smaller "+
            "barcodes than any of the other 3 \"vanilla\" encodings.", 
        "Code128A", "Creates a Code 128 barcode using the A character set. This will encode  all numeric characters, upper case alpha characters and control characters  from the standard ASCII character set. The Code 128 barcode supports on-the-fly  character set changes using the appropriate code change symbol. The type A barcode  also supports a one character 'shift' to set B.",
        "Code128B", "Creates a Code 128 barcode using the B character set. This will encode  all numeric characters and upper and lower case alpha characters  from the standard ASCII character set. The Code 128 barcode supports on-the-fly  character set changes using the appropriate code change symbol. The type B barcode  also supports a one character 'shift' to set A.",
        "Code128C", "Creates a Code 128 barcode using the C character set. This will encode  only numeric characters in a double density format (e.g. 1 digit in the barcode  encodes two digits in the data). The Code 128 barcode supports on-the-fly  character set changes using the appropriate code change symbol. No shifts are  possible with the type C barcode.",
        "EAN128", "Creates an EAN128 barcode",
        "GlobalTradeItemNumber", "Creates a Global Treade Item Number (GTIN) based on the UCC/EAN 128 symbology.",
        "SCC14ShippingCode", "Creates an SCC-14 shipping code number based on the UCC/EAN 128 symbology.",
        "ShipmentIdentificationNumber", "Creates a shipment identification number based on the UCC/EAN 128 symbology.",
        "SSCC18", "Creates an SSCC-18 number based on the UCC/EAN 128 symbology.",
        "UCC128", "Creates a UCC 128 barcode. This will encode numeric characters and must  include the correct application identifier for the application domain in which  you wish to use the barcode.", 
        "USPS", "Creates a US Postal Service barcode based on the UCC/EAN 128 symbology.",
		"Code39", "Creates a Code 39 barcode.",
		"Codabar", "Creates a Codabar barcode.",
        "PDF417", "Creates a PDF417 (2 dimensional) barcode."
    };

	private JLabel appIDLabel;
    private JTextField appIDTextField;
    private JComboBox barcodeSelection;
    private JTextField dataField;
    private JPanel barcodePanel;

    private String [] getBarcodeTypes() {
        String[] result= new String[barcodeData.length / 2];
        for(int i = 0; i < barcodeData.length; i += 2) {
            result[i / 2] = barcodeData[i];
        }
        return result;
    }
    
    public BarcodeTool() {
        createGUI();
		addQuitListener();
		addDataListener();
	}

	private void addDataListener() {
		dataField.getDocument().addDocumentListener(new DocumentListener() {
            public void insertUpdate(DocumentEvent evt) {
				try {
					syncBarcode();
				} catch (BarcodeException e) {
					throw new RuntimeException(e.getMessage());
				}
			}

            public void removeUpdate(DocumentEvent evt) {
				try {
					syncBarcode();
				} catch (BarcodeException e) {
					throw new RuntimeException(e.getMessage());
				}
			}

            public void changedUpdate(DocumentEvent evt) {
            }
        });
	}

	private void setBarcode(final Barcode bar) {
		
		
        if(barcodePanel.getComponentCount() > 0) {
			Rectangle existingBounds = ((Barcode) barcodePanel.getComponent(0)).getBounds();
            barcodePanel.removeAll();
            barcodePanel.add(bar);
			Rectangle newBounds = ((Barcode) bar).getBounds();
            existingBounds.add(newBounds);
            barcodePanel.repaint(existingBounds);
        } else {
            barcodePanel.add(bar);
            barcodePanel.revalidate();
        }
    }
    
    private void syncBarcode() throws BarcodeException {
        String currentValue= (String) barcodeSelection.getSelectedItem();
        String barcodeText= dataField.getText();

		if ( (barcodeText == null) || (barcodeText.length() == 0)) {
			barcodeText = " ";
		}

		boolean appIDVisible= currentValue.equals("UCC128");
		if(appIDVisible != appIDTextField.isVisible()) {
			appIDTextField.setVisible(appIDVisible);
			appIDLabel.setVisible(appIDVisible);
		}
		
        if(currentValue.equals("UCC128")) {
		    Barcode b= BarcodeFactory.createUCC128(appIDTextField.getText(), barcodeText);
            setBarcode(b);
        } else if (currentValue.equals("Code39")) {
			Barcode b = BarcodeFactory.createCode39(barcodeText, true);
			setBarcode(b);
		} else {
            try {
                Class factory = net.sourceforge.barbecue.BarcodeFactory.class;
				Method createMethod = factory.getMethod("create" + currentValue, new Class[]{ "".getClass() });
				Object result = createMethod.invoke(null, new Object[]{ barcodeText });
                setBarcode((Barcode) result);
            } catch(NoSuchMethodException e) {
				throw new RuntimeException(e.getMessage());
            } catch(IllegalAccessException e) {
				throw new RuntimeException(e.getMessage());
            } catch(java.lang.reflect.InvocationTargetException e) {
				throw new RuntimeException(e.getMessage());
            }
        }
    }

    private void createGUI() {
		getContentPane().add(createDataInputPanel(), BorderLayout.NORTH);
		getContentPane().add(createBarcodePanel(), BorderLayout.CENTER);
		getContentPane().add(createButtonPanel(), BorderLayout.SOUTH);
        pack();
    }

	private void addQuitListener() {
		addWindowListener(new WindowAdapter() {
            public void windowClosing(java.awt.event.WindowEvent evt) {
                quit();
            }
        });
	}

	private JPanel createBarcodePanel() {
		barcodePanel = new JPanel();
		barcodePanel.setPreferredSize(new Dimension(200, 200));
		return barcodePanel;
	}

	private JPanel createDataInputPanel() {
		JLabel typeLabel = new JLabel();
		typeLabel.setText("Type:");

		JPanel barcodeSelectionPanel = new JPanel();
		barcodeSelectionPanel.add(typeLabel);

		barcodeSelection = new JComboBox(getBarcodeTypes());
		barcodeSelection.addItemListener(new ItemListener() {
			public void itemStateChanged(ItemEvent evt) {
				barcodeSelected();
			}
		});

		barcodeSelectionPanel.add(barcodeSelection);

		JPanel dataInputPanel = new JPanel();
		dataInputPanel.add(barcodeSelectionPanel);

		JLabel dataLabel = new JLabel();
		dataLabel.setText("Value:");
		JPanel dataPanel = new JPanel();
		dataPanel.add(dataLabel);

		dataField = new JTextField();
		dataField.setColumns(20);
		dataPanel.add(dataField);

		dataInputPanel.add(dataPanel);

		appIDLabel = new JLabel();
		appIDLabel.setLabelFor(appIDTextField);
		appIDLabel.setText("App ID:");
		JPanel appIDPanel = new JPanel();
		appIDPanel.add(appIDLabel);

		appIDTextField = new JTextField();
		appIDTextField.setColumns(5);
		appIDTextField.setText("123");
		appIDPanel.add(appIDTextField);

		dataInputPanel.add(appIDPanel);
		return dataInputPanel;
	}

	private JPanel createButtonPanel() {
		JButton quitButton = new JButton();
        quitButton.setText("Quit");
        quitButton.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
                quit();
            }
        });

		JPanel buttonPanel = new JPanel();
		buttonPanel.setLayout(new FlowLayout());
		buttonPanel.add(quitButton);

		JButton saveAsButton = new JButton();
		saveAsButton.setText("Save as...");
		saveAsButton.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent evt) {
		        if ( barcodePanel.getComponentCount() < 1) {
		        	return;
		        }
		        JFileChooser chooser = new JFileChooser();
		        chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
		        chooser.setMultiSelectionEnabled(false);
		        int retVal = chooser.showSaveDialog(null);
		        if (retVal == JFileChooser.APPROVE_OPTION)
		        {
		            Barcode b = (Barcode) barcodePanel.getComponent(0);
		            File f = chooser.getSelectedFile();
		            try
		            {
		            	save(b, f);
		            }
		            catch (Exception ex)
		            {
		            	ex.printStackTrace();
		            }
		        }
			}
		});

		buttonPanel.add(saveAsButton);
		return buttonPanel;
	}

	private void save(Barcode b, File f) throws Exception {
		String filename = f.getName().toLowerCase();
		if (filename.endsWith(".svg"))
		{
			saveSVG(b, f);
		}
		else if (filename.endsWith(".png")) {
			BarcodeImageHandler.savePNG(b, f);
		}
		else if (filename.endsWith(".jpg")) {
			BarcodeImageHandler.saveJPEG(b, f);
		}
		else if (filename.endsWith(".gif")) {
			BarcodeImageHandler.saveGIF(b, f);
		}
		else
		{
			throw new RuntimeException("can't save: " + f.toString());
		}
				
		
	}

	private void saveJPEG(Barcode b, OutputStream out) throws Exception {
		BarcodeImageHandler.writeJPEG(b, out);
	}
	
	private void savePNG(Barcode b, OutputStream out)  throws Exception {
		BarcodeImageHandler.writePNG(b, out);
	}
	
	private void saveGIF(Barcode b, OutputStream out)  throws Exception  {
		BarcodeImageHandler.writeGIF(b, out);
	}
	
	private void saveSVG(Barcode b, File f) {
            try {
                FileWriter writer= new FileWriter(f);
                StringBuffer sb= new StringBuffer();
                writer.write(sb.toString());
				SVGFormatter formatter = new SVGFormatter(writer);
				formatter.format(b);

                writer.close();
            } catch(java.io.IOException ex) {
                System.err.println("Exception on write: "+ex.toString());
            } catch (FormattingException e) {
				System.err.println("Exception on write: "+e.toString());
			}
    }

    private void barcodeSelected() {
		try {
			syncBarcode();
		} catch (BarcodeException e) {
			throw new RuntimeException(e.getMessage());
		}
	}

	private void quit() {
        System.exit(0);
    }
    
    public static void main(String args[]) {
        new BarcodeTool().setVisible(true);
    }
}

///CLOVER:ON

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久午夜羞羞影院免费观看| 亚洲一区二区欧美激情| 岛国一区二区在线观看| 国产精品久线观看视频| 91麻豆福利精品推荐| 亚洲一区二区五区| 欧美日韩精品福利| 久久精品国产亚洲一区二区三区| 精品国产第一区二区三区观看体验 | 日韩av在线播放中文字幕| 69av一区二区三区| 国产麻豆成人精品| 国产精品成人网| 欧美色倩网站大全免费| 麻豆精品精品国产自在97香蕉| 久久色成人在线| 色综合中文字幕| 日韩精品一二三| 久久精品亚洲国产奇米99| 99久久99久久久精品齐齐| 亚洲国产精品麻豆| 日韩视频123| 成人av手机在线观看| 亚洲国产精品精华液网站| 亚洲精品一区二区在线观看| 91丨porny丨户外露出| 午夜一区二区三区视频| 2017欧美狠狠色| 91性感美女视频| 美女视频一区在线观看| 国产精品情趣视频| 制服丝袜中文字幕亚洲| 国产成人8x视频一区二区| 亚洲一区二区av在线| 久久免费国产精品| 欧美亚洲愉拍一区二区| 九色porny丨国产精品| 综合电影一区二区三区| 欧美一区二区三区视频免费 | 在线成人午夜影院| 国产精品99久久久久久久女警| 一区二区三区 在线观看视频| 精品福利一二区| 91看片淫黄大片一级在线观看| 久久99久久久久| 亚洲欧美日韩国产另类专区| 精品国产91亚洲一区二区三区婷婷| 99视频热这里只有精品免费| 久久精品久久精品| 亚洲精品乱码久久久久久黑人 | 国产精品毛片高清在线完整版| 欧美女孩性生活视频| 国产成人精品亚洲日本在线桃色| 午夜亚洲福利老司机| 国产精品免费丝袜| 欧美大白屁股肥臀xxxxxx| 91美女在线视频| 国产精品996| 免费看日韩a级影片| 亚洲精品国久久99热| 国产亚洲欧美日韩在线一区| 在线播放中文字幕一区| 91麻豆国产福利在线观看| 国产一区 二区| 日韩av午夜在线观看| 亚洲精品视频观看| 国产精品美女久久久久aⅴ | 精品一区二区久久久| 亚洲一二三专区| 中文字幕在线观看一区| 久久蜜桃一区二区| 日韩三级视频在线看| 欧洲日韩一区二区三区| 成人免费视频一区二区| 国内欧美视频一区二区| 日韩电影在线观看网站| 亚洲精品久久嫩草网站秘色| 国产精品国产三级国产aⅴ无密码 国产精品国产三级国产aⅴ原创 | 丁香一区二区三区| 中文天堂在线一区| av不卡在线播放| 国产美女av一区二区三区| 日韩国产在线一| 亚洲最大色网站| 国产精品久久久久久久久免费樱桃 | 91麻豆精品一区二区三区| 国产成人av福利| 韩国女主播成人在线观看| 热久久久久久久| 石原莉奈一区二区三区在线观看| 夜夜夜精品看看| 亚洲美女免费在线| 亚洲欧美在线aaa| 国产精品麻豆视频| 中文字幕成人网| 久久精品欧美一区二区三区麻豆| 26uuu色噜噜精品一区| 日韩一区二区三区视频在线| 欧美老女人在线| 欧美久久久影院| 欧美日韩高清不卡| 欧美色欧美亚洲另类二区| 欧美亚洲国产一区二区三区| 在线观看亚洲精品| 欧洲精品中文字幕| 欧洲另类一二三四区| 欧美专区在线观看一区| 91年精品国产| 色婷婷狠狠综合| 色综合一个色综合亚洲| 亚洲伊人伊色伊影伊综合网| 亚洲综合丁香婷婷六月香| 亚洲制服丝袜av| 亚洲h在线观看| 丝袜美腿成人在线| 日韩国产精品久久久| 秋霞成人午夜伦在线观看| 免费xxxx性欧美18vr| 日韩av一区二区三区四区| 美腿丝袜亚洲三区| 蜜臀av性久久久久蜜臀aⅴ| 美女网站一区二区| 精品综合久久久久久8888| 国产在线日韩欧美| 国产91露脸合集magnet| 成人精品国产免费网站| 99精品国产热久久91蜜凸| 色999日韩国产欧美一区二区| 欧美在线视频日韩| 欧美精品乱人伦久久久久久| 日韩免费高清视频| 久久久一区二区| 中文字幕一区二区三区在线播放 | 国产精品免费aⅴ片在线观看| 中文字幕一区二区三区视频| 亚洲伦在线观看| 亚洲成人动漫一区| 久久国产生活片100| 懂色av一区二区夜夜嗨| 色av一区二区| 欧美一区二区三区免费大片 | 午夜精品一区二区三区三上悠亚| 日韩精品亚洲专区| 国产一区视频在线看| jvid福利写真一区二区三区| 在线观看日韩精品| 日韩欧美一卡二卡| 国产精品黄色在线观看| 亚洲成人自拍网| 精品一区二区三区久久久| 成人激情小说网站| 欧美日韩国产三级| 2023国产精华国产精品| 亚洲三级在线看| 日日摸夜夜添夜夜添亚洲女人| 国产一区二区三区免费播放| 99精品国产99久久久久久白柏| 欧美日韩不卡一区| 久久在线观看免费| 夜夜揉揉日日人人青青一国产精品| 人人超碰91尤物精品国产| 成年人午夜久久久| 在线播放欧美女士性生活| 国产视频在线观看一区二区三区 | 美女一区二区久久| jlzzjlzz亚洲女人18| 91精品久久久久久久99蜜桃| 日本一区二区高清| 日韩福利视频导航| 一区二区三区视频在线看| 狠狠色狠狠色综合| 91成人免费在线| 久久人人97超碰com| 亚洲午夜免费电影| 精品国产乱码久久久久久久久| 中文字幕一区二区三区视频 | 成人精品小蝌蚪| 欧美福利视频导航| 国产精品萝li| 久久精品国产99国产精品| 91丨九色丨国产丨porny| 欧美不卡一二三| 一级精品视频在线观看宜春院 | 亚洲精品国产一区二区精华液| 极品美女销魂一区二区三区免费| 91成人免费网站| 中文字幕av一区二区三区免费看 | 午夜精品视频在线观看| 夫妻av一区二区| 日韩免费在线观看| 亚洲高清不卡在线| 波多野结衣欧美| 亚洲精品一区二区三区影院| 亚洲国产毛片aaaaa无费看 | 色94色欧美sute亚洲线路一ni| 精品乱人伦小说| 亚洲成a人片在线不卡一二三区| 成人综合在线观看| 精品久久久久久久久久久久包黑料 | 中文字幕av在线一区二区三区|