📄 bluetoothclient.java
字号:
// write pre-init user code here screenCommand = new Command("Screen", Command.SCREEN, 0);//GEN-LINE:|22-getter|1|22-postInit // write post-init user code here }//GEN-BEGIN:|22-getter|2| return screenCommand; } //</editor-fold>//GEN-END:|22-getter|2| //<editor-fold defaultstate="collapsed" desc=" Generated Getter: backCommand ">//GEN-BEGIN:|24-getter|0|24-preInit /** * Returns an initiliazed instance of backCommand component. * @return the initialized component instance */ public Command getBackCommand() { if (backCommand == null) {//GEN-END:|24-getter|0|24-preInit // write pre-init user code here backCommand = new Command("BacktoContactList", Command.BACK, 0);//GEN-LINE:|24-getter|1|24-postInit // write post-init user code here }//GEN-BEGIN:|24-getter|2| return backCommand; } //</editor-fold>//GEN-END:|24-getter|2| //<editor-fold defaultstate="collapsed" desc=" Generated Getter: exitCommand ">//GEN-BEGIN:|27-getter|0|27-preInit /** * Returns an initiliazed instance of exitCommand component. * @return the initialized component instance */ public Command getExitCommand() { if (exitCommand == null) {//GEN-END:|27-getter|0|27-preInit // write pre-init user code here exitCommand = new Command("Exit", Command.EXIT, 0);//GEN-LINE:|27-getter|1|27-postInit // write post-init user code here }//GEN-BEGIN:|27-getter|2| return exitCommand; } //</editor-fold>//GEN-END:|27-getter|2| //<editor-fold defaultstate="collapsed" desc=" Generated Getter: deviceList ">//GEN-BEGIN:|29-getter|0|29-preInit /** * Returns an initiliazed instance of deviceList component. * @return the initialized component instance */ public List getDeviceList() { if (deviceList == null) {//GEN-END:|29-getter|0|29-preInit // write pre-init user code here deviceList = new List("Device List", Choice.IMPLICIT);//GEN-BEGIN:|29-getter|1|29-postInit deviceList.addCommand(getConnect()); deviceList.addCommand(getLog1()); deviceList.addCommand(getExitCommand2()); deviceList.setCommandListener(this);//GEN-END:|29-getter|1|29-postInit // write post-init user code here }//GEN-BEGIN:|29-getter|2| return deviceList; } //</editor-fold>//GEN-END:|29-getter|2| //<editor-fold defaultstate="collapsed" desc=" Generated Method: deviceListAction ">//GEN-BEGIN:|29-action|0|29-preAction /** * Performs an action assigned to the selected list element in the deviceList component. */ public void deviceListAction() {//GEN-END:|29-action|0|29-preAction // enter pre-action user code here String __selectedString = getDeviceList().getString(getDeviceList().getSelectedIndex());//GEN-LINE:|29-action|1|29-postAction // enter post-action user code here switchDisplayable(getWaitSynchronizeAlert(),menuList); try{ startServiceSearch((RemoteDevice) deviceListVec.elementAt(getDeviceList().getSelectedIndex())); }catch(Exception e){ log(e); } }//GEN-BEGIN:|29-action|2| //</editor-fold>//GEN-END:|29-action|2| //<editor-fold defaultstate="collapsed" desc=" Generated Getter: Connect ">//GEN-BEGIN:|33-getter|0|33-preInit /** * Returns an initiliazed instance of Connect component. * @return the initialized component instance */ public Command getConnect() { if (Connect == null) {//GEN-END:|33-getter|0|33-preInit // write pre-init user code here Connect = new Command("Connect", Command.SCREEN, 0);//GEN-LINE:|33-getter|1|33-postInit // write post-init user code here }//GEN-BEGIN:|33-getter|2| return Connect; } //</editor-fold>//GEN-END:|33-getter|2| //<editor-fold defaultstate="collapsed" desc=" Generated Getter: Log1 ">//GEN-BEGIN:|37-getter|0|37-preInit /** * Returns an initiliazed instance of Log1 component. * @return the initialized component instance */ public Command getLog1() { if (Log1 == null) {//GEN-END:|37-getter|0|37-preInit // write pre-init user code here Log1 = new Command("Log", Command.SCREEN, 0);//GEN-LINE:|37-getter|1|37-postInit // write post-init user code here }//GEN-BEGIN:|37-getter|2| return Log1; } //</editor-fold>//GEN-END:|37-getter|2| //<editor-fold defaultstate="collapsed" desc=" Generated Getter: backCommand1 ">//GEN-BEGIN:|40-getter|0|40-preInit /** * Returns an initiliazed instance of backCommand1 component. * @return the initialized component instance */ public Command getBackCommand1() { if (backCommand1 == null) {//GEN-END:|40-getter|0|40-preInit // write pre-init user code here backCommand1 = new Command("BacktoDeviceList", Command.BACK, 0);//GEN-LINE:|40-getter|1|40-postInit // write post-init user code here }//GEN-BEGIN:|40-getter|2| return backCommand1; } //</editor-fold>//GEN-END:|40-getter|2| //<editor-fold defaultstate="collapsed" desc=" Generated Getter: menuList ">//GEN-BEGIN:|44-getter|0|44-preInit /** * Returns an initiliazed instance of menuList component. * @return the initialized component instance */ public List getMenuList() { if (menuList == null) {//GEN-END:|44-getter|0|44-preInit // write pre-init user code here menuList = new List("Menu", Choice.IMPLICIT);//GEN-BEGIN:|44-getter|1|44-postInit menuList.append("Browse Contacts", null); menuList.append("Synchronize", null); menuList.append("Restore", null); menuList.addCommand(getExitCommand1()); menuList.addCommand(getScreenCommand3()); menuList.setCommandListener(this); menuList.setSelectedFlags(new boolean[] { false, false, false });//GEN-END:|44-getter|1|44-postInit // write post-init user code here }//GEN-BEGIN:|44-getter|2| return menuList; } //</editor-fold>//GEN-END:|44-getter|2| //<editor-fold defaultstate="collapsed" desc=" Generated Method: menuListAction ">//GEN-BEGIN:|44-action|0|44-preAction /** * Performs an action assigned to the selected list element in the menuList component. */ public void menuListAction() {//GEN-END:|44-action|0|44-preAction // enter pre-action user code here String __selectedString = getMenuList().getString(getMenuList().getSelectedIndex());//GEN-BEGIN:|44-action|1|49-preAction if (__selectedString != null) { if (__selectedString.equals("Browse Contacts")) {//GEN-END:|44-action|1|49-preAction // write pre-action user code here browseContact = new Thread(contactThread); browseContact.start(); switchDisplayable(getWaitBrowseAlert(), getContactList());//GEN-LINE:|44-action|2|49-postAction // write post-action user code here } else if (__selectedString.equals("Synchronize")) {//GEN-LINE:|44-action|3|50-preAction // write pre-action user code here UserAction = "Synchronize"; try { startDeviceInquiry(); } catch (Exception e) { log(e); } makeDeviceSelectionGUI(); switchDisplayable(getDeviceAlert(), getDeviceList());//GEN-LINE:|44-action|4|50-postAction // write post-action user code here } else if (__selectedString.equals("Restore")) {//GEN-LINE:|44-action|5|80-preAction // write pre-action user code here UserAction = "Restore"; try { startDeviceInquiry(); } catch (Exception e) { log(e); } makeDeviceSelectionGUI(); switchDisplayable(getDeviceAlert(), getDeviceList()); //GEN-LINE:|44-action|6|80-postAction // write post-action user code here }//GEN-BEGIN:|44-action|7|44-postAction }//GEN-END:|44-action|7|44-postAction // enter post-action user code here }//GEN-BEGIN:|44-action|8| //</editor-fold>//GEN-END:|44-action|8| //<editor-fold defaultstate="collapsed" desc=" Generated Getter: contactList ">//GEN-BEGIN:|52-getter|0|52-preInit /** * Returns an initiliazed instance of contactList component. * @return the initialized component instance */ public List getContactList() { if (contactList == null) {//GEN-END:|52-getter|0|52-preInit // write pre-init user code here contactList = new List("Contacts", Choice.IMPLICIT);//GEN-BEGIN:|52-getter|1|52-postInit contactList.addCommand(getLog2()); contactList.addCommand(getBackCommand2()); contactList.addCommand(getExitCommand3()); contactList.setCommandListener(this);//GEN-END:|52-getter|1|52-postInit // write post-init user code here }//GEN-BEGIN:|52-getter|2| return contactList; } //</editor-fold>//GEN-END:|52-getter|2| //<editor-fold defaultstate="collapsed" desc=" Generated Method: contactListAction ">//GEN-BEGIN:|52-action|0|52-preAction /** * Performs an action assigned to the selected list element in the contactList component. */ public void contactListAction() {//GEN-END:|52-action|0|52-preAction // enter pre-action user code here String __selectedString = getContactList().getString(getContactList().getSelectedIndex());//GEN-LINE:|52-action|1|52-postAction // enter post-action user code here }//GEN-BEGIN:|52-action|2| //</editor-fold>//GEN-END:|52-action|2| //<editor-fold defaultstate="collapsed" desc=" Generated Getter: screenCommand1 ">//GEN-BEGIN:|47-getter|0|47-preInit /** * Returns an initiliazed instance of screenCommand1 component. * @return the initialized component instance */ public Command getScreenCommand1() { if (screenCommand1 == null) {//GEN-END:|47-getter|0|47-preInit // write pre-init user code here screenCommand1 = new Command("Screen", Command.SCREEN, 0);//GEN-LINE:|47-getter|1|47-postInit // write post-init user code here }//GEN-BEGIN:|47-getter|2| return screenCommand1; } //</editor-fold>//GEN-END:|47-getter|2| //<editor-fold defaultstate="collapsed" desc=" Generated Getter: Sychronize ">//GEN-BEGIN:|55-getter|0|55-preInit /** * Returns an initiliazed instance of Sychronize component. * @return the initialized component instance */ public Command getSychronize() { if (Sychronize == null) {//GEN-END:|55-getter|0|55-preInit // write pre-init user code here Sychronize = new Command("Screen", Command.SCREEN, 0);//GEN-LINE:|55-getter|1|55-postInit // write post-init user code here }//GEN-BEGIN:|55-getter|2| return Sychronize; } //</editor-fold>//GEN-END:|55-getter|2| //<editor-fold defaultstate="collapsed" desc=" Generated Getter: Log2 ">//GEN-BEGIN:|57-getter|0|57-preInit /** * Returns an initiliazed instance of Log2 component. * @return the initialized component instance */ public Command getLog2() { if (Log2 == null) {//GEN-END:|57-getter|0|57-preInit // write pre-init user code here Log2 = new Command("Log", Command.SCREEN, 0);//GEN-LINE:|57-getter|1|57-postInit // write post-init user code here }//GEN-BEGIN:|57-getter|2| return Log2; } //</editor-fold>//GEN-END:|57-getter|2| //<editor-fold defaultstate="collapsed" desc=" Generated Getter: backCommand2 ">//GEN-BEGIN:|59-getter|0|59-preInit /** * Returns an initiliazed instance of backCommand2 component. * @return the initialized component instance */ public Command getBackCommand2() { if (backCommand2 == null) {//GEN-END:|59-getter|0|59-preInit // write pre-init user code here backCommand2 = new Command("Back", Command.BACK, 0);//GEN-LINE:|59-getter|1|59-postInit // write post-init user code here }//GEN-BEGIN:|59-getter|2| return backCommand2; } //</editor-fold>//GEN-END:|59-getter|2| //<editor-fold defaultstate="collapsed" desc=" Generated Getter: screenCommand2 ">//GEN-BEGIN:|62-getter|0|62-preInit /** * Returns an initiliazed instance of screenCommand2 component. * @return the initialized component instance */ public Command getScreenCommand2() { if (screenCommand2 == null) {//GEN-END:|62-getter|0|62-preInit // write pre-init user code here screenCommand2 = new Command("Screen", Command.SCREEN, 0);//GEN-LINE:|62-getter|1|62-postInit // write post-init user code here }//GEN-BEGIN:|62-getter|2| return screenCommand2; } //</editor-fold>//GEN-END:|62-getter|2|
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -