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

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

?? recordstoredemo.java

?? 手機的聯網應用
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
/* * RecordStoreDemo.java * * Created on September 18, 2001, 9:05 PM */package cn.com.javachen;import java.util.*;import javax.microedition.midlet.*;import javax.microedition.lcdui.*;import javax.microedition.rms.*;/** * * @author  paul * @version  */public class RecordStoreDemo extends javax.microedition.midlet.MIDlet     implements CommandListener {  private Display display;  private Form mainMenuForm;  private Form dataForm;  private Form recordForm;  private Form statusForm;    private TextField recordStoreNameTextField;  private TextField filterCharacterTextField;  private TextField recordDataTextField;  private ChoiceGroup recordStoreChoice;  private Alert errorAlert;  private Alert infoAlert;  private Command cmdOK;  private Command cmdBack;  private Command cmdNext;  private Command cmdPrev;  private Command cmdDelete;  private Command cmdModify;  private Command cmdExit;  private Command cmdHelp;    private ChoiceGroup mainMenu;    private RecordStore currentRecordStore = null;  private RecordEnumeration enumeration;  private RecordFilter filter;  private int currentRecordID;  private byte[] recordData;  private boolean commandAvailable;  private Command currentCommand;  private Displayable currentDisplayable;  private int state;  private static final int ST_MAIN_MENU =                          100;  private static final int ST_GETTING_RECORD_STORE_NAME =          101;  private static final int ST_SELECTING_STORE_NAME =               102;  private static final int ST_SELECTING_STORE_NAMES_FOR_DELETION = 103;  private static final int ST_GETTING_RECORD_DATA =                104;  private static final int ST_BROWSING_STORE =                     105;  private static final int ST_MODIFYING_RECORD =                   106;  private static final int ST_AFTER_DELETION =                     107;  private static final int ST_GETTING_FILTER_CHARACTER =           108;  private static final int ST_DISPLAYING_STATUS_FORM =             109;  private String[] actions = {    "List Stores",       //  0    "Create Store",      //  1    "Select Store",      //  2    "Delete Store(s)",   //  3    "Add Record",        //  4    "Browse Records",    //  5    "Browse (filtered)", //  6    "Version",           //  7    "Last Modified",     //  8    "Get Next recID",    //  9    "Get # Recs",        // 10    "Get Size",          // 11    "Get Available",     // 12    "Close Store"        // 13  };  private static final int LIST_STORES =      0;  private static final int CREATE_STORE =     1;  private static final int SELECT_STORE =     2;  private static final int DELETE_STORE =     3;  private static final int ADD_RECORD =       4;  private static final int BROWSE_RECORDS =   5;  private static final int BROWSE_FILTERED =  6;  private static final int GET_VERSION =      7;  private static final int LAST_MODIFIED =    8;  private static final int GET_NEXT_REC_ID =  9;  private static final int GET_NUM_RECS =    10;  private static final int GET_SIZE =        11;  private static final int GET_AVAIL =       12;  private static final int CLOSE_STORE =     13;  private String[] recordSubCommands = {    "Back",    "Prev",    "Next",    "Delete",    "Modify"  };  private static final int SUB_BACK =   0;  private static final int SUB_PREV =   1;  private static final int SUB_NEXT =   2;  private static final int SUB_DELETE = 3;  private static final int SUB_MODIFY = 4;    private String msgNoRecordStores =    "MIDlet Suite contains no RecordStores";  private String msgNoCurrentRecordStore =    "You must first select a RecordStore";  private String msgRecordStoreException =    "RecordStoreException";  private String msgRecordStoreNotOpenException =    "RecordStoreNotOpenException";  private String[] helpText = {      "This command lists all of the record stores in this " +      "MIDlet suite. The RecordStore that has been designated as " +      "'active' will be indicated by '(*)'",      "This command is used to create a record store. " +      "You will be prompted for the name of the record store. " +      "After the store has been added, it will automatically " +      "be made the 'active' RecordStore and the RecordStore " +      "(if any) that had been the 'active' RecordStore is closed.",      "This command is used to designate the 'active' RecordStore " +      "(i.e. the one that is the target of subsequent commands " +      "that operate on records or request information about the " +      "RecordStore.",      "This command is used to delete the designated RecordStore. " +      "When a RecordStore is deleted, all of the records it " +      "contains are also deleted.",      "This command is used to add a record to the 'active' " +      "RecordStore. You will be presented with a screen " +      "containing a TextField into which you type the contents of " +      "the record. You can create records whose contents are " +      "identical.",      "This command is used to initiate the process of iterating " +      "over all of the records in the record store. For each " +      "record that is presented, you have the option of deleting " +      "or modifying the record or of navigating to the next or " +      "previous record if such a record exists.",      "This command is the same as the 'browse' command but it " +      "uses a filter. You will be presented with a screen " +      "containing a TextField into which you type a letter. Only " +      "those names beginning with that letter will be displayed " +      "during the browse operation.",      "This command displays the version of the 'active' " +      "RecordStore. The version number is incremented by 1 " +      "each time the RecordStore is modified (i.e. a record is " +      "added, modified or deleted).",       "This command displays the date/time the 'active' " +      "RecordStore was modified.",      "This command displays the recordID that will be assigned " +      "to the next record added to the 'active' RecordStore.",      "This command displays the total number of records in the " +      "'active' RecordStore.",      "This command displays the amount of space, in bytes, that " +      "the 'active' RecordStore occupies.",      "This command displays the additional room (in bytes) " +      "available for the 'active' RecordStore to grow. You should " +      "NOT make any decision related to storage based on this number.",      "This command is used to close the 'active' RecordStore."    };  public void startApp() {    display = Display.getDisplay(this);    cmdOK =     new Command("OK",Command.SCREEN,1);    cmdBack =   new Command("Back",Command.SCREEN,1);    cmdNext =   new Command("Next",Command.SCREEN,1);    cmdPrev =   new Command("Prev",Command.SCREEN,1);    cmdDelete = new Command("Delete",Command.SCREEN,1);    cmdModify = new Command("Modify",Command.SCREEN,1);    cmdHelp =   new Command("Help",Command.SCREEN,1);    cmdExit =   new Command("Exit",Command.SCREEN,1);    mainMenuForm = new Form("Menu");    mainMenu = new ChoiceGroup("Action",Choice.EXCLUSIVE,       actions, null);    mainMenuForm.append(mainMenu);    recordForm = new Form("RECORD DATA");    recordForm.addCommand(cmdBack);    recordForm.addCommand(cmdDelete);    recordForm.addCommand(cmdModify);    recordForm.setCommandListener(this);    dataForm = new Form(null);    dataForm.setCommandListener(this);    dataForm.addCommand(cmdOK);    recordStoreNameTextField =       new TextField("Store Name",null,32,TextField.ANY);    recordDataTextField =       new TextField("Record Data",null,80,TextField.ANY);    filterCharacterTextField =       new TextField("Filter Character",null,1,TextField.ANY);    statusForm = new Form(null);    statusForm.setCommandListener(this);    statusForm.addCommand(cmdOK);    mainMenuForm.addCommand(cmdOK);    mainMenuForm.addCommand(cmdHelp);     mainMenuForm.addCommand(cmdExit);     commandAvailable = false;    new CommandThread(this).start();        infoAlert = new Alert("Help");    infoAlert.setType(AlertType.INFO);    infoAlert.setTimeout(Alert.FOREVER);    errorAlert = new Alert("Error");    errorAlert.setType(AlertType.ERROR);    errorAlert.setTimeout(Alert.FOREVER);            mainMenuForm.setCommandListener(this);    display.setCurrent(mainMenuForm);  }  public void pauseApp() {  }  public void destroyApp(boolean unconditional) {  }  public void commandAction(Command cmd, Displayable d) {    if (cmd == cmdExit) {      destroyApp(true);      notifyDestroyed();    }    else if (cmd == cmdHelp) {      int index = mainMenu.getSelectedIndex();      infoAlert.setTitle(mainMenu.getString(index));      infoAlert.setString(helpText[mainMenu.getSelectedIndex()]);      display.setCurrent(infoAlert, mainMenuForm);    }    else {      synchronized (this) {        currentCommand = cmd;        currentDisplayable = d;        commandAvailable = true;        notify();      }    }  }  class CommandThread extends Thread {    MIDlet parent;    public CommandThread(MIDlet parent) {      this.parent = parent;    }    public void run() {      while (true) {        synchronized(parent) {          while(!commandAvailable) {            try {              parent.wait();            }            catch (InterruptedException e) {            }          }        }        commandAvailable = false;              if (currentDisplayable == mainMenuForm) {          processMainMenuItem();        }        else if (currentDisplayable == dataForm) {          processDataForm();        }        else if (currentDisplayable == recordForm) {          processRecordForm();        }        else if (currentDisplayable == statusForm) {          if (state == ST_AFTER_DELETION) {            state = ST_BROWSING_STORE;            displayRecordData();          }          else {            displayMainMenu();          }        }      }    }    private void displayDataForm(int st) {      state = st;      display.setCurrent(dataForm);    }    private void displayStatusForm(int st) {      state = st;      display.setCurrent(statusForm);    }    private void displayMainMenu() {      mainMenu.setSelectedIndex(0,true);      state = ST_MAIN_MENU;      display.setCurrent(mainMenuForm);    }    private void processMainMenuItem() {      int commandIndex = mainMenu.getSelectedIndex();      if (commandRequiresOpenStore(commandIndex))        if (!storeOpen()) {          displayAlert(errorAlert, msgNoCurrentRecordStore);          return;        }      switch (commandIndex) {        case LIST_STORES:          displayRecordStoreList();          break;        case CREATE_STORE:          requestRecordStoreName();          break;        case SELECT_STORE:          requestRecordStoreFromList("SELECT", ChoiceGroup.EXCLUSIVE);          break;        case DELETE_STORE:          requestRecordStoreFromList("DELETE", ChoiceGroup.MULTIPLE);          break;        case ADD_RECORD:          requestRecordData();          break;        case BROWSE_RECORDS:          filter = null;          startIteration();          break;        case BROWSE_FILTERED:          requestFilterCharacter();          break;        case GET_VERSION:          displayVersion();          break;        case LAST_MODIFIED:          displayLastModified();          break;        case GET_NEXT_REC_ID:          displayNextRecID();          break;        case GET_NUM_RECS:          displayRecordCount();          break;        case GET_SIZE:          displaySize();          break;       case GET_AVAIL:          displayAvailable();          break;         case CLOSE_STORE:          closeRecordStore();          break;        default:          break;       }    }    private boolean commandRequiresOpenStore(int index) {      if ((index == ADD_RECORD) ||          (index == BROWSE_RECORDS) ||          (index == BROWSE_FILTERED) ||          (index == GET_VERSION) ||          (index == LAST_MODIFIED) ||          (index == GET_NEXT_REC_ID) ||          (index == GET_NUM_RECS) ||          (index == GET_SIZE) ||          (index == GET_AVAIL) ||          (index == CLOSE_STORE)) {        return true;      }      else {       return false;      }    }    private boolean storeOpen() {      boolean open = true;      try {        getCurrentStoreName();      }      catch (RecordStoreNotOpenException e) {        open = false;      }    return open;    }    private void displayAlert(Alert alert, String message) {      alert.setString(message);      mainMenu.setSelectedIndex(0,true);      state = ST_MAIN_MENU;      display.setCurrent(alert,mainMenuForm);    }    private void displayNextRecord() {      try {        currentRecordID = enumeration.nextRecordId();        recordData = currentRecordStore.getRecord(currentRecordID);        displayRecordData();      }      catch (InvalidRecordIDException e) {        displayAlert(errorAlert,"Invalid RecordID");      }      catch (RecordStoreNotOpenException e) {        displayAlert(errorAlert,"RecordStore not open");      }      catch (RecordStoreException e) {        displayAlert(errorAlert,"RecordStoreException");      }    }    private void displayPreviousRecord() {      try {        currentRecordID = enumeration.previousRecordId();        recordData = currentRecordStore.getRecord(currentRecordID);        displayRecordData();      }      catch (InvalidRecordIDException e) {        displayAlert(errorAlert,"Invalid RecordID");      }      catch (RecordStoreNotOpenException e) {        displayAlert(errorAlert,"RecordStore not open");      }      catch (RecordStoreException e) {        displayAlert(errorAlert,"RecordStoreException");      }    }    private void displayRecordData() {      clearForm(recordForm);      recordForm.removeCommand(cmdPrev);      recordForm.removeCommand(cmdNext);      if (enumeration.hasNextElement()) {        recordForm.addCommand(cmdNext);      }      if (enumeration.hasPreviousElement()) {        recordForm.addCommand(cmdPrev);      }      recordForm.setTitle("Record #: " +         Integer.toString(currentRecordID));      recordForm.append(new StringItem(null,new String(recordData)));      state = ST_BROWSING_STORE;      display.setCurrent(recordForm);   }    private void processRecordForm() {      int subCommandIndex = 0;      String label = currentCommand.getLabel();      for (int i = 0; i < recordSubCommands.length; ++i) {        if (recordSubCommands[i].equals(label)) {          subCommandIndex = i;          break;        }      }      switch (subCommandIndex) {        case SUB_BACK:          displayMainMenu();          break;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
有码一区二区三区| 粉嫩aⅴ一区二区三区四区| 日韩视频免费观看高清完整版| 国产激情一区二区三区桃花岛亚洲| 亚洲人成7777| 国产精品欧美久久久久无广告| 日韩视频不卡中文| 欧美日韩视频在线观看一区二区三区| 国产一区欧美一区| 日韩av电影免费观看高清完整版 | 91美女片黄在线| 日韩不卡一二三区| 亚洲成人免费电影| 一区二区三区日本| 中文字幕不卡的av| 国产嫩草影院久久久久| 久久久久99精品国产片| 精品国产电影一区二区| 精品久久久久久久人人人人传媒| 7777精品伊人久久久大香线蕉的 | 亚洲欧洲日本在线| 国产精品美女久久久久久久久久久| 欧美大片在线观看一区二区| 91精品国产一区二区三区蜜臀| 欧美日韩国产综合久久| 日韩一二三区不卡| 国产视频一区在线播放| 国产精品看片你懂得| 最近中文字幕一区二区三区| 一区二区三区中文免费| 日韩va欧美va亚洲va久久| 国产一区二区三区不卡在线观看| 国产成人aaa| 欧美日本国产视频| 国产日韩欧美高清| 亚洲成人一区二区在线观看| 久草热8精品视频在线观看| 色菇凉天天综合网| 久久精品一区蜜桃臀影院| 亚洲国产你懂的| 成人小视频免费在线观看| 欧美美女黄视频| 亚洲精品久久7777| 国产一区不卡视频| 日韩一级视频免费观看在线| 一区二区三区欧美久久| 99久久99久久免费精品蜜臀| 久久精品亚洲一区二区三区浴池 | 国产传媒日韩欧美成人| 日韩欧美精品三级| 亚洲.国产.中文慕字在线| 99这里只有久久精品视频| 国产亲近乱来精品视频| 国产精选一区二区三区| 欧美精品一区视频| 国产在线乱码一区二区三区| 波波电影院一区二区三区| 久久亚洲一级片| 国产精品美女久久久久aⅴ国产馆| 日韩一区欧美二区| 91精品国产综合久久久久久漫画| 亚洲男帅同性gay1069| 91社区在线播放| 亚洲精品久久久蜜桃| 欧美性大战久久久久久久| 亚洲线精品一区二区三区| 欧美日韩在线三区| 免费一级欧美片在线观看| 精品盗摄一区二区三区| 9i在线看片成人免费| 一级女性全黄久久生活片免费| 欧美体内she精高潮| 国产一区999| 亚洲一区二区美女| 国产日韩一级二级三级| 欧美久久久久久久久中文字幕| 天天综合网天天综合色| 国产日韩欧美不卡在线| 欧美日韩另类国产亚洲欧美一级| 精品亚洲aⅴ乱码一区二区三区| 中文一区在线播放| 6080午夜不卡| 91亚洲男人天堂| 国产一区二区三区四| 亚洲国产综合色| 亚洲婷婷综合久久一本伊一区| 4hu四虎永久在线影院成人| 91天堂素人约啪| 国产在线精品国自产拍免费| 国产精品传媒入口麻豆| 麻豆中文一区二区| 国产精品短视频| 精品嫩草影院久久| 欧美一区欧美二区| 91成人网在线| 色悠悠亚洲一区二区| 成人av免费在线| 国产成人av一区| 激情综合亚洲精品| 美腿丝袜亚洲综合| 青草国产精品久久久久久| 美腿丝袜在线亚洲一区 | 国产亚洲欧美日韩日本| 成人av在线网站| 91在线国内视频| 色www精品视频在线观看| 91福利视频网站| 欧美日韩国产在线观看| 欧美日韩综合在线免费观看| 欧美日韩一区二区三区高清| 欧美色图激情小说| 制服丝袜中文字幕亚洲| 日韩精品一区二区三区四区视频 | 91在线视频官网| 91一区二区三区在线播放| 欧美日本不卡视频| 精品国产乱码久久久久久浪潮| www久久久久| 亚洲精品成人少妇| 久久精品99国产精品| 成人免费看黄yyy456| 欧美久久一区二区| 国产精品―色哟哟| 日本不卡视频一二三区| av色综合久久天堂av综合| 欧美白人最猛性xxxxx69交| 亚洲欧洲精品一区二区三区不卡 | 国产一区视频在线看| 91福利精品视频| 成人免费在线视频| 精品一区免费av| 91国产免费观看| 91麻豆国产精品久久| 欧美成人猛片aaaaaaa| 男人的天堂久久精品| 91久久精品一区二区| 久久久久国产精品麻豆ai换脸| 亚洲第一二三四区| 91丝袜美女网| 亚洲精品自拍动漫在线| 99re这里只有精品首页| 中文字幕不卡的av| 成人少妇影院yyyy| 欧美激情一区在线观看| 丁香婷婷综合五月| 国产精品美女一区二区在线观看| 国产乱子伦一区二区三区国色天香| 日韩一区国产二区欧美三区| 免费人成精品欧美精品| 日韩色视频在线观看| 国产精品99久久久| 中文一区二区完整视频在线观看| 国产91清纯白嫩初高中在线观看 | 国产天堂亚洲国产碰碰| 国产在线乱码一区二区三区| www激情久久| 欧美三级中文字幕| 精品在线亚洲视频| 亚洲图片另类小说| 91精品国产麻豆| 国产麻豆9l精品三级站| 亚洲黄色免费网站| 欧美va在线播放| 99免费精品视频| 免费观看91视频大全| 国产精品白丝在线| 欧美videofree性高清杂交| 色狠狠一区二区三区香蕉| 久久精品国产澳门| 亚洲一区二区三区四区的| 久久久久国产免费免费| 91麻豆精品国产| 欧美亚洲国产一区二区三区| 国产成人在线视频网址| 青青草国产精品亚洲专区无| 亚洲福利一区二区三区| 国产免费成人在线视频| 欧美xxxx老人做受| 欧美二区在线观看| 日本韩国欧美在线| 色激情天天射综合网| 丁香婷婷综合激情五月色| 国产一区免费电影| 久久精工是国产品牌吗| 日韩电影在线免费看| 蜜臀av性久久久久蜜臀aⅴ流畅| 亚洲国产色一区| 日韩**一区毛片| 极品少妇xxxx精品少妇偷拍| 国产一区二区免费视频| 韩国欧美国产一区| 国产真实乱偷精品视频免| 国产伦精品一区二区三区免费迷 | 久久99精品久久只有精品| 美日韩一级片在线观看| 九一九一国产精品| 国产美女精品在线| 99在线精品观看| 91黄色在线观看| 欧美videos大乳护士334|