Package com.sun.lwuit

Examples of com.sun.lwuit.Label


   */
  public void notifyJudInfo(String info) {
   
    infopool.put("jud_message", info);
    if (midlet.internal_state != JUD)
      Dialog.show("Search user",new Label(info), new Command[]{Contents.ok}, Dialog.TYPE_INFO,null);
   
      //display.setCurrent(new Alert("Jud alert", info, null,AlertType.INFO));
    else
      midlet.getGuiJudMenu();
  }
View Full Code Here


        InputStream is = fconn.openInputStream();
        String type = "";
       
        if (is_image) {
            try {
                form.addComponent(BorderLayout.CENTER, new Label(Contents.displayImage(is)));
                form.show();
            }catch (NullPointerException e) {
                form.removeAll(); // clears the form of any previous controls
                Dialog.show("", Contents.noPhone, Dialog.TYPE_ERROR,null, "Ok","");
               // midlet.getGuiUpdateConversation(0);
View Full Code Here

        //}else
          //mainForm.removeAllCommands();
    Container contacts = new Container(new BoxLayout(BoxLayout.Y_AXIS));
    contacts.getStyle().setBorder(Border.createEmpty());
    if (Datas.jid.status_message != null && !Datas.jid.status_message.equals("")){
      Label mood = new Label(Datas.jid.status_message);
      mood.getStyle().setBgTransparency(0);
      contacts.addComponent(mood);
    }
        /*ContactList*/ contacts_list = new ContactList();
        contacts_list.getStyle().setBgTransparency(0);
        contacts_list.getStyle().setBorder(Border.createEmpty());
        contacts_list.setListCellRenderer(new ContactsRenderer());
        contacts_list.setSmoothScrolling(true);
        //contacts_list.setFixedSelection(List.FIXED_LEAD); //da testare
        contacts_list.addActionListener(contacts_list);
        /*Image contacts = null;
        Image  persons[] = null;
    */
 
     
    String hide = (String)infopool.get("hide");
    if (hide.equals(Contents.hide[1]))
      roster = Datas.createOnlineRosterVector(true);
    else
      roster = Datas.createRosterVector(true);
    if (roster.size() > 0) {
      //contacts_list = new ChoiceGroup("Contacts", ChoiceGroup.EXCLUSIVE);
      for (int i=0;i< roster.size(); i++) {       
        Jid temp = (Jid)roster.elementAt(i);
        /*String username = temp.getUsername().replace('%', '@');
        contacts_list.append(username, Datas.images.displayImage(temp.getPresence()));*/
        contacts_list.addItem(temp);
      }
     
    }else if (hide.equals(Contents.hide[0]))
      contacts.addComponent(new Label(Contents.noRoster));
   
    Button b = new Button(hide);
    //TODO: cambiare lo style
    b.setAlignment(Label.CENTER);
    b.getStyle().setBgTransparency(100);
View Full Code Here

   
    else state = "Group: "+ currentjid.group + " Status: "+currentjid.getPresence();
    Container info = new Container();
    info.setLayout(new GridLayout(1,2));
    info.getStyle().setBgTransparency(0);
      Label avatar = new Label(Jid.createAvatar(currentjid.getAvatar()).scaled(32, 32));
        avatar.getStyle().setBgTransparency(0);
    if (avatar.getWidth() < 32) {
      avatar.setPreferredSize(new Dimension(32,32));
     
    }
    info.addComponent(avatar);//AVATAR
    MyTextArea t = new MyTextArea(state, 0 ,100);
        t.setEnabled(true);
View Full Code Here

      /*if (i%2 != 0) {
        text.getStyle().setBgTransparency(255);
       
      }*/
      text.getStyle().setBorder(Border.createEmpty()); //no border
      Label txt = new Label(m.substring(0, m.indexOf(">")+1));
      txt.getStyle().setFgColor(0xF1F57C);
      txt.getStyle().setBgTransparency(0);
      text.addComponent(txt);
      m = m.substring(m.indexOf(">")+1, m.length());
      if ((p = m.indexOf("1smile")) != -1) { //check smiles
        //conversationForm.addComponent(txt);
        if (p > 0) {
          text.setLayout(new BoxLayout(BoxLayout.Y_AXIS));
          text.addComponent(new MyTextArea(m.substring(0, p),0,p));
        }
        Label l = new Label(Contents.displayImage(m.substring(p, p + 7)));
        l.getStyle().setBgTransparency(0);
        text.addComponent( l);
        if (p + 8 < m.length()-1)
          text.addComponent(new MyTextArea(m.substring(p + 8, m.length()),0,(m.length()-(p+8))));
     
      }
      if ((j = m.indexOf("+url+")) != -1) { //check links
        //conversationForm.addComponent(txt);
        //String name_link = "link";
          /*  if (lin == 0)
                  lin++;
            else {
                  name_link += lin;
                  lin++;
            }*/
        int k = m.indexOf("-url-");
        if (j > 0) {
          text.setLayout(new BoxLayout(BoxLayout.Y_AXIS));
          text.addComponent(new MyTextArea(m.substring(0, j), 0,j));
        }
        j = j + 5;
        Button link = new Button(m.substring(j, k));
        link.getStyle().setBgTransparency(100);
        link.getStyle().setBorder(Border.createEmpty()); //no border
        link.addActionListener(new ButtonActionListener());
        text.addComponent(link); k = k + 5;
        if (k < m.length()-1)
          text.addComponent(new MyTextArea(m.substring(k, m.length()), 0, 100));
     

      }
      else if (j == -1 && p == -1) {
       
        MyTextArea t = new MyTextArea(m, 0,50);
        t.setEnabled(true);
        text.addComponent(t);
      }

           
      conversationForm.addComponent(text);
    }
   
    //if it is multi chat
    if (currentConversation.isMulti) {
      //conversationForm.append(new util.CustomSpacer(conversationForm.getWidth()));
    //  res.append("Room Members: ");
     
     
      Container multi = new Container();
      multi.setLayout(new BorderLayout());
      multi.addComponent(BorderLayout.NORTH,new MyLabel("Room Members:"));
     
      GroupChat chat = (GroupChat)Datas.multichat.get(currentConversation.name);
      //conversationForm.append(new util.CustomStringItem("Room Members:", /*chat.jids,*/ conversationForm.getWidth()));
      Container friends = new Container()
      for (int j=0; j<chat.jids.size(); j++){
       
        String temp = (String)chat.jids.elementAt(j);
        if (temp.equals(currentConversation.name))
          continue;
        else if (temp.indexOf('@') != -1)
          friends.addComponent(new Label(temp.substring(0, temp.indexOf('@'))));
        else
          friends.addComponent(new Label(temp));
      }
      multi.addComponent(BorderLayout.CENTER, friends);
      //conversationForm.append(new util.CustomSpacer(conversationForm.getWidth()));
      TextField tf1 = new TextField(Contents.invite_textbox, 64);
     
View Full Code Here

       
        history = false; //reset
           // int lin = 0; //links count
          //TODO PROVA di COMPOSING
          if (!currentConversation.isMulti)
            conversationForm.addComponent(new Label(currentConversation.composing));
        for (int i=msgs.size()-1; i>=msgs.size()-maxText; i--) {
          msg = (Message) msgs.elementAt(i);
          int j,p = -1;
              //TODO: mettere sfondo di colore alternato
          String m;
          if (currentConversation.isMulti)
            m = msg.getTextNick(); //cambiare
          else
            m = msg.getText(); //cambiare
          Container text = new Container(new BoxLayout(BoxLayout.X_AXIS));
         
      /*if (i%2 != 0) {
        text.getStyle().setBgTransparency(255);
       
      }*/
      text.getStyle().setBorder(Border.createEmpty());
          Label txt = new Label(m.substring(0, m.indexOf(">")+1));
          txt.getStyle().setFgColor(0xF1F57C);
          txt.getStyle().setBgTransparency(0);
          text.addComponent(txt);
          m = m.substring(m.indexOf(">")+1, m.length());
          if ((p = m.indexOf("1smile")) != -1) { //check smiles
          //  conversationForm.addComponent(txt);
            if (p > 0) {
              text.setLayout(new BoxLayout(BoxLayout.Y_AXIS));
              text.addComponent(new MyTextArea(m.substring(0, p),0,p));
            }
            Label l = new Label(Contents.displayImage(m.substring(p, p + 7)));
            l.getStyle().setBgTransparency(0);
            text.addComponent( l);
            if (p + 8 < m.length()-1)
              text.addComponent(new MyTextArea(m.substring(p + 8, m.length()),0,(m.length()-(p+8))));
         
          }
          if ((j = m.indexOf("+url+")) != -1) { //check links
            //conversationForm.addComponent(txt);
            //String name_link = "link";
              /*  if (lin == 0)
                      lin++;
                else {
                      name_link += lin;
                      lin++;
                }*/
            text.setLayout(new BoxLayout(BoxLayout.Y_AXIS));
            int k = m.indexOf("-url-");
            if (j > 0) {
              text.setLayout(new BoxLayout(BoxLayout.Y_AXIS));
              text.addComponent(new MyTextArea(m.substring(0, j), 0,j));
            }
            j = j + 5;
            Button link = new Button(m.substring(j, k));
            link.getStyle().setBgTransparency(100);
            link.getStyle().setBorder(Border.createEmpty()); //no border
            link.addActionListener(new ButtonActionListener());
            text.addComponent(link); k = k + 5;
            if (k < m.length()-1)
              text.addComponent(new MyTextArea(m.substring(k, m.length()), 0, 100));
         

          }
          else if (j == -1 && p == -1) {
            //txt.setText(m);
            MyTextArea t = new MyTextArea(m, 0,50);
            t.setEnabled(true);
            text.addComponent(t);
          }
               
          conversationForm.addComponent(text);
        }
       
        //if it is multi chat
        if (currentConversation.isMulti) {
          //conversationForm.append(new util.CustomSpacer(conversationForm.getWidth()));
        //  res.append("Room Members: ");
         
         
          Container multi = new Container();
          multi.setLayout(new BorderLayout());
          multi.addComponent(BorderLayout.NORTH,new MyLabel("Room Members:"));
         
          GroupChat chat = (GroupChat)Datas.multichat.get(currentConversation.name);
          //conversationForm.append(new util.CustomStringItem("Room Members:", /*chat.jids,*/ conversationForm.getWidth()));
          Container friends = new Container()
          for (int j=0; j<chat.jids.size(); j++){
           
            String temp = (String)chat.jids.elementAt(j);
            if (temp.equals(currentConversation.name))
              continue;
            else if (temp.indexOf('@') != -1)
              friends.addComponent(new Label(temp.substring(0, temp.indexOf('@'))));
            else
              friends.addComponent(new Label(temp));
          }
          multi.addComponent(BorderLayout.CENTER, friends);
          //conversationForm.append(new util.CustomSpacer(conversationForm.getWidth()));
          TextField tf1 = new TextField(Contents.invite_textbox, 64);
          //mainForm.addCommand(Contents.invite);
View Full Code Here

      avatar_list.setSelected(1);
    else if (Datas.avatarFile != null)
      avatar_list.setSelected(0);
   
   
    Label m = new Label("* Mandatory fields");
    m.getStyle().setBgTransparency(0);
    m.getStyle().setFont(Font.createSystemFont(Font.FACE_SYSTEM, Font.STYLE_ITALIC, Font.SIZE_SMALL));
    m.setEnabled(true);
    m.setFocusable(true);
    res.addComponent(m);
    res.addCommand(Contents.back);
    res.addCommand(Contents.ok);
    res.setCommandListener(this);
   
View Full Code Here

    }  
     //Alert intro = new Alert("Jabber Mix Client", " Created by Gabriele Bianchi", logo, AlertType.INFO);
  
    Container body = new Container(new BorderLayout());
    //body.getStyle().setBgColor(0xFFFFFF,true);
    Label l =  new Label(logo);
    l.setAlignment(Label.CENTER);
    body.addComponent(BorderLayout.NORTH,l);
    MyTextArea t = new MyTextArea("Created by Gabriele Bianchi",0,100);
    //t.getStyle().setFgColor(0x0000FF,true);
    body.addComponent(BorderLayout.CENTER, t);
    Dialog.show("Jabber Mix Client", body, null, Dialog.TYPE_INFO, null, 3000);
View Full Code Here

TOP

Related Classes of com.sun.lwuit.Label

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.