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

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

?? locationedit.java

?? gpsLogger是一個基于手機或PDA的個人移動導(dǎo)航(車載導(dǎo)航)系統(tǒng)中記錄gps信息的小工具
?? JAVA
字號:


import litebase.*;
import litebase.ui.*;
import waba.fx.Font;
import waba.fx.Sound;
import waba.sys.Convert;
import waba.sys.Time;
import waba.sys.Vm;
import waba.ui.Button;
import waba.ui.ComboBox;
import waba.ui.Container;
import waba.ui.Control;
import waba.ui.ControlEvent;
import waba.ui.Edit;
import waba.ui.Event;
import waba.ui.Label;
import waba.ui.MainWindow;
import waba.ui.MessageBox;
import waba.ui.PushButtonGroup;
import waba.ui.TabPanel;
import waba.ui.Window;
/*
 * locationEdit pops up a window allowing the user to edit values in the lookup
 * table that load the "Location" combobox.
 * 
 */
public class locationEdit extends Window {
	public static locationEdit instance = new locationEdit();		
	dataCapture dataCapture;
	gpsDataLogger gpsDataLogger;
	Button btnTest,btnPurge,btnFirstRecord, btnNextRecord, btnPreviousRecord, btnLastRecord, btnClear, btnSave, btnUpdate,btnDelete,btnExit;
	Edit edLocation,edRowId;
	String szInput = "",s;    
	MessageBox mb1,mbLocationTableEmpty;
	private PushButtonGroup pbgBrowseButtons;
	String szBrowseButtons[] = {" Save ","Update","Delete","Clear "," ||<<"," << "," >> "," >>|| "};
	String szHeight, szWidth, szPlatform, szRowId;
	int rowId;
	char c;
	private Font bigFont=new Font("SW",Font.PLAIN,72);
	LitebaseConnection driver = LitebaseConnection.getInstance("AZoe");
	
	public locationEdit(){
		super ("Location Table Edit",ROUND_BORDER);		
		szWidth = gpsDataLogger.szWidth;
		szHeight = gpsDataLogger.szHeight;
		szPlatform = gpsDataLogger.szPlatform;
		
		int iTmpWidth=this.width;
		int iTmpHeight=this.height;//delete this???
		
		setRect(CENTER,CENTER,iTmpWidth/32 * 31,iTmpWidth/8 * 5);
		
		LoadLocationComboBoxStringArray();
		
		add(new Label("Row Id"),LEFT+2,TOP+2);
		edRowId = new Edit();
		add (edRowId);
		edRowId.setRect(AFTER+2,SAME-1,25,PREFERRED);          
		edRowId.setMaxLength(5);
		edRowId.setText("");
		edRowId.setEditable(false);
		
		btnExit = new Button("  Exit  ");
		btnExit.setGap(1);
		add (btnExit,RIGHT-32,SAME);
		
		add(new Label("Location"),LEFT+2,AFTER+4);
		edLocation = new Edit();
		add (edLocation);
		edLocation.setRect(AFTER+2,SAME,iTmpWidth/16 * 10,PREFERRED);         
		edLocation.setMaxLength(40);
		edLocation.setText("");
		
		pbgBrowseButtons = new PushButtonGroup(szBrowseButtons,false,-1,2,6,2,true,PushButtonGroup.BUTTON);
		add(pbgBrowseButtons,CENTER,AFTER+2);
		
		btnPurge = new Button("Purge Location Lookup Table");
		btnPurge.setGap(1);
		add (btnPurge,CENTER,AFTER+2);
		
		//setFocusLess(true);
	}	
	public void onStart() {   	
		setFont(bigFont);
	}	
	
	private boolean verifyFields(){
		boolean locationOk   = edLocation.getText().length() > 0;				
		StringBuffer   sb = new StringBuffer();
		if (!locationOk)   sb.append("location|");				
		if (sb.length() > 0) {
			sb.setLength(sb.length()-1); // remove the last |
			new MessageBox("Attention","You must fill/correct|the following fields:|"+sb).popupModal();			
			return false;
		}
		return true;
	}	
	public void onEvent(Event e){
		int ipbg;		
		Control edAtual;		
		if (e.type == ControlEvent.PRESSED){   
			if ((e.target == pbgBrowseButtons &&
					(ipbg = pbgBrowseButtons.getSelected()) != -1)){		
				switch (ipbg){
				case -1:break; //no item selected
				case 0:{ // Save button
					edAtual = getParentWindow().getFocus();
					if (edAtual != null) {
						if (verifyFields())
							doInsertUpdate(true);
						clear();
						gpsDataLogger.iEmptyLocationLookupTable = 0; //reset flag to 'not empty'
					}	
				}break;
				case 1:{ // Update button
					edAtual = getParentWindow().getFocus();
					if (edAtual != null) {
						if (verifyFields()){
							if (rowId > 0){
								doInsertUpdate(false);
								clear();}
							else
								Sound.beep();
						}
					}
				}break;
				case 2:{ // Delete button
					edAtual = getParentWindow().getFocus();
					if (edAtual != null) {
						szRowId = edRowId.getText();
						rowId = Convert.toInt(szRowId);	 				
						if (rowId > 0)
							doDelete();
						else                    	
							Sound.beep(); 
					}
				}break;
				case 3:{ // Clear button
					edAtual = getParentWindow().getFocus();
					if (edAtual != null) {
						clear();
					}
				}break;
				case 4:{ // First Record, ("||<<") button
					edAtual = getParentWindow().getFocus();
					if (edAtual != null) {
						firstRecord();
					}
				}break;
				case 5:{ // Previous Record, ("<<") button
					edAtual = getParentWindow().getFocus();
					if (edAtual != null) {
						previousRecord();
					}
				}break;
				case 6:{ // Next Record, (">>") button
					edAtual = getParentWindow().getFocus();
					if (edAtual != null) {
						nextRecord();
					}
				}break;
				case 7:{ // Last Record, (">>||") button
					edAtual = getParentWindow().getFocus();
					if (edAtual != null) {
						lastRecord();
					}
				}break;	            	 
				}	
			}
			else if (e.target ==  btnExit){
				LoadLocationComboBoxStringArray();
				Exit();
			}
			else if (e.target ==  btnPurge){
				String []szButtonArray = {"Yes","No"};
				mb1 = new MessageBox("Attention","Do you really want to purge | the lookup table???", szButtonArray);				 					
				mb1.popupBlockingModal();
				int idx = mb1.getPressedButtonIndex();				 				
				if (idx == 0){
					PurgeLocationLookupTable();
					CreateLocationLookupTable();
					CreateLocationLookupTableIndex();
					clear();
					gpsDataLogger.iEmptyLocationLookupTable = 1; //reset flag to 'empty'
				}
				else if (idx == 1){
				}				
			}
		}	 	
	}
	
	public void firstRecord(){  	  
		ResultSet rs = driver.executeQuery("select rowid,location, from locationLookupDB");		
		rs.first(); 	
		edLocation.setText(rs.getString("location"));
		edRowId.setText(rs.getString("rowid")); 
		rs.close();
	}
	
	
	
	public void previousRecord(){//adjusted to keep rowId zero from displaying
		szRowId = edRowId.getText();
		rowId = Convert.toInt(szRowId);
		ResultSet rs = driver.executeQuery("select rowid, location from locationLookupDB where rowid <"+rowId);  //single record is returned??	     	  
		if ((rs.getString("rowid").compareTo("0")==0)){//keeps always empty rowId #0 from being displayed and confusing people...
			rs.close();
			rs = driver.executeQuery("select rowid,location, from locationLookupDB");//full recordset is returned	
		}else{//...if rowId 1 or >...
			rs.last();
			edLocation.setText(rs.getString("location"));
			edRowId.setText(rs.getString("rowid"));
			rs.close();
		}
	}	
	public void nextRecord(){//cleaned up so that rowId 0 is ignored
		szRowId = edRowId.getText();
		rowId = Convert.toInt(szRowId);
		
		ResultSet rs = driver.executeQuery("select rowid,location from locationLookupDB where rowid >"+rowId);//...returns all records greater than current, unless there are no more in which case zero is returned.  	 
		if ((rs.getString("rowid").compareTo("0")==0)){//keeps always empty rowId #0 from being displayed and confusing people...
			rs.close(); //dumps rs, below makes full rs
			rs = driver.executeQuery("select rowid,location, from locationLookupDB");//full recordset is returned	
			rs.last();	//only last record in rs is shown					
		}else{ //shows first record of first rs above w/all of the > rowId records
			rs.first();    	 
		}
		edLocation.setText(rs.getString("location"));
		edRowId.setText(rs.getString("rowid")); 
		rs.close();
	}
	public void lastRecord(){   	  
		ResultSet rs = driver.executeQuery("select rowid,location from locationLookupDB");		
		rs.last();   	  
		edLocation.setText(rs.getString("location"));
		edRowId.setText(rs.getString("rowid"));   
		rs.close();
	}
	private void doInsertUpdate(boolean isInsert){
		String szLocation = edLocation.getText();
		String szRowId = edRowId.getText();
		long lastUpdated = new Time().getTimeLong();
		int rows = -1;
		try{
			if (isInsert){//Save
				rows = driver.executeUpdate("insert into locationLookupDB values ('"+szLocation+"',"+lastUpdated+")");
			}else//update
				rows = driver.executeUpdate("update locationLookupDB set location='"+szLocation+"', lastUpdated="+lastUpdated+" where rowid="+szRowId);
			if (rows == 1){
				clear();
			}
			else Sound.beep();
		} catch (Throwable t) {Vm.debug(t.getMessage());}
	}
	
	private void doDelete(){   	  
		String szRowId = edRowId.getText();
		
		int rows = driver.executeUpdate("delete locationLookupDB where rowid="+szRowId);
		clear();
		if (rows == 1){
			clear();
		}else Sound.beep();
	}
	public void clear(){
		edLocation.setText("");
		edRowId.setText("");
	}
	public void Exit(){ 
		gpsDataLogger.iFirstLocationIteration = 2;
		unpop();
	}
	/***************************************************************************************
	 * LoadLocationComboBoxStringArray() This function moves strings that have been entered
	 * in the lookup table into the string array (szLocationLookup) that populates the ComboBox. 
	 *      It does this by:
	 * 1) Querying the lookup table creating a resultset with the location categories 
	 * that need to be loaded into the ComboBox.
	 * 2) Creates a temporary string array, (szTemp1)and then copies the szLocationLookup 
	 * string array into the szTemp1. The array reference for szTemp1 is then copied
	 * to szLocationLookup. This is useful for removing the "Location Lookup Table Empty" string that
	 * is inserted when appropriate. Part 1 also allows for reductions in the array
	 * size.
	 * 3) Part 2 expands the array by methods similar to above only that a WHILE loop is used
	 * while rs.next is true, and that the szTemp2 string is incremented 1 string longer at 
	 * each loop to allow for the returned rs.next string.
	 ******************************************************************************************/
	public void LoadLocationComboBoxStringArray(){ 
		ResultSet rs = driver.executeQuery("select rowid,location from locationLookupDB");
		//Part 1: resets szLocationLookup string to allow for reductions in table records
		//gpsDataLogger.szLocationLookup = {""};
		String []szTemp1 = {""};
		Vm.copyArray(gpsDataLogger.szLocationLookup, 0, szTemp1, 0, szTemp1.length);		
		gpsDataLogger.szLocationLookup = szTemp1;
		//Part 2: populates remainder of table, expanding the array length as needed		
		
		rs.first();  
		gpsDataLogger.szLocationLookup[0] = rs.getString("location");
		int i = 1;
		while (rs.next()){
			//make string array dynamic
			if (i >= gpsDataLogger.szLocationLookup.length) {
				String[] szTemp2 = new String[gpsDataLogger.szLocationLookup.length + 1];
				Vm.copyArray(gpsDataLogger.szLocationLookup, 0, szTemp2, 0, gpsDataLogger.szLocationLookup.length);
				gpsDataLogger.szLocationLookup = szTemp2;
			} 			 	  		    
			gpsDataLogger.szLocationLookup[i] = rs.getString("location");			    			 
			++i;			 	  		
		}
		rs.close();
	} 	
	
//	below Part 2 causes arrayIndexOutOfBoundsException() to be thrown, but why?
	/*	String[] ret = new String[rs.getRowCount()];
	 rs.beforeFirst();
	 for (int i=0; rs.next(); i++)
	 ret[i] = rs.getString("location");
	 gpsDataLogger.szLocationLookup = ret;
	 rs.close();
	 }	*/	
	private void PurgeLocationLookupTable(){   	//deletes lookup table       	  
		driver.executeUpdate("drop table locationLookupDB");			    			    	  			       
	}
	private void CreateLocationLookupTable(){   	//deletes lookup table       	  
		driver.execute("create table locationLookupDB(location char(50), lastUpdated long)");			    			    	  			       
	}
	private void CreateLocationLookupTableIndex(){   	//deletes lookup table       	  		
		driver.execute("CREATE INDEX IDX_0 ON locationLookupDB(rowid)"); 
		driver.execute("CREATE INDEX IDX_1 ON locationLookupDB(location)");
	}
}
















?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
狠狠色狠狠色合久久伊人| 在线日韩国产精品| 懂色av一区二区三区蜜臀| 在线欧美日韩国产| 精品久久久久av影院| 自拍偷拍国产亚洲| 蜜桃视频一区二区三区在线观看| 国产91精品精华液一区二区三区 | 99精品视频在线观看免费| 91精品国产乱| 亚洲小少妇裸体bbw| aaa国产一区| 国产婷婷一区二区| 日本一不卡视频| 欧美午夜宅男影院| 中文字幕在线观看一区二区| 国产黄色精品网站| 日韩一区二区三区免费观看| 亚洲第一福利视频在线| 91老师片黄在线观看| 国产日韩精品一区二区浪潮av | 国模少妇一区二区三区| 777午夜精品免费视频| 伊人夜夜躁av伊人久久| 99久久er热在这里只有精品15| 久久一区二区三区四区| 精品一区二区三区在线播放 | 日韩欧美在线一区二区三区| 香蕉影视欧美成人| 欧美色图片你懂的| 亚洲激情在线播放| 色婷婷一区二区三区四区| 日韩美女视频19| 欧洲视频一区二区| 日本精品一区二区三区高清| 日韩理论片在线| 92国产精品观看| 亚洲欧美一区二区三区久本道91| caoporn国产精品| 亚洲特级片在线| 99久久国产综合精品女不卡| 亚洲靠逼com| 欧美视频一区二区在线观看| 亚洲一区二区三区在线播放| 欧美偷拍一区二区| 亚洲成在线观看| 91精品婷婷国产综合久久性色 | proumb性欧美在线观看| 国产精品美日韩| 一本大道av一区二区在线播放| 一区二区三区在线视频免费观看 | 国产美女视频91| 日本一区二区三级电影在线观看 | jiyouzz国产精品久久| 国产精品第五页| 欧美视频一区二区三区四区| 日本不卡一区二区| 国产亚洲一区字幕| 99麻豆久久久国产精品免费| 亚洲综合小说图片| 日韩午夜激情电影| 日韩美女久久久| 国产精品一区二区你懂的| 国产亚洲精品bt天堂精选| 99久久伊人网影院| 香蕉加勒比综合久久| 久久日一线二线三线suv| 暴力调教一区二区三区| 亚洲国产精品久久不卡毛片 | 成人综合婷婷国产精品久久 | 亚洲mv在线观看| 精品电影一区二区三区| 91免费精品国自产拍在线不卡| 天堂久久久久va久久久久| 精品福利一二区| 一本一道综合狠狠老| 麻豆精品国产传媒mv男同 | 国产乱子伦视频一区二区三区| 亚洲日本一区二区三区| 日韩欧美一级片| 91久久久免费一区二区| 狠狠色丁香九九婷婷综合五月| 亚洲精品国产视频| 2024国产精品| 欧美亚一区二区| 成人美女视频在线观看18| 日韩成人精品在线| 亚洲欧美综合另类在线卡通| 精品久久久久一区二区国产| 91黄色在线观看| 国产成人精品aa毛片| 日本在线不卡视频| 综合色天天鬼久久鬼色| 26uuu国产电影一区二区| 欧美日韩在线直播| 97久久超碰精品国产| 国产一区二区三区四区在线观看| 天天影视色香欲综合网老头| 中文字幕日韩av资源站| 久久欧美一区二区| 日韩欧美国产电影| 欧美天天综合网| 91福利国产精品| 91免费版在线| 99久久精品国产一区二区三区| 国产很黄免费观看久久| 久久国产免费看| 麻豆高清免费国产一区| 天天操天天综合网| 亚洲福利国产精品| 亚洲一区二区美女| 亚洲欧美一区二区三区国产精品 | 国产精品一区二区久久不卡| 美女在线观看视频一区二区| 日韩高清不卡一区| 亚洲成人av资源| 天堂蜜桃一区二区三区| 午夜欧美大尺度福利影院在线看| 亚洲自拍偷拍综合| 一区二区三区在线影院| 亚洲综合自拍偷拍| 亚洲v精品v日韩v欧美v专区 | 欧美日韩国产精品自在自线| 91黄色免费网站| 在线亚洲免费视频| 欧美无砖砖区免费| 欧美伦理视频网站| 91精品国产色综合久久ai换脸| 欧美一区二区在线免费观看| 日韩欧美国产综合| 欧美精品一区二区不卡| 国产偷国产偷精品高清尤物| 国产精品视频麻豆| 亚洲色图丝袜美腿| 亚洲成av人在线观看| 人人爽香蕉精品| 国产剧情一区二区三区| a4yy欧美一区二区三区| 欧美性猛片xxxx免费看久爱| 91麻豆精品国产自产在线| 精品人在线二区三区| 欧美激情在线一区二区| 一区二区三区中文免费| 日韩高清一区二区| 国产精品资源在线| 91女神在线视频| 日韩欧美在线网站| 国产精品欧美综合在线| 一区二区三区在线免费播放| 蜜臀久久久99精品久久久久久| 国产美女一区二区三区| 色综合天天综合网天天看片| 欧美一区在线视频| 亚洲精品在线观看网站| ㊣最新国产の精品bt伙计久久| 午夜精品视频一区| 国产成人精品一区二区三区网站观看| 91麻豆免费在线观看| 日韩一级完整毛片| 国产精品伦一区二区三级视频| 亚洲国产成人porn| 国产另类ts人妖一区二区| 欧美午夜精品免费| 久久久午夜精品| 亚洲成人激情av| 9i在线看片成人免费| 欧美一级生活片| 亚洲人成影院在线观看| 国产一区久久久| 欧美日韩国产综合一区二区三区| 国产欧美日本一区视频| 日本不卡一区二区三区高清视频| 91香蕉视频在线| 久久亚洲精精品中文字幕早川悠里 | 日本成人在线电影网| 99精品在线观看视频| 久久久天堂av| 蜜桃久久久久久| 欧美午夜片在线观看| 久久久91精品国产一区二区三区| 日韩一区欧美二区| 在线免费不卡视频| 中文字幕在线一区| 国产在线精品一区二区 | 99re8在线精品视频免费播放| 日韩亚洲欧美成人一区| 亚洲午夜视频在线| 99re视频精品| 中日韩免费视频中文字幕| 麻豆精品在线视频| 在线成人免费视频| 亚洲一区二区欧美| 欧美亚洲国产bt| 亚洲另类在线视频| 99re视频精品| 国产精品成人免费在线| 成人a级免费电影| 国产精品视频一区二区三区不卡| 国产精品亚洲综合一区在线观看| 日韩欧美一级精品久久|