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

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

?? serialdemo.java

?? 本程序基于長江通信的CDMA1X無線網(wǎng)卡
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
/* * @(#)SerialDemo.java	1.9 98/06/05 SMI * * Copyright (c) 1998 Sun Microsystems, Inc. All Rights Reserved. * * 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();	}    }    /**    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);    }    /**    Writes the current parameters to a configuration file of the 

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产美女视频一区| 午夜精品福利一区二区蜜股av| 国产午夜精品福利| 欧美激情中文字幕| 日本成人在线不卡视频| 大尺度一区二区| 欧美在线播放高清精品| www国产精品av| 亚洲综合在线第一页| 国产精品一品视频| 欧美一级日韩免费不卡| 亚洲欧洲日韩综合一区二区| 天天综合日日夜夜精品| 欧美一区二区在线免费播放| 久久精品国产色蜜蜜麻豆| 欧美色倩网站大全免费| 国产欧美一区二区三区在线老狼| 日本一区中文字幕| 久久亚洲欧美国产精品乐播 | 懂色一区二区三区免费观看| 欧美视频在线一区| 自拍视频在线观看一区二区| 国产精品一二三区在线| 亚洲欧美日韩在线| 成人国产免费视频| 国产欧美一区二区在线| 欧美羞羞免费网站| 国产老肥熟一区二区三区| 亚洲自拍偷拍麻豆| 久久久久国产精品厨房| 国产乱码精品一区二区三区忘忧草| 国产精品欧美久久久久无广告 | 国产成人综合亚洲网站| 久久久国产午夜精品| 91麻豆swag| 一区二区三区成人| 欧美日本在线播放| 亚洲在线观看免费| 国产午夜三级一区二区三| 欧美亚洲高清一区| 成人一区在线观看| 麻豆精品在线播放| 久久久不卡网国产精品一区| 欧美日韩一区三区| 99国产欧美另类久久久精品| 亚洲美女精品一区| 精品国产不卡一区二区三区| 国产精品一区免费在线观看| 亚洲高清视频的网址| 91精品国产综合久久精品图片| 五月激情综合婷婷| 亚洲免费观看高清完整| 国产精品天干天干在观线| 欧美一区二区三区视频在线| 91极品视觉盛宴| 日韩高清不卡一区二区三区| 亚洲免费av高清| 国产精品久久久久9999吃药| 在线观看欧美日本| av不卡免费在线观看| 亚洲午夜在线观看视频在线| 国产精品美女久久久久av爽李琼| 久久久噜噜噜久久人人看| 欧美大尺度电影在线| 国产91精品精华液一区二区三区 | 亚洲精品高清在线| 精品三级在线观看| 成人激情小说网站| 国产美女视频一区| 国产精品亚洲一区二区三区在线| 另类小说一区二区三区| 美日韩黄色大片| 奇米色777欧美一区二区| 国产亚洲欧美中文| 久久久久国产一区二区三区四区| 精品国精品国产尤物美女| 欧美一区二区在线免费播放| 欧美一三区三区四区免费在线看 | 国产自产视频一区二区三区| 亚洲欧美日韩国产中文在线| 最新久久zyz资源站| 亚洲特黄一级片| 中文字幕亚洲在| 亚洲免费观看高清完整版在线 | 七七婷婷婷婷精品国产| 青青青爽久久午夜综合久久午夜| 午夜精品在线视频一区| 日韩精品电影在线观看| 亚洲欧美另类图片小说| 亚洲一卡二卡三卡四卡| 午夜精品成人在线视频| 久久国产精品72免费观看| 欧美高清视频一二三区 | 国产一区二区三区四区五区美女| 国产一区二区三区香蕉| 从欧美一区二区三区| 91最新地址在线播放| 欧美日韩国产综合一区二区三区 | 日韩欧美区一区二| 久久这里只精品最新地址| 国产精品欧美一区喷水| 亚洲福利电影网| 麻豆91在线播放免费| 成人av网站免费| 欧美日韩国产三级| 国产亚洲欧美一级| 亚洲夂夂婷婷色拍ww47 | 亚洲国产日韩av| 精品一区二区精品| 天天色图综合网| 国产毛片精品视频| 色8久久精品久久久久久蜜| 欧美久久久久久久久久| 国产欧美视频一区二区三区| 一区二区在线看| 精品无人码麻豆乱码1区2区| 92精品国产成人观看免费 | 国产成人亚洲精品青草天美| 91久久精品一区二区三区| 日韩欧美国产午夜精品| 亚洲欧洲日韩在线| 久久99精品久久久久久国产越南 | 日韩成人精品在线观看| 国产成人av网站| 91精品久久久久久久久99蜜臂| 国产日韩三级在线| 日本欧美一区二区三区| 99久久国产综合精品色伊| 精品久久久网站| 亚洲福利视频一区二区| 成人av在线看| 26uuu欧美日本| 午夜精品福利一区二区三区蜜桃| 波多野结衣在线一区| 日韩午夜在线播放| 欧美不卡视频一区| 婷婷丁香久久五月婷婷| 99视频在线观看一区三区| 日韩精品一区二区在线| 一区二区三区中文字幕| 顶级嫩模精品视频在线看| 日韩三级精品电影久久久| 亚洲最大的成人av| 99re热这里只有精品视频| 久久五月婷婷丁香社区| 婷婷六月综合亚洲| 在线观看成人免费视频| 亚洲欧美另类小说视频| www.久久精品| 国产精品人人做人人爽人人添| 激情伊人五月天久久综合| 欧美美女网站色| 婷婷丁香久久五月婷婷| 欧美日韩激情一区二区| 亚洲v中文字幕| 国产成人精品免费视频网站| 精品成人在线观看| 久久精品噜噜噜成人av农村| 欧美疯狂做受xxxx富婆| 午夜精品免费在线观看| 欧美色视频一区| 亚洲成人动漫一区| 欧美另类久久久品| 日韩av一区二| 精品久久五月天| 国产一区在线不卡| 欧美激情综合网| 成人激情文学综合网| 中文字幕中文乱码欧美一区二区| 国产99精品国产| 欧美—级在线免费片| av日韩在线网站| 亚洲美女一区二区三区| 一本久道久久综合中文字幕| 欧美成人艳星乳罩| 国产在线精品一区在线观看麻豆| 日韩欧美国产一区在线观看| 久久精品国产一区二区三区免费看| 日韩三级精品电影久久久| 黄色日韩三级电影| 久久久久国产精品厨房| av亚洲精华国产精华| 一区二区久久久久| 91精品国产一区二区三区| 精品中文字幕一区二区小辣椒 | 国产精品久久久久久亚洲伦 | 欧美精品亚洲一区二区在线播放| 三级欧美韩日大片在线看| 日韩欧美电影一区| 成人综合在线网站| 亚洲美女免费视频| 91精品国产91久久久久久一区二区| 韩国三级电影一区二区| 日韩一区欧美一区| 欧美日本一区二区三区| 国产精品一区二区果冻传媒| 亚洲精品国产无套在线观| 日韩欧美中文字幕精品| 成人性生交大片| 亚洲va国产va欧美va观看|