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

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

?? speciesedit.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;



/*
 * speciesEdit pops up a window allowing the user to edit values in the lookup
 * table that load the "Species" combobox.
 * 
 */
public class speciesEdit extends Window {
	public static speciesEdit instance = new speciesEdit();		
	dataCapture dataCapture;
	gpsDataLogger gpsDataLogger;
	Button btnTest,btnPurge,btnFirstRecord, btnNextRecord, btnPreviousRecord, btnLastRecord, btnClear, btnSave, btnUpdate,btnDelete,btnExit;
	Edit edSpecies,edRowId;
	String szInput = "",s;    
	MessageBox mb1;
	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 speciesEdit(){
		super ("Species Table Edit",ROUND_BORDER);		
		szWidth = gpsDataLogger.szWidth;
		szHeight = gpsDataLogger.szHeight;
		szPlatform = gpsDataLogger.szPlatform;
		
		int iTmpWidth=this.width;
		int iTmpHeight=this.height;
		
		setRect(CENTER,CENTER,iTmpWidth/32 * 31,iTmpWidth/8 * 5);
		
		LoadSpeciesComboBoxStringArray();
		
		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.setEditable(false);
		
		btnExit = new Button("  Exit  ");
		btnExit.setGap(1);
		add (btnExit,RIGHT-32,SAME);
		
		add(new Label("Species"),LEFT+2,AFTER+4);
		edSpecies = new Edit();
		add (edSpecies);
		edSpecies.setRect(AFTER+2,SAME,iTmpWidth/16 * 10,PREFERRED);         
		edSpecies.setMaxLength(20);
		
		pbgBrowseButtons = new PushButtonGroup(szBrowseButtons,false,-1,2,6,2,true,PushButtonGroup.BUTTON);
		add(pbgBrowseButtons,CENTER,AFTER+2);
		
		btnPurge = new Button("Purge Species Lookup Table");
		btnPurge.setGap(1);
		add (btnPurge,CENTER,AFTER+2);
		
		//setFocusLess(true);
	}	
	public void onStart() {   	
		setFont(bigFont);
	}	
	
	private boolean verifyFields(){
		boolean speciesOk   = edSpecies.getText().length() > 0;				
		StringBuffer   sb = new StringBuffer();
		if (!speciesOk)   sb.append("species|");				
		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.iEmptySpeciesLookupTable = 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){
				LoadSpeciesComboBoxStringArray();
				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){
					PurgeSpeciesLookupTable();
					CreateSpeciesLookupTable();
					CreateSpeciesLookupTableIndex();
					clear();
					gpsDataLogger.iEmptySpeciesLookupTable = 1; //reset flag to 'empty'
				}
				else if (idx == 1){
				}				
			}
		}	 	
	}	
	public void firstRecord(){  	  
		ResultSet rs = driver.executeQuery("select rowid,species, from speciesLookupDB");	
		rs.first();   	  
		edSpecies.setText(rs.getString("species"));
		edRowId.setText(rs.getString("rowid")); 
		rs.close();
	}	
	public void previousRecord(){//tweaked to keep rowId zero from displaying
		szRowId = edRowId.getText();
		rowId = Convert.toInt(szRowId);
		ResultSet rs = driver.executeQuery("select rowid, species from speciesLookupDB 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,species, from speciesLookupDB");//full recordset is returned							
		}else{//...if rowId 1 or >...
			rs.last();
			edSpecies.setText(rs.getString("species"));
			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,species from speciesLookupDB 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,species, from speciesLookupDB");//full recordset is returned	
			rs.last();	//only last record in rs is shown					
		}else{ 
			rs.first(); //shows first record of first rs above w/all of the > rowId records   	 
		}
		edSpecies.setText(rs.getString("species"));
		edRowId.setText(rs.getString("rowid")); 
		rs.close();
	}
	public void lastRecord(){   	  
		ResultSet rs = driver.executeQuery("select rowid,species from speciesLookupDB");		
		rs.last();   	  
		edSpecies.setText(rs.getString("species"));
		edRowId.setText(rs.getString("rowid"));   
		rs.close();
	}
	private void doInsertUpdate(boolean isInsert){
		String szSpecies = edSpecies.getText();
		String szRowId = edRowId.getText();
		long lastUpdated = new Time().getTimeLong();
		int rows = -1;
		try{
			if (isInsert){//Save
				rows = driver.executeUpdate("insert into speciesLookupDB values ('"+szSpecies+"',"+lastUpdated+")");
			}else//update
				rows = driver.executeUpdate("update speciesLookupDB set species='"+szSpecies+"', 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 speciesLookupDB where rowid="+szRowId);
		clear();
		if (rows == 1){
			clear();
		}else Sound.beep();
	}
	public void clear(){
		edSpecies.setText("");
		edRowId.setText("");
	}
	public void Exit(){ 
		gpsDataLogger.iFirstSpeciesIteration = 2;
		unpop();
	}
	/***************************************************************************************
	 * LoadSpeciesComboBoxStringArray() This function moves strings that have been entered
	 * in the lookup table into the string array (szSpeciesLookup) that populates the ComboBox. 
	 *      It does this by:
	 * 1) Querying the lookup table creating a resultset with the species categories 
	 * that need to be loaded into the ComboBox.
	 * 2) Creates a temporary string array, (szTemp1)and then copies the szSpeciesLookup 
	 * string array into the szTemp1. The array reference for szTemp1 is then copied
	 * to szSpeciesLookup. This is useful for removing the "Species 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 LoadSpeciesComboBoxStringArray(){ 
		ResultSet rs = driver.executeQuery("select rowid,species from speciesLookupDB");
		//Part 1: resets szSpeciesLookup string to allow for reductions in table records
		//gpsDataLogger.szSpeciesLookup = {""};
		String []szTemp1 = {""};
		Vm.copyArray(gpsDataLogger.szSpeciesLookup, 0, szTemp1, 0, szTemp1.length);		
		gpsDataLogger.szSpeciesLookup = szTemp1;
		//Part 2: populates remainder of table, expanding the array length as needed		
		
		rs.first();  
		gpsDataLogger.szSpeciesLookup[0] = rs.getString("species");
		int i = 1;
		while (rs.next()){
			//make string array dynamic
			if (i >= gpsDataLogger.szSpeciesLookup.length) {
				String[] szTemp2 = new String[gpsDataLogger.szSpeciesLookup.length + 1];
				Vm.copyArray(gpsDataLogger.szSpeciesLookup, 0, szTemp2, 0, gpsDataLogger.szSpeciesLookup.length);
				gpsDataLogger.szSpeciesLookup = szTemp2;
			} 			 	  		    
			gpsDataLogger.szSpeciesLookup[i] = rs.getString("species");			    			 
			++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("species");
	 gpsDataLogger.szSpeciesLookup = ret;
	 rs.close();
	 }	*/	
	private void PurgeSpeciesLookupTable(){   	//deletes lookup table       	  
		driver.executeUpdate("drop table speciesLookupDB");			    			    	  			       
	}
	private void CreateSpeciesLookupTable(){   	//deletes lookup table       	  
		driver.execute("create table speciesLookupDB(species char(50), lastUpdated long)");			    			    	  			       
	}
	private void CreateSpeciesLookupTableIndex(){   	//deletes lookup table       	  		
		driver.execute("CREATE INDEX IDX_0 ON speciesLookupDB(rowid)"); 
		driver.execute("CREATE INDEX IDX_1 ON speciesLookupDB(species)");
	}
}
















?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩视频在线你懂得| caoporen国产精品视频| 欧美日韩成人综合在线一区二区| 综合久久综合久久| 在线欧美一区二区| 亚洲图片欧美色图| 日韩一区二区三区精品视频| 精彩视频一区二区| 欧美国产精品中文字幕| 91在线精品一区二区| 一区二区三区在线视频免费观看| 欧美色倩网站大全免费| 日韩经典一区二区| 久久婷婷国产综合国色天香| 成人一区二区三区中文字幕| 国精品**一区二区三区在线蜜桃| 日韩美女视频一区二区在线观看| 韩国av一区二区三区在线观看| 国产亚洲一二三区| aaa国产一区| 午夜精品视频一区| 日韩亚洲欧美成人一区| 国产成人免费视| 亚洲另类在线一区| 欧美不卡视频一区| 91免费观看视频在线| 日韩精品五月天| 久久久精品免费网站| 在线亚洲一区观看| 精品一区二区在线视频| 亚洲人成在线播放网站岛国| 欧美一区二区三区不卡| 成人国产精品免费观看动漫| 午夜精品爽啪视频| 国产精品国产三级国产普通话蜜臀| 在线国产电影不卡| 国产精品66部| 日韩精品三区四区| 亚洲欧美自拍偷拍色图| 日韩视频免费直播| 一本久久精品一区二区| 精品亚洲免费视频| 亚洲影院理伦片| 中文字幕+乱码+中文字幕一区| 欧美日产国产精品| 99re热视频精品| 国产一区二区三区av电影| 亚洲第一精品在线| 日韩理论片中文av| 久久久久久久av麻豆果冻| 欧美天堂一区二区三区| 成人avav在线| 国产综合色在线视频区| 日本中文字幕一区二区视频| 亚洲视频香蕉人妖| 中文乱码免费一区二区| 欧美本精品男人aⅴ天堂| 欧美三级韩国三级日本三斤| 91在线观看一区二区| 国产黄色精品网站| 六月婷婷色综合| 丝袜诱惑制服诱惑色一区在线观看| 欧美激情在线一区二区三区| 精品免费99久久| 日韩欧美精品三级| 欧美精品99久久久**| 欧美自拍丝袜亚洲| 91麻豆免费视频| 97精品电影院| 91性感美女视频| 91日韩精品一区| 97国产精品videossex| 成人18精品视频| 成人教育av在线| 成人av在线一区二区| 成人av电影在线网| fc2成人免费人成在线观看播放| 国产成人99久久亚洲综合精品| 精品综合久久久久久8888| 日本欧美一区二区| 奇米色777欧美一区二区| 同产精品九九九| 日本人妖一区二区| 久久超碰97中文字幕| 国产在线视频一区二区三区| 国产米奇在线777精品观看| 国产一区二区精品在线观看| 国产高清成人在线| www.综合网.com| 色网综合在线观看| 欧美图区在线视频| 日韩女优av电影| 久久综合色一综合色88| 久久久综合视频| 国产精品久久午夜| 一区二区三区四区av| 亚洲chinese男男1069| 蜜桃视频在线观看一区| 国产一区二区三区免费观看| 成人午夜电影网站| 欧洲国内综合视频| 日韩午夜av电影| 国产亚洲人成网站| 亚洲日韩欧美一区二区在线| 韩国精品主播一区二区在线观看| 狠狠网亚洲精品| 99久久免费国产| 欧美日韩国产另类一区| 日韩女优电影在线观看| 中文字幕不卡一区| 亚洲一区二区综合| 狠狠色综合色综合网络| 97久久超碰国产精品| 欧美电影一区二区| 国产人妖乱国产精品人妖| 亚洲特级片在线| 奇米综合一区二区三区精品视频| 国产精品夜夜嗨| 欧美在线一二三| 久久九九久久九九| 一级精品视频在线观看宜春院 | 欧美美女网站色| 精品国产99国产精品| 亚洲精品视频在线| 久久精品国产免费| 91黄视频在线| 久久久久久免费| 亚洲高清免费在线| 成人av动漫在线| 日韩欧美国产小视频| 一区二区高清视频在线观看| 国产一区二区三区在线看麻豆| 91黄色免费看| 国产精品久久久久影院老司| 欧美aaa在线| 91福利在线观看| 国产精品久久久久一区二区三区共| 亚洲不卡av一区二区三区| 国产不卡视频一区二区三区| 91精品国产综合久久精品图片| 中文字幕一区二区日韩精品绯色 | 精品一区二区三区视频| 91福利视频网站| 国产精品天干天干在线综合| 久久爱另类一区二区小说| 欧美日韩中文一区| 亚洲色图另类专区| 不卡电影一区二区三区| 久久香蕉国产线看观看99| 丝袜美腿亚洲综合| 欧美色综合天天久久综合精品| 国产精品天干天干在线综合| 国精产品一区一区三区mba视频 | 91美女视频网站| 国产亚洲一区字幕| 精品亚洲porn| 精品国产污网站| 另类小说视频一区二区| 欧美日韩国产综合一区二区| 一区二区三区免费| 91片在线免费观看| 亚洲欧美日韩中文字幕一区二区三区 | 成人av动漫在线| 欧美国产日本视频| 国产成人激情av| 欧美经典三级视频一区二区三区| 国产一区二区三区日韩| 久久午夜国产精品| 国产一区二区0| 国产日韩欧美a| 成人午夜电影久久影院| 欧美激情一区二区三区四区| 国产激情一区二区三区四区| 国产欧美视频一区二区| 成人自拍视频在线| 日韩一区在线免费观看| 99久久免费国产| 亚洲一区视频在线| 欧美日韩免费不卡视频一区二区三区| 亚洲一区影音先锋| 日韩午夜av一区| 韩国一区二区在线观看| 国产三级欧美三级日产三级99 | 欧美日韩一区中文字幕| 五月婷婷综合激情| 精品国产自在久精品国产| 韩国中文字幕2020精品| 中文字幕免费不卡| 91丨九色丨国产丨porny| 亚洲影视资源网| 日韩你懂的电影在线观看| 国产白丝精品91爽爽久久| 中文字幕在线不卡一区| 久久久综合视频| 91亚洲精品久久久蜜桃网站| 日日夜夜精品免费视频| 国产无人区一区二区三区| 91免费国产视频网站| 蜜臀av一区二区三区| 国产精品久久久久久久久免费丝袜|