Package com.sun.lwuit

Examples of com.sun.lwuit.Form


  public PlayerManager(String _locator, GuiMidlet _midlet, boolean isImage) {
    locator = _locator;
    midlet = _midlet;
    //display = midlet.display;
          is_image = isImage;
    form = new Form("Player Manager");
    form.setLayout(new BorderLayout());
    form.setCommandListener(this);
           if (is_image)
              form.addCommand(Contents.back);
          else
View Full Code Here


   * Show the first menu (offline)
   * @return
   */
  public void getGuiOfflineMenu() {

    offLineMenu = new Form(Contents.offline_form);
    offLineMenu.setLayout(new BorderLayout());
      //  int width = Display.getInstance().getDisplayWidth(); //get the display width
        Container mainContainer;
        int elementWidth = 0;

View Full Code Here

   * Show the main menu (online)
   * @return
   */
  public void getGuiOnlineMenu() {
        internal_state = ONLINE;
      mainForm = new Form(Datas.jid.getUsername() + " (" + Datas.jid.getPresence()+")");
      mainForm.setLayout(new BorderLayout());
      mainForm.setScrollable(false);
      mainForm.getStyle().setBgTransparency(0);
      tabbedPane = new TabbedPane();
    tabbedPane.addTabsListener(listener);
View Full Code Here

  /**
   * Show other options of the online menu
   * @return Form
   */
  public void getGuiOtherOptions() {
    options_form = new Form(Contents.options_form);
    internal_state = OPTIONS;
   
   
    if (infopool.containsKey("ServerInfo")) {//server info
      options_form.setLayout(new BoxLayout(BoxLayout.Y_AXIS));
View Full Code Here

      }
    }
  }

  public void getGuiChangeStatus() {
    Form status_form = new Form(Contents.choose_status);
    status_form.setLayout(new BoxLayout(BoxLayout.Y_AXIS));
 
        internal_state = STATUS;
    Image[] unselectedImages = new Image[] { Contents.displayImage("offline"), Contents.displayImage("online"), Contents.displayImage("away"), Contents.displayImage("busy")/*, Contents.displayImage("unsubscribed")*/ }
    //status_list = new ChoiceGroup(Contents.choose_status, ChoiceGroup.EXCLUSIVE, Contents.mystring_presence, image);
    status_list = new ButtonGroup();
    for (int k = 0; k < Contents.mystring_presence.length; k++) {
      RadioButton rb = new RadioButton(Contents.mystring_presence[k], unselectedImages[k]);
      Style s = rb.getStyle();
          s.setMargin(0, 0, 0, 0);
        
          rb.setPressedIcon(unselectedImages[k].scaled( (int) (unselectedImages[k].getWidth()* 0.8),
                    (int)(unselectedImages[k].getHeight() *0.8) ));
          rb.setAlignment(Label.LEFT);
            rb.setTextPosition(Label.RIGHT);
          s.setBgTransparency(70);
          status_list.add(rb);
          status_form.addComponent(rb);
          if (Contents.mystring_presence[k].equals(Datas.jid.getPresence())) {
        status_list.setSelected(k);
      }
    }
    status_form.addComponent(new MyLabel("Your mood"));
        TextArea mess = new TextArea(Datas.jid.status_message, 100);
        status_form.addComponent(mess);
        infopool.put("status_message", mess);
        status_form.addCommand(Contents.ok);
 
        status_form.addCommand(Contents.back);
        status_form.setCommandListener(this);
 
        status_form.show();
  }
View Full Code Here

  /**
   * Show the details of a selected roster item
   * @return
   */
  public void getGuiRosterItem() {
    conv_list = new Form(currentjid.getUsername()/*"Group: " + currentjid.group + " Status: " + currentjid.getPresence()*/);
    String state = currentjid.status_message;
    conv_list.setLayout(new BoxLayout(BoxLayout.Y_AXIS));
    if (state != null && !state.equals("")) {
      MyTextArea t = new MyTextArea("Group: "+ currentjid.group + " Status: "+currentjid.getPresence());
      t.setEditable(false);
View Full Code Here

      name = currentjid.getUsername();
      current_Jid = currentjid.getFullJid();
      group_Jid = currentjid.group;
      phone_num = currentjid.phone;
    }
    Form res = new Form(name);
    res.setLayout(new BoxLayout(BoxLayout.Y_AXIS));
    TextArea jid = new TextArea(/*"jid", */current_Jid, 64);
    TextField group = new TextField(/*"group", */group_Jid, 32);
    TextField phone = new TextField(/*"phone num.",*/ phone_num, 32);
    infopool.put("jid", jid);
    infopool.put("group", group);
    infopool.put("phone", phone);
    res.addComponent(new MyLabel("jid:"));
    res.addComponent(jid);
    res.addComponent(new MyLabel("group:"));
    res.addComponent(group);
    res.addComponent(new MyLabel("phone:"));
    res.addComponent(phone);
    //res.append(new util.CustomSpacer(res.getWidth(), res.getHeight()));
    res.addCommand(Contents.ok);
    res.addCommand(Contents.back);
    res.setCommandListener(this);
   
    res.show();
  }
View Full Code Here

  /**
   * Show the gui for jud management
   * @return Form
   */
  public void getGuiJudMenu() {
    Form res = new Form("Search");
    if (infopool.containsKey("register")){
      res.setLayout(new BoxLayout(BoxLayout.Y_AXIS));
      TextField tf = new TextField( "", 32);
      TextField tf2 = new TextField( "", 32);
      TextField tf3 = new TextField( "", 64);
      infopool.put("jud_name", tf);
      infopool.put("jud_surname", tf2);
      infopool.put("jud_mail", tf3);
      res.addComponent(new MyLabel("Name"));
      res.addComponent(tf);
      res.addComponent(new MyLabel("Surname"));
      res.addComponent(tf2);
      res.addComponent(new MyLabel("Mail"));
      res.addComponent(tf3);
    }
    else if (infopool.containsKey("search")) {
      res.setLayout(new BoxLayout(BoxLayout.Y_AXIS));
      //TextField tf = new TextField("", 32);
      TextField tf2 = new TextField( "", 32);
      TextField tf3 = new TextField("", 32);
      TextField tf4 = new TextField( "", 32);
      TextField tf5 = new TextField("", 32);
      //infopool.put("jud_username", tf);
      infopool.put("jud_name", tf2);
      infopool.put("jud_surname", tf3);
      infopool.put("jud_nick", tf4);
      infopool.put("jud_mail", tf5);
            res.addComponent(new MyLabel("Nick"));
      res.addComponent(tf4);
      res.addComponent(new MyLabel("Name"));
      res.addComponent(tf2);
      res.addComponent(new MyLabel("Surname"));
      res.addComponent(tf3);
      //res.addComponent(new MyLabel("Username"));
      //res.addComponent(tf);
      res.addComponent(new MyLabel("Mail"));
      res.addComponent(tf5);
    }
    else {
      res.setLayout(new BoxLayout(BoxLayout.Y_AXIS));
      Image[] img = new Image[]{Contents.displayImage("connected"), Contents.displayImage("unsubscribed")};
      ButtonActionListener action = new ButtonActionListener();
      for (int k=0; k<Contents.judChoices.length; k++) {
            Button b = new Button(Contents.judChoices[k], img[k]);
              b.getStyle().setBgTransparency(100);
              b.setTextPosition(Button.RIGHT);
              b.addActionListener(action);
              res.addComponent(b);
          }
     
      if (infopool.containsKey("jud_message"))
      {
        MyTextArea t = new MyTextArea((String)infopool.remove("jud_message"));
       
        res.addComponent(t);
      }
     
      infopool.put("jud_form", res);
    }
   
    res.addCommand(Contents.ok);
    res.addCommand(Contents.back);
    res.setCommandListener(this);
    res.show();
   
  }
View Full Code Here

        Jud.searchJid(reg, (String)infopool.get("jud_add"));
        infopool.put("jud_message", "Request executed");
        getGuiJudMenu();
      }
      else if (infopool.get("jud_form") != null){ //default menu
        Form res = (Form)infopool.remove("jud_form");
        Button b = (Button)res.getFocused(); //try catch?
        //int ind = jud_list.getSelectedIndex();
        if (b.getText().equals(Contents.judChoices[0]))
          infopool.put("register", "reg");
        else 
          infopool.put("search", "sea");
View Full Code Here

        System.out.println("getGuiConversation, ERROR:tab="+tab);
       
      }
    //boolean canAnswer = currentConversation.canAnswer();
    //mainForm.removeAllCommands();
        mainForm = new Form(Datas.jid.getUsername() + " (" + Datas.jid.getPresence()+")");
      mainForm.setLayout(new BorderLayout());
      mainForm.setScrollable(false);     
      mainForm.getStyle().setBgTransparency(0);
        mainForm.addCommand(Contents.send, 0);
    mainForm.addCommand(Contents.delete, 1);
View Full Code Here

TOP

Related Classes of com.sun.lwuit.Form

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.