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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? movieslist.java

?? Mobile Services
?? JAVA
字號:
import javax.microedition.midlet.MIDlet;
 
import javax.microedition.lcdui.List;
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.CommandListener;
import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.Displayable;
import javax.microedition.lcdui.Form;
import javax.microedition.lcdui.StringItem;
import javax.microedition.lcdui.TextField;
import javax.microedition.lcdui.ChoiceGroup;
 
import java.util.Vector;
import java.util.Enumeration;
/* This MIDlet is called when the user selects Movies from the MainClass List */
public class  MoviesList extends MIDlet implements CommandListener
{
	static int counter = 0;
  	/* Declaration of different objects */
  	String hallname,realhall,showdate,bookname,bookemail,booktime,bookcategory
  			,strshow,strbal,strrear,strupper,strmiddle;
 	DataParser parsemoviedata;
  	Vector name,id,details;
  	int commandvalue = 0;
  	private Display displaymovielist;
  	private List halllist,listmovies,listdate;
  	private Form statusform,yourname,emailform,categoryform,/*timeform,*/ticketform;
  	private StringItem sitem;
  	private Command backtodate,backtomovie,backtohall,bookticket,backtostatus,
  			emailscreen,backtoname,categoryscreen,backtoemail,backtocat,ticketscreen,
  			finalbook,exitcommand;
  	private TextField entername,enteremail,enterticket;
  	private ChoiceGroup categorybuttons;
  	private MainClass lastscreen;
  	/* Constructor of the Movielist class declared */
 	MoviesList(Display disp,MainClass obj)	
  	{
 		lastscreen = obj;
 		displaymovielist = disp;
  		exitcommand = new Command("Exit",Command.EXIT,1);
  		halllist = new List("Select Hall",List.IMPLICIT);
  		halllist.setCommandListener(this);
  		halllist.addCommand(exitcommand);
  
 	}
  	/* This is start of an application. This method is called when the application is called */
  	public void startApp()
  	{
 		parsemoviedata = new DataParser();
 		/* This will make an Http connection and open an InputStream to read from the connection */
 		parsemoviedata.sourceurl("http://192.192.168.100/midlet/template/midlet_movies.xml");
 		/* This will parse the XML data */
  		parsemoviedata.parseDataMovies(1);
  		/* values taken in a vector */
  		name = parsemoviedata.hall_name();
 		id = parsemoviedata.hall_id();
 		/* This will create a list with the hall name to be displayed to the user */
  		for(Enumeration enum = name.elements() ; enum.hasMoreElements() ;) 
  		{
 			 halllist.append((String)enum.nextElement(),null);
  		}
   		/* List displayed */
 		displaymovielist.setCurrent(halllist);
  		/* Command objects declared */
  		backtodate = new Command("Back",Command.BACK,1);
  		backtomovie = new Command("Back",Command.BACK,1);
  		backtohall = new Command("Back",Command.BACK,1);
  		bookticket = new Command("Book",Command.SCREEN,1);
  		backtostatus = new Command("Back",Command.BACK,1);
  		emailscreen = new Command("OK",Command.SCREEN,1);
  		backtoname = new Command("Back",Command.SCREEN,1);
  		categoryscreen = new Command("OK",Command.SCREEN,1);
  		backtoemail = new Command("Back",Command.SCREEN,1);
  		backtocat = new Command("Back",Command.SCREEN,1);
  		ticketscreen = new Command("OK",Command.SCREEN,1);
  		finalbook = new Command("BOOK",Command.SCREEN,1);
  		
  	}	
  	/* destroyApp() method declared. This will free the resources */
  	public void destroyApp(boolean b)
  	{
  		backtodate = null;
  		backtomovie = null;
  		backtohall = null;
  		bookticket = null;
  		backtostatus = null;
  		emailscreen = null;
  		backtoname = null;
  		categoryscreen = null;
 		backtoemail = null;
  		backtocat = null;
  		ticketscreen = null;
  		finalbook = null;
  		exitcommand = null;
  	}
 
  	public void pauseApp()
  	{}
 	/* This method is used for event handling */
  	public void commandAction(Command c, Displayable d)
  	{
  		
		/* this is true if an item is selected in the list */
  		if(c == List.SELECT_COMMAND)
  		{
  			if(halllist.isShown())
  			{
  				realhall = halllist.getString(halllist.getSelectedIndex());
  				hallname = halllist.getString(halllist.getSelectedIndex());
  			}
  			else if(listmovies.isShown())
  				hallname = listmovies.getString(listmovies.getSelectedIndex());
  			else if(listdate.isShown())
 				hallname = listdate.getString(listdate.getSelectedIndex());
  			counter++;
  			getAllData(hallname,counter);
  		}		
  		/* This will display the date list. On click of Back button */
  		if(c == backtodate)
  		{
  			displaymovielist.setCurrent(listdate);
  			counter = 2;
  		}
  		/* This will display the movie list. On click of Back button */
  		if(c == backtomovie)
  		{
  			displaymovielist.setCurrent(listmovies);
  			counter = 1;
  		}
  		/* This will display the hall list. On click of Back button */
  		if(c==backtohall)
  		{
  			displaymovielist.setCurrent(halllist);
  			counter = 0;
  		}
  		/* This will display a form asking the user to enter his name. On click of Book button */
  		if(c==bookticket)
  		{
  			yourname = new Form("Enter your Name");
  			yourname.setCommandListener(this);
  			yourname.addCommand(emailscreen);
  			yourname.addCommand(backtostatus);
  			entername = new TextField("Enter Name","",20,TextField.ANY);
  			yourname.append(entername);
  			displaymovielist.setCurrent(yourname);
  		}
  		/* This will display the status form. On click of Back button */
  		if(c == backtostatus)
  		{
  			displaymovielist.setCurrent(statusform);
  		}
  		/* This will display the form asking the user to enter his name. On click of Back button */
  		if(c == backtoname)
  		{
  			displaymovielist.setCurrent(yourname);
  		}
  		/* This will display the form asking the user to enter his email. On click of Back button */
  		if(c == backtoemail)
  		{
  			displaymovielist.setCurrent(emailform);
  		}
  		/* This will display the form for selecting a category like "balcony" and "rear stall" etc
  		. On click of Back button */
  		if(c == backtocat)
 		{
  			displaymovielist.setCurrent(categoryform);
 		}
  		/* This will ask the user to enter his email address.On click of OK button */
  		if(c == emailscreen)
  		{
  			bookname = entername.getString();
  			emailform = new Form("Enter your Email");
  			emailform.setCommandListener(this);
  			enteremail = new TextField("Enter Email","",30,TextField.EMAILADDR);
  			emailform.append(enteremail);
 			emailform.addCommand(backtoname);
  			emailform.addCommand(categoryscreen);
  			displaymovielist.setCurrent(emailform);
  		}
  		/* This will ask the user to select a category.On click of Ok button */
  		if(c == categoryscreen)
  		{
  			bookemail = enteremail.getString();
  			categoryform = new Form("Select a Category");
  			categoryform.setCommandListener(this);
  			categorybuttons = new ChoiceGroup("Category",ChoiceGroup.EXCLUSIVE);
  			categorybuttons.append("Balcony",null);
  			categorybuttons.append("Rear Stall",null);
  			categorybuttons.append("Upper Stall",null);
  			categorybuttons.append("Middle Stall",null);
  			categoryform.append(categorybuttons);
  			categoryform.addCommand(backtoemail);
  			categoryform.addCommand(ticketscreen);
  			displaymovielist.setCurrent(categoryform);
  		}
  		/* This will ask the user to enter the number of tickets to be booked.On click of OK button */ 
  		if(c == ticketscreen)
  		{
  			bookcategory = categorybuttons.getString(categorybuttons.getSelectedIndex());
  			ticketform = new Form("Enter the Tickets");
 			ticketform.setCommandListener(this);
  			enterticket = new TextField("Enter Ticket","",6,TextField.NUMERIC);
  			ticketform.append(enterticket);
  			ticketform.addCommand(backtocat);
  			ticketform.addCommand(finalbook);
  			displaymovielist.setCurrent(ticketform);
  		}
  		/* This will book the tickets for the user. On click of a Book Button */
  		if(c == finalbook)
  		{
  			String url = "fname="+bookname +"&email="+ bookemail +"&hallid="+Integer.parseInt((String)id.elementAt(name.indexOf(realhall)))+ "&" +bookcategory+"="+ Integer.parseInt(enterticket.getString())+ "&showtime=" + booktime +"&showdate="+showdate;
  			System.out.println("Print this url " + url);
			url = url.trim();
			/*try
    			{
  				/* This will create an HTPP connection object */
  				//HttpConnection con = (HttpConnection)Connector.open(url);
  				/* This will open an InputStream to the connection */
  				//InputStream ins = con.openInputStream();
  				//ins.close();
  			/*}
  			catch(IOException ex)
    			{
    				System.out.println("IOException occured");
   			}*/
  			
			int i = 0;
			int j=0;
			StringBuffer strbuf = new StringBuffer();
			while(i < url.length())
			{
				i = url.indexOf(" ",i+1);
				if(i == -1)
					break;
				strbuf = strbuf.append(url.substring(j,i));
				strbuf = strbuf.append("%20");
				j = i+1;
			}
			strbuf = strbuf.append(url.substring(j,url.length()));
			System.out.println("This is the value of " + strbuf);
			destroyApp(true);
  			notifyDestroyed();
  			lastscreen.getDisplayObject(displaymovielist);
  		}
  		/* This will delete the MIDlet and close the application */
  		if(c == exitcommand)
  		{
  			destroyApp(true);
  			notifyDestroyed();
  			lastscreen.getDisplayObject(displaymovielist);
  		}
  	}		
  	/* This method is very important method. This method is used to manupulate more than one List */
  	private void getAllData(String str,int counter)
  	{
  		/* this if condition is true if an item is selected from the hall list */
 		if(counter == 1)
 		{	
  			listmovies = new List("List of Movies",List.IMPLICIT);
 			listmovies.setCommandListener(this);
		listmovies.addCommand(backtohall);
 			parsemoviedata.sourceurl("http://192.192.168.100/midlet/template/midlet_status.xml?tname=" + str);
 			parsemoviedata.parseDataMovies(2);
  			details = parsemoviedata.halldata();
  			details.trimToSize();
  			for (Enumeration enum = details.elements();enum.hasMoreElements();) 
  			{
  				if(enum.nextElement().equals("ms"))
  				{
  					listmovies.append((String)enum.nextElement(),null);
  				}
 			}
 			displaymovielist.setCurrent(listmovies);
  		}
  		/* this if condition is true if an item is selected from the movies list */
  		if(counter == 2)
  		{
  			listdate = new List("Show Date",List.IMPLICIT);
  			listdate.setCommandListener(this);
  			listdate.addCommand(backtomovie);
  			int indexofmovie = details.indexOf(str);
  			int indexofms = details.indexOf("ms",indexofmovie+2);
  			if(indexofms == -1)
  				indexofms = details.size();
  			while(indexofmovie < indexofms)
  			{
  				if((details.elementAt(indexofmovie)).equals("st"))
  				{
  					listdate.append((String)details.elementAt(indexofmovie+1),null);
 				}
  				indexofmovie++;
  			}
  			displaymovielist.setCurrent(listdate);
  			
  		}
  		/* this if condition is true if user selects date from the date list */
  		if(counter == 3)
  		{
  			showdate = str;
  			statusform = new Form("Status of Movie");
  			statusform.setCommandListener(this);
  			statusform.addCommand(backtodate);
  			statusform.addCommand(bookticket);
  			int indexdate = details.lastIndexOf(str);
  			int indexms = details.indexOf("ms",indexdate);
  			int indexst = details.indexOf("st",indexdate);
  			indexdate+=1;
  			if(indexst == -1)
  				indexst = details.size();
  			if(indexms == -1)
  				indexms = details.size();
  			String sarray[] = {"Show Time","Balcony","Rear Stall","Upper Stall","Middle Stall"};
  			int i = 0;
  			while((indexdate) < indexms)
  			{
  				if(i > 4)
  					break;
  				if(i==0)
  				{	
  					booktime = 	(String)details.elementAt(indexdate);
  				}					
  				sitem = new StringItem(sarray[i],(String)details.elementAt(indexdate));
  				statusform.append(sitem);
  				indexdate++;
  				i++;
  			}
  			displaymovielist.setCurrent(statusform);
  		}
  	}
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美裸体bbwbbwbbw| 91麻豆福利精品推荐| 亚洲午夜一区二区| 亚洲视频每日更新| 亚洲视频电影在线| 亚洲精品美腿丝袜| 亚洲制服丝袜在线| 午夜精品久久久久久久久久久 | 一本大道久久a久久精二百| 成人av网站免费观看| 99久久伊人久久99| 在线亚洲免费视频| 欧美亚洲综合久久| 欧美一级一级性生活免费录像| 欧美日韩色综合| 日韩欧美你懂的| 精品99一区二区| 国产精品色呦呦| 亚洲精品第一国产综合野| 亚洲国产综合人成综合网站| 久久国产福利国产秒拍| 国产成人高清视频| 欧美系列一区二区| 久久一日本道色综合| 亚洲色图清纯唯美| 人妖欧美一区二区| 岛国一区二区在线观看| 日本久久精品电影| 日韩欧美亚洲国产另类 | 欧洲视频一区二区| 91精品国产综合久久久久久久久久 | 精品国产一区二区亚洲人成毛片| 国产亚洲一区字幕| 亚洲精品videosex极品| 卡一卡二国产精品 | 一区二区三区在线观看网站| 日本美女视频一区二区| 9久草视频在线视频精品| 91精品国产全国免费观看| 国产亚洲精品久| 污片在线观看一区二区| 国产成人av一区| 91精品国产福利| 亚洲激情自拍偷拍| 国产美女视频91| 欧美日韩国产高清一区二区| 中文字幕第一区二区| 日韩av中文字幕一区二区| 91免费看视频| 国产视频一区二区在线观看| 久久国产视频网| 宅男噜噜噜66一区二区66| 一区二区三区丝袜| www.欧美日韩国产在线| 久久久久国产一区二区三区四区| 性感美女久久精品| 色婷婷久久综合| 亚洲你懂的在线视频| 成人精品在线视频观看| 国产亚洲精品超碰| 国产一区二区视频在线播放| 日韩一区二区三区视频在线| 一区二区三区四区五区视频在线观看| 国产成人啪午夜精品网站男同| 欧美一级片在线看| 免费日韩伦理电影| 欧美肥妇毛茸茸| 日韩高清欧美激情| 91精品欧美久久久久久动漫| 亚洲国产另类av| 欧美猛男gaygay网站| 午夜欧美在线一二页| 欧美日韩中文另类| 亚洲mv大片欧洲mv大片精品| 欧美日韩精品欧美日韩精品一综合| 亚洲一区二区三区自拍| 6080午夜不卡| 久久精品国产澳门| 精品久久一区二区| 国产91精品欧美| 国产欧美日产一区| 99久久精品国产毛片| 亚洲人亚洲人成电影网站色| 色综合久久88色综合天天 | 精品亚洲欧美一区| www国产精品av| 懂色av中文字幕一区二区三区 | 久久久青草青青国产亚洲免观| 老司机精品视频在线| 欧美精品一区二区三区久久久| 国产一区二区伦理| 国产精品麻豆久久久| 91黄色免费版| 日韩av一区二| 久久精品视频一区二区三区| eeuss鲁片一区二区三区在线看| 亚洲素人一区二区| 91精品国产综合久久小美女 | 日本一区二区在线不卡| 91视视频在线观看入口直接观看www| 亚洲乱码日产精品bd| 91精品国产手机| 国产精品亚洲专一区二区三区| 亚洲免费成人av| 欧美一区二区人人喊爽| 国产成人av电影在线观看| 一区二区三区在线免费观看 | 欧美优质美女网站| 韩国毛片一区二区三区| 亚洲日本护士毛茸茸| 精品国产乱码久久久久久老虎| 99久久国产综合精品女不卡| 日本最新不卡在线| 亚洲三级在线免费观看| 精品久久久网站| 在线免费视频一区二区| 国产经典欧美精品| 香蕉影视欧美成人| 亚洲视频电影在线| 国产人久久人人人人爽| 3d成人h动漫网站入口| 99视频精品在线| 久久国产成人午夜av影院| 亚洲成人自拍一区| 18成人在线视频| 国产亚洲欧美中文| 日韩精品在线一区二区| 欧美天堂亚洲电影院在线播放| 北条麻妃一区二区三区| 久久国产免费看| 五月综合激情婷婷六月色窝| 亚洲欧美日韩一区| 国产精品午夜在线| 国产亚洲午夜高清国产拍精品| 91精品国产高清一区二区三区蜜臀| 欧美性猛片aaaaaaa做受| 91色婷婷久久久久合中文| 国产不卡视频一区二区三区| 久久99精品国产91久久来源| 日韩不卡在线观看日韩不卡视频| 亚洲精品亚洲人成人网在线播放| 国产欧美日韩亚州综合| 国产亚洲成aⅴ人片在线观看| 精品国产1区二区| 久久久久久一二三区| 久久蜜桃一区二区| 精品电影一区二区| 精品国产乱码久久久久久1区2区| 欧美一区二区久久| 日韩精品一区二区三区蜜臀| 日韩精品中文字幕一区二区三区 | 日本成人超碰在线观看| 视频一区二区三区中文字幕| 亚洲不卡在线观看| 视频一区视频二区中文| 蜜桃免费网站一区二区三区| 精品一区二区三区在线播放视频| 蜜臀av性久久久久蜜臀aⅴ| 久久精品99久久久| 国产精品1区2区| 成人黄色软件下载| 色综合一区二区| 欧美性色aⅴ视频一区日韩精品| 欧美日韩一区二区三区在线| 欧美日韩国产a| 91精品国产综合久久久蜜臀图片| 欧美大黄免费观看| 国产欧美一区二区三区在线看蜜臀 | 国产精品福利影院| 亚洲一区欧美一区| 日本vs亚洲vs韩国一区三区二区| 另类专区欧美蜜桃臀第一页| 国产.精品.日韩.另类.中文.在线.播放| 国产成a人亚洲精品| 欧美性受xxxx黑人xyx| 欧美一区二区三区日韩视频| 久久久九九九九| 亚洲人成网站影音先锋播放| 亚洲第一主播视频| 激情综合色综合久久| 成人精品视频.| 欧美群妇大交群中文字幕| 久久网这里都是精品| 亚洲婷婷综合久久一本伊一区| 天天综合日日夜夜精品| 国产福利一区在线| 欧美日韩精品一区二区三区四区| 精品卡一卡二卡三卡四在线| 日韩一区有码在线| 精品一区二区三区免费播放| 99精品视频中文字幕| 日韩色视频在线观看| 亚洲欧美日韩中文字幕一区二区三区 | 一区二区三区在线不卡| 蜜桃av噜噜一区| 91福利国产精品| 国产亚洲一二三区| 久久精品国产精品亚洲综合| 91九色最新地址| 国产精品久久久久三级|