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

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

?? serialdemo.java

?? java communications api 3.0
?? JAVA
?? 第 1 頁(yè) / 共 2 頁(yè)
字號(hào):
    /**     * Writes the current parameters to a configuration file of the     * java.properties style.     */    private void writeFile(String path) {	Properties       newProps;	FileOutputStream fileOut = null;	newProps = new Properties();	newProps.put("portName", parameters.getPortName());	newProps.put("baudRate", parameters.getBaudRateString());	newProps.put("flowControlIn", parameters.getFlowControlInString());	newProps.put("flowControlOut", parameters.getFlowControlOutString());	newProps.put("parity", parameters.getParityString());	newProps.put("databits", parameters.getDatabitsString());	newProps.put("stopbits", parameters.getStopbitsString());	try {	    fileOut = new FileOutputStream(path);	} catch (IOException e) {	    System.out.println("Could not open file for writiing");	} 	try {	   writeProps(newProps,"Serial Demo poperties");	} catch(Exception e) {	}		try {	    fileOut.close();	} catch (IOException e) {	    System.out.println("Could not close file for writiing");	}     }     /**     * Cleanly shuts down the applicaion. first closes any open ports and     * cleans up, then exits.     */    private void shutdown() {	connection.closeConnection();	System.exit(1);    }     /**     * Finds configuration file in arguments and creates a properties object from     * that file.     */    private void parseArgs(String[] args) {	if (args.length < 1) {	    return;	} 	File f = new File(args[0]);	if (!f.exists()) {	    f = new File(System.getProperty("user.dir") 			 + System.getProperty("path.separator") + args[0]);	} 	if (f.exists()) {	    try {		FileInputStream fis = new FileInputStream(f);		props = new Properties();		props.load(fis);		fis.close();		loadParams();	    } catch (IOException e) {}	}     }     /**     * Set the parameters object to the settings in the properties object.     */    private void loadParams() {	parameters.setPortName(props.getProperty("portName"));	parameters.setBaudRate(props.getProperty("baudRate"));	parameters.setFlowControlIn(props.getProperty("flowControlIn"));	parameters.setFlowControlOut(props.getProperty("flowControlOut"));	parameters.setParity(props.getProperty("parity"));	parameters.setDatabits(props.getProperty("databits"));	parameters.setStopbits(props.getProperty("stopbits"));	setConfigurationPanel();    }         /**     * GUI element that holds the user changable elements for connection     * configuration.     */    class ConfigurationPanel extends Panel implements ItemListener {	private Frame  parent;	private Label  portNameLabel;	private Choice portChoice;	private Label  baudLabel;	private Choice baudChoice;	private Label  flowControlInLabel;	private Choice flowChoiceIn;	private Label  flowControlOutLabel;	private Choice flowChoiceOut;	private Label  databitsLabel;	private Choice databitsChoice;	private Label  stopbitsLabel;	private Choice stopbitsChoice;	private Label  parityLabel;	private Choice parityChoice;	/**	 * Creates and initilizes the configuration panel. The initial settings	 * are from the parameters object.	 */	public ConfigurationPanel(Frame parent) {	    this.parent = parent;	    setLayout(new GridLayout(4, 4));	    portNameLabel = new Label("Port Name:", Label.LEFT);	    add(portNameLabel);	    portChoice = new Choice();	    portChoice.addItemListener(this);	    add(portChoice);	    listPortChoices();	    portChoice.select(parameters.getPortName());	    baudLabel = new Label("Baud Rate:", Label.LEFT);	    add(baudLabel);	    baudChoice = new Choice();	    baudChoice.addItem("300");	    baudChoice.addItem("2400");	    baudChoice.addItem("9600");	    baudChoice.addItem("14400");	    baudChoice.addItem("28800");	    baudChoice.addItem("38400");	    baudChoice.addItem("57600");	    baudChoice.addItem("152000");	    baudChoice.select(Integer.toString(parameters.getBaudRate()));	    baudChoice.addItemListener(this);	    add(baudChoice);	    flowControlInLabel = new Label("Flow Control In:", Label.LEFT);	    add(flowControlInLabel);	    flowChoiceIn = new Choice();	    flowChoiceIn.addItem("None");	    flowChoiceIn.addItem("Xon/Xoff In");	    flowChoiceIn.addItem("RTS/CTS In");	    flowChoiceIn.select(parameters.getFlowControlInString());	    flowChoiceIn.addItemListener(this);	    add(flowChoiceIn);	    flowControlOutLabel = new Label("Flow Control Out:", Label.LEFT);	    add(flowControlOutLabel);	    flowChoiceOut = new Choice();	    flowChoiceOut.addItem("None");	    flowChoiceOut.addItem("Xon/Xoff Out");	    flowChoiceOut.addItem("RTS/CTS Out");	    flowChoiceOut.select(parameters.getFlowControlOutString());	    flowChoiceOut.addItemListener(this);	    add(flowChoiceOut);	    databitsLabel = new Label("Data Bits:", Label.LEFT);	    add(databitsLabel);	    databitsChoice = new Choice();	    databitsChoice.addItem("5");	    databitsChoice.addItem("6");	    databitsChoice.addItem("7");	    databitsChoice.addItem("8");	    databitsChoice.select(parameters.getDatabitsString());	    databitsChoice.addItemListener(this);	    add(databitsChoice);	    stopbitsLabel = new Label("Stop Bits:", Label.LEFT);	    add(stopbitsLabel);	    stopbitsChoice = new Choice();	    stopbitsChoice.addItem("1");	    stopbitsChoice.addItem("1.5");	    stopbitsChoice.addItem("2");	    stopbitsChoice.select(parameters.getStopbitsString());	    stopbitsChoice.addItemListener(this);	    add(stopbitsChoice);	    parityLabel = new Label("Parity:", Label.LEFT);	    add(parityLabel);	    parityChoice = new Choice();	    parityChoice.addItem("None");	    parityChoice.addItem("Even");	    parityChoice.addItem("Odd");	    parityChoice.select("None");	    parityChoice.select(parameters.getParityString());	    parityChoice.addItemListener(this);	    add(parityChoice);	}	/**	 * Sets the configuration panel to the settings in the parameters object.	 */	public void setConfigurationPanel() {	    portChoice.select(parameters.getPortName());	    baudChoice.select(parameters.getBaudRateString());	    flowChoiceIn.select(parameters.getFlowControlInString());	    flowChoiceOut.select(parameters.getFlowControlOutString());	    databitsChoice.select(parameters.getDatabitsString());	    stopbitsChoice.select(parameters.getStopbitsString());	    parityChoice.select(parameters.getParityString());	} 	/**	 * Sets the parameters object to the settings in the configuration panel.	 */	public void setParameters() {	    parameters.setPortName(portChoice.getSelectedItem());	    parameters.setBaudRate(baudChoice.getSelectedItem());	    parameters.setFlowControlIn(flowChoiceIn.getSelectedItem());	    parameters.setFlowControlOut(flowChoiceOut.getSelectedItem());	    parameters.setDatabits(databitsChoice.getSelectedItem());	    parameters.setStopbits(stopbitsChoice.getSelectedItem());	    parameters.setParity(parityChoice.getSelectedItem());	} 	/**	 * Sets the elements for the portChoice from the ports available on the	 * system. Uses an emuneration of comm ports returned by	 * CommPortIdentifier.getPortIdentifiers(), then sets the current	 * choice to a mathing element in the parameters object.	 */	void listPortChoices() {	    CommPortIdentifier portId;	    Enumeration	       en = CommPortIdentifier.getPortIdentifiers();	    // iterate through the ports.	    while (en.hasMoreElements()) {		portId = (CommPortIdentifier) en.nextElement();		if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) {		    portChoice.addItem(portId.getName());		} 	    } 	    portChoice.select(parameters.getPortName());	} 	/**	 * Event handler for changes in the current selection of the Choices.	 * If a port is open the port can not be changed.	 * If the choice is unsupported on the platform then the user will	 * be notified and the settings will revert to their pre-selection	 * state.	 */	public void itemStateChanged(ItemEvent e) {	    // Check if port is open.	    if (connection.isOpen()) {		// If port is open do not allow port to change.		if (e.getItemSelectable() == portChoice) {		    // Alert user.		    AlertDialog ad = new AlertDialog(parent, "Port Open!", 						     "Port can not", 						     "be changed", 						     "while a port is open.");		    // Return configurationPanel to pre-choice settings.		    setConfigurationPanel();		    return;		} 		// Set the parameters from the choice panel.		setParameters();		try {		    // Attempt to change the settings on an open port.		    connection.setConnectionParameters();		} catch (SerialConnectionException ex) {		    // If setting can not be changed, alert user, return to		    // pre-choice settings.		    AlertDialog ad = 			new AlertDialog(parent, "Unsupported Configuration!", 					"Configuration Parameter unsupported,", 					"select new value.", 					"Returning to previous configuration.");		    setConfigurationPanel();		} 	    } else {		// Since port is not open just set the parameter object.		setParameters();	    } 	}     }    /**     * Handles closing down system. Allows application to be closed with window     * close box.     */    class CloseHandler extends WindowAdapter {	SerialDemo sd;	/**	 * Constructor declaration	 *	 *	 * @param sd	 *	 * @see	 */	public CloseHandler(SerialDemo sd) {	    this.sd = sd;	}	/**	 * Method declaration	 *	 *	 * @param e	 *	 * @see	 */	public void windowClosing(WindowEvent e) {	    sd.shutdown();	}     }}

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日本一区二区| 亚洲免费电影在线| 国产一区二区视频在线| 青娱乐精品在线视频| 国产成人免费高清| 亚洲欧美欧美一区二区三区| 在线观看一区二区视频| 亚洲第一在线综合网站| 欧美一区二区女人| 韩国成人福利片在线播放| 中文字幕第一区二区| 99精品视频在线播放观看| 一区二区成人在线视频| 欧美一三区三区四区免费在线看| 国内精品免费**视频| 国产午夜精品久久久久久免费视| 成人性生交大片免费看中文| 91精品国产欧美一区二区18| 国产一区二区三区免费观看| 国产精品国产成人国产三级| 欧洲另类一二三四区| 麻豆精品在线播放| 中文字幕 久热精品 视频在线| 94色蜜桃网一区二区三区| 亚洲欧美色图小说| 日韩欧美不卡一区| 国产高清不卡一区二区| 亚洲一区二区三区四区五区中文| 精品国产伦一区二区三区观看体验 | 国产三级久久久| 丁香啪啪综合成人亚洲小说| 亚洲www啪成人一区二区麻豆| 337p粉嫩大胆噜噜噜噜噜91av| 91香蕉视频mp4| 老司机精品视频一区二区三区| 日韩理论片在线| 日韩精品中文字幕一区| 91在线观看视频| 美腿丝袜在线亚洲一区| 成人欧美一区二区三区黑人麻豆 | 一区二区三区精品| 国产亚洲精品中文字幕| 2019国产精品| 久久一区二区三区四区| 日韩欧美不卡在线观看视频| 日韩视频在线你懂得| 欧美一区二区观看视频| 日韩欧美在线1卡| 欧美大片拔萝卜| 欧美第一区第二区| 久久精品在线免费观看| 久久久久久久久蜜桃| 欧美激情艳妇裸体舞| 国产欧美精品一区二区色综合 | 六月丁香综合在线视频| 蜜桃视频在线观看一区| 精品一区二区三区视频在线观看| 精品在线一区二区| 国产成人精品免费一区二区| 91丨九色丨蝌蚪富婆spa| 色香蕉久久蜜桃| 91精品一区二区三区久久久久久 | 亚洲精品乱码久久久久久久久 | 一区二区三区精品| 天天爽夜夜爽夜夜爽精品视频| 蜜臀av性久久久久蜜臀aⅴ四虎| 蜜桃一区二区三区在线| 国产超碰在线一区| 91精品1区2区| 宅男噜噜噜66一区二区66| 欧美成人一级视频| 国产精品天天看| 亚洲一区免费视频| 裸体在线国模精品偷拍| 99精品视频在线观看免费| 欧美日韩国产美女| 久久欧美中文字幕| 亚洲欧美偷拍卡通变态| 日韩不卡手机在线v区| 国产精品888| 91蜜桃免费观看视频| 在线不卡a资源高清| 久久伊99综合婷婷久久伊| 中文字幕佐山爱一区二区免费| 爽爽淫人综合网网站| 国产乱码精品一区二区三区忘忧草 | 中文字幕第一页久久| 午夜免费欧美电影| av在线不卡网| 日韩精品专区在线影院观看| 综合电影一区二区三区| 美国一区二区三区在线播放| 在线看日本不卡| 国产婷婷色一区二区三区四区 | 欧美一级高清大全免费观看| 久久久久久久网| 视频一区中文字幕| 93久久精品日日躁夜夜躁欧美| 精品久久国产字幕高潮| 一区二区三区在线观看视频| 国产精品88av| 宅男在线国产精品| 欧美精品一区男女天堂| 亚洲精品视频观看| 蜜臀av一区二区| 国产一区二区三区av电影 | 成人av高清在线| 3atv一区二区三区| 1000精品久久久久久久久| 午夜精品一区二区三区免费视频| 国产精品一区二区三区99| 色婷婷精品大在线视频| 51精品国自产在线| 亚洲区小说区图片区qvod| 激情小说欧美图片| 不卡一区在线观看| 欧美一区二区三区免费| 亚洲精品大片www| 成人小视频在线| 欧美视频在线观看一区二区| 中文字幕免费一区| 日韩av一级电影| 91在线观看下载| 精品免费国产二区三区| 天堂va蜜桃一区二区三区漫画版| 成人免费高清视频| 国产精品美女视频| 久久精品国产亚洲高清剧情介绍 | 欧美电影一区二区| 国产日韩欧美电影| 国产麻豆成人传媒免费观看| 欧美日韩国产乱码电影| 一区二区免费在线播放| 成人午夜av在线| 久久亚洲一区二区三区四区| 激情综合色播激情啊| 正在播放亚洲一区| 午夜不卡av在线| 91麻豆自制传媒国产之光| 亚洲国产激情av| 不卡一区二区在线| 欧美国产精品中文字幕| 九色综合狠狠综合久久| 欧美精品 国产精品| 亚洲精品乱码久久久久久久久| 91精彩视频在线| 亚洲综合精品自拍| 色综合咪咪久久| 最好看的中文字幕久久| 波多野结衣亚洲一区| 国产精品欧美经典| 99在线精品视频| 国产精品沙发午睡系列990531| 国产在线精品一区二区不卡了 | 国产精品久久久久久久裸模| 国产成人激情av| 国产精品素人一区二区| 成人午夜电影网站| 亚洲一区国产视频| 欧美日韩国产片| 青娱乐精品视频| 精品久久久三级丝袜| 国产一区二区三区四| 精品国产区一区| 成人av在线一区二区| 亚洲男同性视频| 欧美性高清videossexo| 香蕉久久夜色精品国产使用方法| 日韩欧美国产精品一区| 国产精品66部| 国产色综合久久| 成人精品视频.| 国产精品欧美久久久久一区二区| 欧美性生活大片视频| 日韩精品久久久久久| 欧美精品一区二区三区在线播放| 岛国一区二区三区| 洋洋av久久久久久久一区| 91精品国产色综合久久ai换脸| 久久国产精品无码网站| 国产日韩亚洲欧美综合| 91免费国产在线| 亚洲成人动漫av| 精品少妇一区二区三区在线视频| 国产91色综合久久免费分享| 亚洲免费观看高清完整版在线| 欧美日韩高清影院| 美女视频网站久久| 自拍视频在线观看一区二区| 555www色欧美视频| 激情综合网av| 亚洲欧美一区二区不卡| 久久亚洲一区二区三区明星换脸 | 美女脱光内衣内裤视频久久网站| 国产香蕉久久精品综合网| 97se亚洲国产综合自在线| 午夜成人免费电影| 国产精品久久久久婷婷二区次| 91视视频在线观看入口直接观看www | 欧美极品另类videosde|