Exemplo n.º 1
0
  protected void startApp() throws MIDletStateChangeException {
    // TODO Auto-generated method stub

    // mDisplay.setCurrent(mForm);
    CCL.mDisplay.setCurrent(new HomeScreenCanvas());
    mCanvas = new HomeScreenCanvas();
    mCanvas.setTitle("Celebrity Cricket League");
    mCanvas.addCommand(home);
    mCanvas.addCommand(videos);
    mCanvas.addCommand(team);
    mCanvas.addCommand(photos);
    mCanvas.addCommand(schedule);
    mCanvas.addCommand(ownerlounge);
    mCanvas.setCommandListener(this);
    hideOpenKeypadCommand();

    mDisplay.setCurrent(mCanvas);
    // mDisplay.setCurrent(new HomeScreenCanvas());
    Pform = new Form("Photo Albums");
    Pform.addCommand(backCommand);
    Pform.setCommandListener(this);

    Vform = new Form("Video Albums");
    Vform.addCommand(backCommand);
    Vform.setCommandListener(this);

    mList.addCommand(backCommand);
    mList.setCommandListener(this);
  }
Exemplo n.º 2
0
 /** Constructs client GUI. */
 GUIImageClient(DemoMIDlet parent) {
   this.parent = parent;
   bt_client = new BTImageClient(this);
   mainScreen.addCommand(SCR_MAIN_BACK_CMD);
   mainScreen.addCommand(SCR_MAIN_SEARCH_CMD);
   mainScreen.setCommandListener(this);
   listScreen.addCommand(SCR_IMAGES_BACK_CMD);
   listScreen.addCommand(SCR_IMAGES_LOAD_CMD);
   listScreen.setCommandListener(this);
   imageScreen.addCommand(SCR_SHOW_BACK_CMD);
   imageScreen.setCommandListener(this);
 }
Exemplo n.º 3
0
 public void startApp() {
   if (mForm == null) {
     mForm = new Form(mAppID);
     mNumberEntry = new TextField("Connect To:", null, 256, TextField.PHONENUMBER);
     try {
       mInitialImage = Image.createImage(DEFAULT_IMAGE);
     } catch (Exception e) {
       System.out.println("start app err");
       e.printStackTrace();
     }
     mColorSquare =
         new ImageItem(null, mInitialImage, ImageItem.LAYOUT_DEFAULT, "waiting for image");
     mForm.append(mNumberEntry);
     mForm.append(mColorSquare);
     mForm.addCommand(mRedCommand);
     mForm.addCommand(mExitCommand);
     mForm.addCommand(mBlueCommand);
     mForm.setCommandListener(this);
   }
   Display.getDisplay(this).setCurrent(mForm);
   try {
     conn = (MessageConnection) Connector.open("mms://:" + mAppID);
     conn.setMessageListener(this);
   } catch (Exception e) {
     System.out.println("" + e);
   }
   if (conn != null) {
     startReceive();
   }
 }
Exemplo n.º 4
0
 private static void list(final Displayable retd, final String str, final Point p) {
   final Form f = new Form("");
   f.append(str);
   if (GGA.fixQuality > 0) {
     f.addCommand(Interface.trackTo);
     MODE_A_B.A = NMEA.l.GetPoint();
   }
   f.addCommand(Interface.ok);
   f.addCommand(Interface.exit);
   f.setCommandListener(
       new CommandListener() {
         public void commandAction(Command c, Displayable s) {
           if (c == Interface.ok) {
             if (p == null) MobNav1.display.setCurrent(retd);
             else {
               Labels.foundP = new Point(p);
               Labels.foundName = str;
               NAVI.SetGP(p);
               MobNav1.display.setCurrent(MobNav1.gCanvas);
             }
           } else if (c == Interface.trackTo) {
             MODE_A_B.B = new Point(p);
             MODE_A_B.get_AB_Track();
           } else MobNav1.display.setCurrent(retd);
         }
       });
   MobNav1.display.setCurrent(f);
 }
  private void createForm(
      final Display display, String room, String server, String nick, final String password) {
    this.display = display;
    parentView = display.getCurrent();

    Form formJoin = new Form(SR.MS_JOIN_CONFERENCE);

    roomField = new TextField(SR.MS_ROOM, room, 64, ConstMIDP.TEXTFIELD_URL);
    TextFieldCombo.setLowerCaseLatin(roomField);
    formJoin.append(roomField);

    hostField = new TextField(SR.MS_AT_HOST, server, 64, ConstMIDP.TEXTFIELD_URL);
    TextFieldCombo.setLowerCaseLatin(hostField);
    formJoin.append(hostField);

    if (nick == null) nick = sd.account.getNickName();
    nickField = new TextFieldCombo(SR.MS_NICKNAME, nick, 32, TextField.ANY, "roomnick", display);
    formJoin.append(nickField);

    passField =
        new TextField(SR.MS_PASSWORD, password, 32, TextField.ANY | ConstMIDP.TEXTFIELD_SENSITIVE);
    formJoin.append(passField);

    msgLimitField = new NumberField(SR.MS_MSG_LIMIT, 20, 0, 20);
    formJoin.append(msgLimitField);

    formJoin.addCommand(cmdJoin);
    // formJoin.addCommand(cmdBookmarks);
    formJoin.addCommand(cmdAdd);

    formJoin.addCommand(cmdCancel);
    formJoin.setCommandListener(this);
    display.setCurrent(formJoin);
  }
Exemplo n.º 6
0
  private void initializeComponent() {
    Resources resources = getResoursable();
    this.form = new Form("N2F TAG");

    _settingsCommand = new Command(resources.get("settingsCommand"), Command.SCREEN, 50);
    form.addCommand(_settingsCommand);

    _inviteCommand = new Command(resources.get("inviteCommand"), Command.SCREEN, 0);
    form.addCommand(_inviteCommand);

    if (App.getCurrentApp().getWebServiceIteractor().getEncryptionKey() != null) {
      _quickSettingsGroup = createQuickSettingsGroup(resources);
      form.append(_quickSettingsGroup);

      _synchronizeGroup = createSynchronizeGroup(resources);
      form.append(_synchronizeGroup);
    }
    addConsole(form);

    _exitCommand = new Command(resources.get("exitCommand"), Command.EXIT, 100);
    form.addCommand(_exitCommand);

    form.setItemStateListener(this);
    form.setCommandListener(this);
  }
Exemplo n.º 7
0
  public TrafficCams(Controller controller) {
    super("Traffic Status", Choice.EXCLUSIVE);

    this.controller = controller;
    traf = this;

    TrafOption = new Command("OK", Command.SCREEN, 1);
    bckMenu = new Command("back", Command.BACK, 2);

    VehicleOk = new Command("OK", Command.SCREEN, 1);
    Vehicleback = new Command("Back", Command.BACK, 2);

    this.addCommand(TrafOption);
    this.addCommand(bckMenu);
    setCommandListener(this);

    if (fmViewPng == null) {
      fmViewPng = new Form("");
      cmBack = new Command("Back", Command.BACK, 1);
      RefreshImage = new Command("refresh", Command.OK, 2);
      fmViewPng.addCommand(cmBack);
      fmViewPng.addCommand(RefreshImage);
      fmViewPng.setCommandListener(this);
    }
  }
  /** Creates a new instance of PrivacyForm */
  public PrivacyForm(Display display, PrivacyItem item, PrivacyList plist) {
    this.display = display;
    parentView = display.getCurrent();
    this.item = item;
    targetList = plist;

    textValue = new TextField(null, item.value, 64, ConstMIDP.TEXTFIELD_URL);
    TextFieldCombo.setLowerCaseLatin(textValue);

    form.append(choiceAction);
    choiceAction.setSelectedIndex(item.action, true);

    form.append(choiseType);

    form.append(textValue);
    choiseType.setSelectedIndex(item.type, true);
    switchType();

    form.append(choiseStanzas);
    choiseStanzas.setSelectedFlags(item.stanzasSet);

    // form.append("Order: "+item.order);

    form.setItemStateListener(this);
    form.setCommandListener(this);
    form.addCommand(cmdOk);
    form.addCommand(cmdCancel);
    display.setCurrent(form);
  }
Exemplo n.º 9
0
  public void showAllRecordForm() {
    fmAllRecords = new Form("All records");
    try {
      RecordEnumeration recEnum = rs.enumerateRecords(null, null, false);
      while (recEnum.hasNextElement()) {
        try {
          // System.out.println(new String(recEnum.nextRecord()));
          String name = "Nenacetl jsem";
          int number = 0;
          try {
            byte[] record = recEnum.nextRecord();
            ByteArrayInputStream buffer = new ByteArrayInputStream(record);
            DataInputStream dis = new DataInputStream(buffer);
            name = dis.readUTF();
            number = dis.readInt();
            dis.close();
          } catch (Exception e) {
          }

          fmAllRecords.append(name + " " + String.valueOf(number) + "\n");
        } catch (Exception e) {
          System.out.println(e.getMessage());
        }

        //
      }
    } catch (Exception ex) {
      System.out.println(ex.getMessage());
    }
    fmAllRecords.addCommand(cmdMenu);
    fmAllRecords.setCommandListener(this);
    dsp.setCurrent(fmAllRecords);
  }
Exemplo n.º 10
0
 public Form getF_welcome() {
   if (f_welcome == null) {
     f_welcome = new Form("NGCalc 2.4.3 \u00A9 Revzin", new Item[] {getImageItem()});
     f_welcome.addCommand(getC_canvas());
     f_welcome.setCommandListener(this);
   }
   return f_welcome;
 }
Exemplo n.º 11
0
 public InputText(String str) {
   Form form = new Form("請輸入" + str);
   if (page == 0) txt = new TextField(str, "", 10, TextField.ANY);
   else if (page == 2) txt = new TextField(str, "", 5, TextField.ANY);
   okCommand = new Command("確定", Command.OK, 1);
   form.append(txt);
   form.addCommand(okCommand);
   form.setCommandListener(this);
   display.setCurrent(form);
 }
Exemplo n.º 12
0
  public Form getForm() {
    if (form == null) {

      form = new Form("form");
      form.addCommand(getC_tovars());
      form.addCommand(getC_history());
      form.setCommandListener(this);
    }
    return form;
  }
Exemplo n.º 13
0
 /**
  * This method returns instance for NoBTForm component and should be called instead of accessing
  * NoBTForm field directly.//GEN-BEGIN:MVDGetBegin11
  *
  * @return Instance for NoBTForm component
  */
 public Form get_NoBTForm() {
   if (NoBTForm == null) { // GEN-END:MVDGetBegin11
     // Insert pre-init code here
     NoBTForm = new Form(null, new Item[] {get_stringItem1()}); // GEN-BEGIN:MVDGetInit11
     NoBTForm.addCommand(get_okCommand2());
     NoBTForm.setCommandListener(this); // GEN-END:MVDGetInit11
     // Insert post-init code here
   } // GEN-BEGIN:MVDGetEnd11
   return NoBTForm;
 } // GEN-END:MVDGetEnd11
Exemplo n.º 14
0
 /**
  * This method returns instance for BTOffForm component and should be called instead of accessing
  * BTOffForm field directly.//GEN-BEGIN:MVDGetBegin16
  *
  * @return Instance for BTOffForm component
  */
 public Form get_BTOffForm() {
   if (BTOffForm == null) { // GEN-END:MVDGetBegin16
     // Insert pre-init code here
     BTOffForm = new Form(null, new Item[] {get_stringItem2()}); // GEN-BEGIN:MVDGetInit16
     BTOffForm.addCommand(get_okCommand2());
     BTOffForm.setCommandListener(this); // GEN-END:MVDGetInit16
     // Insert post-init code here
   } // GEN-BEGIN:MVDGetEnd16
   return BTOffForm;
 } // GEN-END:MVDGetEnd16
Exemplo n.º 15
0
 /**
  * This method returns instance for StartFailedForm component and should be called instead of
  * accessing StartFailedForm field directly.//GEN-BEGIN:MVDGetBegin19
  *
  * @return Instance for StartFailedForm component
  */
 public Form get_StartFailedForm() {
   if (StartFailedForm == null) { // GEN-END:MVDGetBegin19
     // Insert pre-init code here
     StartFailedForm = new Form(null, new Item[] {get_stringItem3()}); // GEN-BEGIN:MVDGetInit19
     StartFailedForm.addCommand(get_okCommand2());
     StartFailedForm.setCommandListener(this); // GEN-END:MVDGetInit19
     // Insert post-init code here
   } // GEN-BEGIN:MVDGetEnd19
   return StartFailedForm;
 } // GEN-END:MVDGetEnd19
Exemplo n.º 16
0
 /**
  * This method returns instance for helpForm component and should be called instead of accessing
  * helpForm field directly.//GEN-BEGIN:MVDGetBegin25
  *
  * @return Instance for helpForm component
  */
 public Form get_helpForm() {
   if (helpForm == null) { // GEN-END:MVDGetBegin25
     // Insert pre-init code here
     helpForm = new Form(null, new Item[] {get_stringItem4()}); // GEN-BEGIN:MVDGetInit25
     helpForm.addCommand(get_okCommand2());
     helpForm.setCommandListener(this); // GEN-END:MVDGetInit25
     // Insert post-init code here
   } // GEN-BEGIN:MVDGetEnd25
   return helpForm;
 } // GEN-END:MVDGetEnd25
Exemplo n.º 17
0
 /**
  * This method returns instance for NoBTAPIForm component and should be called instead of
  * accessing NoBTAPIForm field directly.//GEN-BEGIN:MVDGetBegin43
  *
  * @return Instance for NoBTAPIForm component
  */
 public Form get_NoBTAPIForm() {
   if (NoBTAPIForm == null) { // GEN-END:MVDGetBegin43
     // Insert pre-init code here
     NoBTAPIForm = new Form(null, new Item[] {get_stringItem8()}); // GEN-BEGIN:MVDGetInit43
     NoBTAPIForm.addCommand(get_exitCommand());
     NoBTAPIForm.setCommandListener(this); // GEN-END:MVDGetInit43
     // Insert post-init code here
   } // GEN-BEGIN:MVDGetEnd43
   return NoBTAPIForm;
 } // GEN-END:MVDGetEnd43
Exemplo n.º 18
0
 /**
  * This method returns instance for PrevNotClosedForm component and should be called instead of
  * accessing PrevNotClosedForm field directly.//GEN-BEGIN:MVDGetBegin46
  *
  * @return Instance for PrevNotClosedForm component
  */
 public Form get_PrevNotClosedForm() {
   if (PrevNotClosedForm == null) { // GEN-END:MVDGetBegin46
     // Insert pre-init code here
     PrevNotClosedForm = new Form(null, new Item[] {get_stringItem5()}); // GEN-BEGIN:MVDGetInit46
     PrevNotClosedForm.addCommand(get_okCommand2());
     PrevNotClosedForm.setCommandListener(this); // GEN-END:MVDGetInit46
     // Insert post-init code here
   } // GEN-BEGIN:MVDGetEnd46
   return PrevNotClosedForm;
 } // GEN-END:MVDGetEnd46
Exemplo n.º 19
0
 public void addRecordForm() {
   fmAddRecord = new Form("Add Record");
   txfName = new TextField("Name", "", 10, TextField.ANY);
   txfNumber = new TextField("Number", "", 10, TextField.NUMERIC);
   fmAddRecord.append(txfName);
   fmAddRecord.append(txfNumber);
   fmAddRecord.addCommand(cmdAdd);
   fmAddRecord.addCommand(cmdMenu);
   fmAddRecord.setCommandListener(this);
   dsp.setCurrent(fmAddRecord);
 }
Exemplo n.º 20
0
 private void createAboutForm() {
   form = new Form(tr.t(Translator.ABOUT));
   form.setCommandListener(this);
   form.addCommand(backCommand);
   StringBuffer sb = new StringBuffer();
   sb.append(content.title).append(" by ").append(content.vendor).append('\n');
   sb.append("Version: ").append(content.version);
   sb.append("\nContent copyrights:").append(content.copyrights);
   sb.append("\n\nCreated using Creomobile Framework");
   form.append(sb.toString());
 }
Exemplo n.º 21
0
 public void getNumberRecord() {
   fmNumbers = new Form("Number of Records");
   int number = 0;
   try {
     number = rs.getNumRecords();
   } catch (Exception e) {
   }
   fmNumbers.append("Numbers of Records: " + number);
   dsp.setCurrent(fmNumbers);
   fmNumbers.setCommandListener(this);
   fmNumbers.addCommand(cmdMenu);
 }
Exemplo n.º 22
0
 public void startApp() {
   display = Display.getDisplay(this);
   try {
     form.append(img);
   } catch (Exception e) {
   }
   form.append(userName);
   form.append(password);
   form.addCommand(cancel);
   form.addCommand(login);
   form.setCommandListener(this);
   display.setCurrent(form);
 }
Exemplo n.º 23
0
  public Form getForm() {
    Form f = new Form(title);

    cmdVoltar = new Command("Voltar", Command.BACK, 1);

    StringItem strOpcoes = new StringItem(title, text);

    f.append(strOpcoes);

    f.addCommand(cmdVoltar);
    f.setCommandListener(listener);
    return f;
  }
Exemplo n.º 24
0
 public OriginatingINVITE() {
   // <i><b>Initialize MIDlet display</b></i>
   display = Display.getDisplay(this);
   // <i><b>create a Form for progess info printings</b></i>
   form = new Form("Session example");
   address = new TextField("INVITE:", "sip:[email protected]:5070", 40, TextField.LAYOUT_LEFT);
   form.append(address);
   byeCmd = new Command("Bye", Command.ITEM, 1);
   restartCmd = new Command("Restart", Command.ITEM, 1);
   startCmd = new Command("Start", Command.ITEM, 1);
   form.addCommand(startCmd);
   exitCmd = new Command("Exit", Command.EXIT, 1);
   form.addCommand(exitCmd);
   form.setCommandListener(this);
 }
Exemplo n.º 25
0
 /**
  * Returns an initialized instance of inputForm component.
  *
  * @return the initialized component instance
  */
 public Form getInputForm() {
   if (inputForm == null) {
     // GEN-END:|14-getter|0|14-preInit
     // write pre-init user code here
     inputForm =
         new Form(
             "Guess the number!",
             new Item[] {getStringItem(), getInputNumber()}); // GEN-BEGIN:|14-getter|1|14-postInit
     inputForm.addCommand(getOkCommand());
     inputForm.addCommand(getExitCommand());
     inputForm.setCommandListener(this); // GEN-END:|14-getter|1|14-postInit
     // write post-init user code here
   } // GEN-BEGIN:|14-getter|2|
   return inputForm;
 }
Exemplo n.º 26
0
  public SnapperMIDlet() {
    mExitCommand = new Command("Exit", Command.EXIT, 0);
    mCameraCommand = new Command("Camera", Command.SCREEN, 0);
    mBackCommand = new Command("Back", Command.BACK, 0);
    mCaptureCommand = new Command("Capture", Command.SCREEN, 0);

    mMainForm = new Form("Snapper");
    mMainForm.addCommand(mExitCommand);
    String supports = System.getProperty("video.snapshot.encodings");
    if (supports != null && supports.length() > 0) {
      mMainForm.append("Ready to take pictures.");
      mMainForm.addCommand(mCameraCommand);
    } else mMainForm.append("Snapper cannot use this " + "device to take pictures.");
    mMainForm.setCommandListener(this);
  }
Exemplo n.º 27
0
  public CopterForm(
      String title,
      Command cmdExit,
      CommandListener cl,
      ItemStateListener isl,
      Canvas canv,
      CopterAudioScene cas) {
    _f = new Form(title);
    _f.addCommand(cmdExit);
    _f.setItemStateListener(isl);
    _f.setCommandListener(cl);

    _c = new Command(title, Command.ITEM, 2);
    canv.addCommand(_c);
    _cas = cas;
  }
Exemplo n.º 28
0
 /**
  * Returns an initialized instance of resultForm component.
  *
  * @return the initialized component instance
  */
 public Form getResultForm() {
   if (resultForm == null) {
     // GEN-END:|26-getter|0|26-preInit
     // write pre-init user code here
     resultForm =
         new Form(
             "Result",
             new Item[] {
               getResultText(), getAttemptsText()
             }); // GEN-BEGIN:|26-getter|1|26-postInit
     resultForm.addCommand(getBackCommand());
     resultForm.addCommand(getExitCommand1());
     resultForm.setCommandListener(this); // GEN-END:|26-getter|1|26-postInit
     // write post-init user code here
   } // GEN-BEGIN:|26-getter|2|
   return resultForm;
 }
Exemplo n.º 29
0
 /**
  * Returns an initiliazed instance of LoginForm component.
  *
  * @return the initialized component instance
  */
 public Form getLoginForm() {
   if (LoginForm == null) { // GEN-END:|14-getter|0|14-preInit
     // write pre-init user code here
     LoginForm =
         new Form(
             "Login Screen",
             new Item[] {
               getUserAgentNameTF(), getTextField()
             }); // GEN-BEGIN:|14-getter|1|14-postInit
     LoginForm.addCommand(getExitCommand());
     LoginForm.addCommand(getOkCommand());
     LoginForm.addCommand(getOfflineMode());
     LoginForm.addCommand(getCreateContainer());
     LoginForm.addCommand(getCreateAgentandJoin());
     LoginForm.setCommandListener(this); // GEN-END:|14-getter|1|14-postInit
     // write post-init user code here
   } // GEN-BEGIN:|14-getter|2|
   return LoginForm;
 }
Exemplo n.º 30
0
  public void showFirstRecord() {
    fmFirstRecord = new Form("First Record");
    String name = "Nenacetl jsem";
    int number = 0;
    try {
      byte[] record = rs.getRecord(1);
      ByteArrayInputStream buffer = new ByteArrayInputStream(record);
      DataInputStream dis = new DataInputStream(buffer);
      name = dis.readUTF();
      number = dis.readInt();
      dis.close();
    } catch (Exception e) {
    }

    fmFirstRecord.append(name + " " + String.valueOf(number));
    // fmFirstRecord.append(String.valueOf(number));
    fmFirstRecord.setCommandListener(this);
    fmFirstRecord.addCommand(cmdMenu);
    dsp.setCurrent(fmFirstRecord);
  }