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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? serialdemo.java

?? java communications api 3.0
?? JAVA
?? 第 1 頁 / 共 2 頁
字號(hào):
/* * @(#)SerialDemo.java	1.15 00/06/01 SMI *  * Copyright 2003 Sun Microsystems, Inc. All rights reserved. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. *  * Sun grants you ("Licensee") a non-exclusive, royalty free, license * to use, modify and redistribute this software in source and binary * code form, provided that i) this copyright notice and license appear * on all copies of the software; and ii) Licensee does not utilize the * software in a manner which is disparaging to Sun. *  * This software is provided "AS IS," without a warranty of any kind. * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN AND * ITS LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY * LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THE * SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS * BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, * INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, * HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING * OUT OF THE USE OF OR INABILITY TO USE SOFTWARE, EVEN IF SUN HAS BEEN * ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. *  * This software is not designed or intended for use in on-line control * of aircraft, air traffic, aircraft navigation or aircraft * communications; or in the design, construction, operation or * maintenance of any nuclear facility. Licensee represents and * warrants that it will not use or redistribute the Software for such * purposes. */import javax.comm.*;import java.awt.*;import java.awt.event.*;import java.io.File;import java.io.FileInputStream;import java.io.FileOutputStream;import java.io.IOException;import java.io.FileNotFoundException;import java.util.Properties;import java.util.Enumeration;/** * Main file for SerialDemo program. This program illustrates many of the * abilities of the javax.comm api. This file contains the GUI framework that * the program runs in. */public class SerialDemo extends Frame implements ActionListener {    final int		       HEIGHT = 450;    final int		       WIDTH = 410;    private MenuBar	       mb;    private Menu	       fileMenu;    private MenuItem	       openItem;    private MenuItem	       saveItem;    private MenuItem	       exitItem;    private Button	       openButton;    private Button	       closeButton;    private Button	       breakButton;    private Panel	       buttonPanel;    private Panel	       messagePanel;    private TextArea	       messageAreaOut;    private TextArea	       messageAreaIn;    private ConfigurationPanel configurationPanel;    private SerialParameters   parameters;    private SerialConnection   connection;    private Properties	       props = null;    /**     * Main method. Checks to see if the command line agrument is requesting     * usage informaition (-h, -help), if it is, display a usage message and     * exit, otherwise create a new <code>SerialDemo</code> and set it visible.     */    public static void main(String[] args) {	if ((args.length > 0) 		&& (args[0].equals("-h") || args[0].equals("-help"))) {	    System.out.println("usage: java SerialDemo [configuration File]");	    System.exit(1);	} 	SerialDemo serialDemo = new SerialDemo(args);	serialDemo.setVisible(true);	serialDemo.repaint();    }     /**     * Create new <code>SerialDemo</code> and initilizes it. Parses args to     * find configuration file. If found, initial state it set to parameters     * in configuration file.     * @param args command line arguments used when program was invoked.     */    public SerialDemo(String[] args) {	super("Serial Demo");	parameters = new SerialParameters();	// Set up the GUI for the program	addWindowListener(new CloseHandler(this));	mb = new MenuBar();	fileMenu = new Menu("File");	openItem = new MenuItem("Load");	openItem.addActionListener(this);	fileMenu.add(openItem);	saveItem = new MenuItem("Save");	saveItem.addActionListener(this);	fileMenu.add(saveItem);	exitItem = new MenuItem("Exit");	exitItem.addActionListener(this);	fileMenu.add(exitItem);	mb.add(fileMenu);	setMenuBar(mb);	messagePanel = new Panel();	messagePanel.setLayout(new GridLayout(2, 1));	messageAreaOut = new TextArea();	messagePanel.add(messageAreaOut);	messageAreaIn = new TextArea();	messageAreaIn.setEditable(false);	messagePanel.add(messageAreaIn);	add(messagePanel, "Center");	configurationPanel = new ConfigurationPanel(this);	buttonPanel = new Panel();	openButton = new Button("Open Port");	openButton.addActionListener(this);	buttonPanel.add(openButton);	closeButton = new Button("Close Port");	closeButton.addActionListener(this);	closeButton.setEnabled(false);	buttonPanel.add(closeButton);	breakButton = new Button("Send Break");	breakButton.addActionListener(this);	breakButton.setEnabled(false);	buttonPanel.add(breakButton);	Panel		   southPanel = new Panel();	GridBagLayout      gridBag = new GridBagLayout();	GridBagConstraints cons = new GridBagConstraints();	southPanel.setLayout(gridBag);	cons.gridwidth = GridBagConstraints.REMAINDER;	gridBag.setConstraints(configurationPanel, cons);	cons.weightx = 1.0;	southPanel.add(configurationPanel);	gridBag.setConstraints(buttonPanel, cons);	southPanel.add(buttonPanel);	add(southPanel, "South");	parseArgs(args);	connection = new SerialConnection(this, parameters, messageAreaOut, 					  messageAreaIn);	setConfigurationPanel();	Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();	setLocation(screenSize.width / 2 - WIDTH / 2, 		    screenSize.height / 2 - HEIGHT / 2);	setSize(WIDTH, HEIGHT);    }    /**     * Sets the GUI elements on the configurationPanel.     */    public void setConfigurationPanel() {	configurationPanel.setConfigurationPanel();    }     /**     * Responds to the menu items and buttons.     */    public void actionPerformed(ActionEvent e) {	String cmd = e.getActionCommand();	// Loads a configuration file.	if (cmd.equals("Load")) {	    if (connection.isOpen()) {		AlertDialog ad = new AlertDialog(this, "Port Open!", 						 "Configuration may not", 						 "be loaded", 						 "while a port is open.");	    } else {		FileDialog fd = new FileDialog(this, 					       "Load Port Configuration", 					       FileDialog.LOAD);		fd.setVisible(true);		String file = fd.getFile();		if (file != null) {		    String dir = fd.getDirectory();		    File   f = new File(dir + file);		    try {			FileInputStream fis = new FileInputStream(f);			props = new Properties();			props.load(fis);			fis.close();		    } catch (FileNotFoundException e1) {			System.err.println(e1);		    } catch (IOException e2) {			System.err.println(e2);		    } 		    loadParams();		} 	    } 	} 	// Saves a configuration file.	if (cmd.equals("Save")) {	    configurationPanel.setParameters();	    FileDialog fd = new FileDialog(this, "Save Port Configuration", 					   FileDialog.SAVE);	    fd.setFile("serialdemo.properties");	    fd.setVisible(true);	    String fileName = fd.getFile();	    String directory = fd.getDirectory();	    if ((fileName != null) && (directory != null)) {		writeFile(directory + fileName);	    } 	} 	// Calls shutdown, which exits the program.	if (cmd.equals("Exit")) {	    shutdown();	} 	// Opens a port.	if (cmd.equals("Open Port")) {	    openButton.setEnabled(false);	    Cursor previousCursor = getCursor();	    setNewCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));	    configurationPanel.setParameters();	    try {		connection.openConnection();	    } catch (SerialConnectionException e2) {		AlertDialog ad = 		    new AlertDialog(this, "Error Opening Port!", 				    "Error opening port,", 				    e2.getMessage() + ".", 				    "Select new settings, try again.");		openButton.setEnabled(true);		setNewCursor(previousCursor);		return;	    } 	    portOpened();	    setNewCursor(previousCursor);	} 	// Closes a port.	if (cmd.equals("Close Port")) {	    portClosed();	} 	// Sends a break signal to the port.	if (cmd.equals("Send Break")) {	    connection.sendBreak();	}     }     public synchronized void writeProps(Properties props,String header) {        java.io.PrintWriter prnt;        prnt = new java.io.PrintWriter(System.out, true);	boolean localize = false;	if (header != null) {	    prnt.write('#');	    prnt.println(header);	}	for (Enumeration e = props.keys() ; e.hasMoreElements() ;) {	    String key = (String)e.nextElement();	    prnt.print(key);	    prnt.write('=');	    String val = (String)props.get(key);	    int len = val.length();	    boolean empty = false;	    for (int i = 0 ; i < len ; i++) {		int ch = val.charAt(i);		switch (ch) {		  case '\\': prnt.write('\\'); prnt.write('\\'); break;		  case '\t': prnt.write('\\'); prnt.write('t'); break;		  case '\n': prnt.write('\\'); prnt.write('n'); break;		  case '\r': prnt.write('\\'); prnt.write('r'); break;		  default:			prnt.write(ch);		}		empty = false;	    }	    prnt.write('\n');	}    }    /**     * Toggles the buttons to an open port state.     */    public void portOpened() {	openButton.setEnabled(false);	closeButton.setEnabled(true);	breakButton.setEnabled(true);    }     /**     * Calls closeConnection on the SerialConnection and toggles the buttons     * to a closed port state.     */    public void portClosed() {	connection.closeConnection();	openButton.setEnabled(true);	closeButton.setEnabled(false);	breakButton.setEnabled(false);    }     /**     * Sets the <code>Cursor</code> for the application.     * @param c New <code>Cursor</code>     */    private void setNewCursor(Cursor c) {	setCursor(c);	messageAreaIn.setCursor(c);	messageAreaOut.setCursor(c);    } 

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲免费观看高清完整版在线观看 | 偷拍一区二区三区| 欧美成人一区二区三区片免费| 高清在线成人网| 日韩精品国产精品| 亚洲精品视频免费看| 久久色中文字幕| 51精品视频一区二区三区| 91网站视频在线观看| 国产麻豆日韩欧美久久| 视频在线观看91| 一区二区三区欧美| 中文字幕不卡在线播放| 久久丝袜美腿综合| 欧美成人午夜电影| 91精品国产高清一区二区三区 | 激情文学综合丁香| 亚洲一区二区三区激情| 日韩毛片一二三区| 国产精品护士白丝一区av| 久久久久国产一区二区三区四区 | 欧美精品 日韩| 日本韩国精品在线| 97久久精品人人做人人爽| 成人污视频在线观看| 国产高清不卡一区二区| 国产一区日韩二区欧美三区| 美女一区二区三区在线观看| 三级成人在线视频| 亚洲午夜精品久久久久久久久| 亚洲乱码中文字幕综合| 亚洲欧美日韩国产手机在线 | 国产精品国产三级国产aⅴ中文| 欧美精品一区二区三区一线天视频| 91麻豆精品国产91久久久使用方法| 欧美影片第一页| 欧美三片在线视频观看| 欧美午夜精品久久久| 欧美视频一区二区| 欧美色欧美亚洲另类二区| 欧美日韩国产一级| 884aa四虎影成人精品一区| 欧美一区三区二区| 欧美一区二区免费观在线| 欧美一区二区在线播放| 91精品国产色综合久久| 日韩视频国产视频| 久久久不卡影院| 国产精品美女久久久久高潮| **性色生活片久久毛片| 一区二区在线观看不卡| 亚洲国产精品人人做人人爽| 无码av免费一区二区三区试看| 天堂久久一区二区三区| 青草国产精品久久久久久| 久久99久久久久久久久久久| 国产风韵犹存在线视精品| 成人免费视频视频在线观看免费| av中文字幕在线不卡| 欧洲精品一区二区| 日韩久久久精品| 日本一区免费视频| 亚洲精品一卡二卡| 日韩国产高清在线| 国产精品一线二线三线| 97久久精品人人做人人爽50路| 欧美网站一区二区| 精品盗摄一区二区三区| 国产精品美女视频| 丝袜a∨在线一区二区三区不卡| 看片网站欧美日韩| www.欧美色图| 欧美精品 国产精品| 国产丝袜欧美中文另类| 亚洲最新视频在线观看| 蜜桃久久av一区| 99九九99九九九视频精品| 欧美高清www午色夜在线视频| 2023国产一二三区日本精品2022| 中文字幕一区二区三区av| 秋霞午夜av一区二区三区| 国产成人综合自拍| 欧美精品在线观看一区二区| 国产亚洲制服色| 亚洲va韩国va欧美va精品| 国产成人一区二区精品非洲| 欧美中文字幕一区| 久久久久久99久久久精品网站| 亚洲第一二三四区| 成人午夜在线播放| 欧美一区二区三区在线看| 国产精品成人网| 狠狠久久亚洲欧美| 欧美日韩一区二区在线观看| 中文欧美字幕免费| 蜜臀av性久久久久蜜臀aⅴ四虎| 91免费国产在线观看| 精品国产123| 日本中文一区二区三区| 91免费观看视频| 国产欧美一区二区在线观看| 日韩电影免费在线看| 91小宝寻花一区二区三区| 久久久久久亚洲综合影院红桃| 亚洲第一福利一区| 一本色道综合亚洲| 国产午夜精品美女毛片视频| 裸体健美xxxx欧美裸体表演| 在线欧美日韩国产| 最新日韩在线视频| 国产成人aaa| 久久亚洲精华国产精华液 | 国产揄拍国内精品对白| 欧美色图第一页| 一区二区三区中文字幕电影| 成人福利视频网站| 久久久久久久久久久电影| 精品亚洲aⅴ乱码一区二区三区| 欧美日本在线视频| 亚洲成人av一区二区三区| 色域天天综合网| 亚洲三级小视频| av福利精品导航| 国产精品久久久久一区二区三区共 | 欧美久久久一区| 洋洋av久久久久久久一区| 91麻豆福利精品推荐| 国产精品家庭影院| av一区二区久久| 亚洲欧美激情小说另类| 99久久久免费精品国产一区二区| 国产精品久久久久久久久动漫| 国产成人亚洲综合a∨猫咪| 欧美成人aa大片| 国产精品自拍毛片| 精品国产乱码久久久久久闺蜜| 精品一区二区久久| 久久综合视频网| 高清视频一区二区| 中文字幕亚洲综合久久菠萝蜜| www.日韩在线| 夜夜爽夜夜爽精品视频| 欧美日韩一区二区三区在线看| 亚洲国产精品天堂| 91精品欧美一区二区三区综合在| 免播放器亚洲一区| 精品国产凹凸成av人导航| 国产麻豆视频一区二区| 亚洲国产精品99久久久久久久久| www..com久久爱| 悠悠色在线精品| 91麻豆精品国产综合久久久久久| 久久国产成人午夜av影院| 久久精品一区四区| 99精品视频在线观看免费| 亚洲综合自拍偷拍| 91精品国产黑色紧身裤美女| 国产在线日韩欧美| 中文字幕一区二区三区视频| 欧美自拍偷拍午夜视频| 美女被吸乳得到大胸91| 欧美国产在线观看| 99久久国产综合精品女不卡| 亚洲一区二区精品视频| 欧美一区二区黄色| 国产福利电影一区二区三区| 亚洲卡通欧美制服中文| 欧美高清精品3d| 高清免费成人av| 一区二区三区四区在线播放| 欧美一级高清片| 成人午夜视频在线观看| 五月天精品一区二区三区| 久久这里只精品最新地址| 99久久99久久精品免费观看| 日本欧美一区二区在线观看| 日本一区二区三区国色天香| 欧美影视一区二区三区| 国产毛片精品一区| 亚洲电影你懂得| 欧美国产精品一区| 欧美日本一区二区三区| 久久精品国产网站| 一区二区三区不卡视频在线观看| 欧美一三区三区四区免费在线看| 国产福利一区二区| 亚洲成人动漫av| 国产精品欧美经典| 欧美电视剧免费全集观看| 99久久久国产精品| 精品一区二区日韩| 亚洲精品视频在线看| 久久综合成人精品亚洲另类欧美 | 欧美午夜电影在线播放| 国产一区美女在线| 日韩高清不卡在线| 亚洲人xxxx| 欧美国产成人在线| 欧美岛国在线观看| 欧美日韩不卡一区二区|