// Daniel
 public static Label imovelInformativo() {
   lbInformativo = new Label();
   ;
   if (!isImovelInformativo) {
     lbInformativo.setText("             IMÓVEL INFORMATIVO");
   } else {
     lbInformativo.setText("");
   }
   lbInformativo.getStyle().setFgColor(0xff0000);
   lbInformativo.setVisible(true);
   lbInformativo.getStyle().setFont(font);
   return lbInformativo;
 }
  protected boolean onPersonalinfoDone() {
    TextField t = (TextField) findByName("thispass", perosnl);
    TextField t2 = (TextField) findByName("nowpass", perosnl);
    TextField l = (TextField) findByName("path11", perosnl);
    int indecate = 0;
    Label l2 = (Label) findByName("Label32", perosnl);

    if (!t2.getText().equals("")) {

      if (t.getText().equals(password.getText())) {
        checkpass = t2.getText();
      } else {

        l2.setText("error password miss match");
        indecate = 1;
      }
    }
    if (l.getText() != null) {
      imgpath = l.getText();
    }
    if (indecate == 0) {
      Myprofile.show();
      // showForm("MyProfile", null);
    }

    boolean val = super.onPersonalinfoDone();
    return val;
  }
  public Form getSupportMe() {
    if (frmSupportMe == null) {
      // ---------------------------------------------
      // Form f = ...
      frmSupportMe = new Form("Support Me");
      frmSupportMe.setLayout(new BorderLayout());

      Image bimage = null;
      try {
        bimage = Image.createImage("/images/metaLabSmall.png");
      } catch (IOException ex) {
        ex.printStackTrace();
      }

      Label bottomText = new Label(bimage);
      bottomText.setAlignment(Component.CENTER);
      bottomText.setText("Our Logo");
      bottomText.setTextPosition(Component.BOTTOM);

      Container buttonBar = new Container(new BoxLayout(BoxLayout.X_AXIS));
      buttonBar.addComponent(new Button("Add"));
      buttonBar.addComponent(new Button("Remove"));
      buttonBar.addComponent(new Button("Edit"));
      buttonBar.addComponent(new Button("Send"));
      buttonBar.addComponent(new Button("Exit"));

      frmSupportMe.addComponent(BorderLayout.CENTER, bottomText);
      frmSupportMe.addComponent(BorderLayout.SOUTH, buttonBar);
      frmSupportMe.addCommand(mBackCommand);
      frmSupportMe.addCommandListener(this); // Use setCommandListener() with LWUIT 1.3 or earlier.
    }
    return frmSupportMe;
  }
  public Component getListCellRendererComponent(
      List list, Object value, int index, boolean isSelected) {
    IContent content = (IContent) value;

    mMediaType.setText("");
    mMediaType.setIcon(null);
    mMediaType.setIcon(MediaTypeResolver.getTypeIcon(content.getType()));

    mTitle.setText(content.getText());

    if (content instanceof Content) {

      if (fileLists == null) {
        fileLists = NedIOUtils.directoryListing(((Content) content).getMediaFilePath());
      }

      if (fileLists != null && ((Content) content).isDownloaded(fileLists)) {
        mFlag.setIcon(local);
      } else {
        mFlag.setIcon(remote);
      }
    }

    if (isSelected) {
      setFocus(true);
      mTitle.getStyle().setFgColor(NEDStyleToolbox.WHITE);
      getStyle().setBgPainter(mSelectedPainter);
    } else {
      setFocus(false);
      mTitle.getStyle().setFgColor(NEDStyleToolbox.MAIN_FONT_COLOR);
      getStyle().setBgPainter(mUnselectedPainter);
    }
    return this;
  }
Example #5
0
 public Component getListCellRendererComponent(
     List list, Object value, int index, boolean isSelected) {
   if (isSelected) {
     title.setText(value.toString());
     return selected;
   }
   setText(value.toString());
   setFocus(false);
   getStyle().setBgTransparency(0);
   return this;
 }
Example #6
0
  private boolean authentication() throws SaveException, RecordStoreException {

    titleLbl.setText("Authenticating...");
    String username = usernameTxt.getText().trim().toLowerCase();
    String password = passwordTxt.getText().trim().toLowerCase();

    // TODO crytped password + encoding
    HTTPWebAPI api = new HTTPWebAPI();
    String apikey = api.getAPIKey(username, password);
    log.debug("API key: " + apikey);
    if (apikey.length() == 40) {
      titleLbl.setText("Saving API key...");
      midlet.getPreferences().setAPIKey(apikey);
      midlet.getPreferences().setUsername(usernameTxt.getText().trim());
      midlet.getPreferences().save();
      titleLbl.setText("API key saved");
      return true;
    } else {

      return false;
    }
  }
Example #7
0
    public FishEyeRenderer() {
      super("");
      Image smily = null;
      try {
        Resources imageRes = UIDemoMIDlet.getResource("images");
        smily = imageRes.getImage("smily.png");
      } catch (IOException ex) {
        ex.printStackTrace();
      }
      title = new Label("");
      title.getSelectedStyle().setBgTransparency(0);
      Label description = new Label(smily);
      description.setText("description...");
      description.getSelectedStyle().setBgTransparency(0);
      selected.addComponent(title);
      selected.addComponent(description);
      title.setFocus(true);
      description.setFocus(true);

      // selected.getStyle().setBgTransparency(0xFF);
    }
Example #8
0
  public Form getForm() {

    if (loginForm != null) {
      titleLbl.setText("Login:"******"NoiseTube Account");
    loginPanel = new Container();
    loginPanel.setLayout(new BoxLayout(BoxLayout.Y_AXIS));
    titleLbl = new Label(" ");

    usernameLbl = new Label();
    usernameTxt = new TextField();
    usernameLbl.setText("Username:"******"Password:"******"Skip");
    loginCmd = new Command("Login");

    // buttonPanel = new Container();
    // buttonPanel.addComponent(loginBtn);
    // buttonPanel.getStyle().setMargin(2, 2, 2, 2);

    titleLbl.setText("Login:"******"Connexion error");
                titleLbl.setText("Connexion error");
              } catch (RecordStoreException e1) {
                titleLbl.setText("Error saving APIkey");
                log.error(e1, "Error saving APIkey");
              }
            } else if (skipCmd.equals(arg0.getCommand())) {
              MainMidlet.getInstance()
                  .getPreferences()
                  .setSavingMode(
                      Device.supportsSavingToFile() ? Preferences.SAVE_FILE : Preferences.SAVE_NO);
              midlet.showMeasureForm();
            } else midlet.notifyDestroyed();
          }
        });
    return loginForm;
  }
Example #9
0
 public void setStatus(String message) {
   lblError.setText(message);
   repaint();
 }
    public Component getListCellRendererComponent(
        List list, Object value, int index, boolean isSelected) {

      PrivacyModel cell = (PrivacyModel) value;

      setLayout(new BorderLayout());

      Label name = new Label();
      name.getStyle().setPadding(Component.LEFT, 5, true);
      name.setText(cell.getTitle());
      name.getStyle().setFont(Fonts.MEDIUM, true);
      name.getStyle().setFgColor(ColorCodes.settingsScreenListItemHeadingGrey, true);
      name.getSelectedStyle().setPadding(Component.BOTTOM, 0, true);
      name.getStyle().setBgTransparency(0, true);

      TextArea description = new TextArea();
      description.setText(cell.getSubTitle());
      description.getStyle().setFgColor(ColorCodes.settingsScreenListItemDescGrey);
      description.getSelectedStyle().setFgColor(ColorCodes.settingsScreenListItemDescGrey);
      description.getStyle().setBgColor(ColorCodes.settingsScreenListBgGrey, true);
      description.getSelectedStyle().setBgColor(ColorCodes.settingsScreenListBgGrey, true);
      description.setEditable(false);
      description.setRows(2);
      description.setPreferredW(com.sun.lwuit.Display.getInstance().getDisplayWidth() - 20);
      description.getSelectedStyle().setBgTransparency(255, true);
      description.getStyle().setBgTransparency(255, true);
      description.getStyle().setBorder(Border.createEmpty(), true);
      description.getSelectedStyle().setBorder(Border.createEmpty(), true);
      description.getStyle().setPadding(Component.LEFT, 5, true);
      description.getSelectedStyle().setPadding(Component.LEFT, 5, true);
      description.getStyle().setPadding(Component.TOP, 0, true);
      description.getSelectedStyle().setPadding(Component.TOP, 0, true);
      description.getStyle().setPadding(Component.BOTTOM, 0, true);
      description.getSelectedStyle().setPadding(Component.BOTTOM, 0, true);
      description.getSelectedStyle().setFont(Fonts.SMALL, true);
      description.getStyle().setFont(Fonts.SMALL, true);

      Container nameDescContainer = new Container(new BoxLayout(BoxLayout.Y_AXIS));
      nameDescContainer.getStyle().setPadding(Component.RIGHT, 0, true);
      nameDescContainer.getSelectedStyle().setPadding(Component.RIGHT, 0, true);
      nameDescContainer.getStyle().setBorder(Border.createEmpty(), true);
      nameDescContainer.getSelectedStyle().setBorder(Border.createEmpty(), true);
      nameDescContainer.addComponent(name);
      nameDescContainer.addComponent(description);

      arrowIconLabel = new Label();
      arrowIconLabel.setIcon(arrowIconImage);
      arrowIconLabel.getStyle().setAlignment(Component.CENTER);
      arrowIconLabel.getStyle().setBgTransparency(0, true);
      arrowIconLabel.getSelectedStyle().setBgTransparency(0, true);
      arrowIconLabel.getPressedStyle().setBgTransparency(0, true);
      arrowIconLabel.getPressedStyle().setBorder(null, true);
      arrowIconLabel.getStyle().setBorder(null, true);
      arrowIconLabel.getSelectedStyle().setBorder(null, true);
      arrowIconLabel.getStyle().setAlignment(CENTER);
      arrowIconLabel.getStyle().setPadding(Component.RIGHT, 10, true);

      mainContainer = new Container(new BorderLayout());
      mainContainer.setPreferredH(80);
      mainContainer.getStyle().setPadding(Component.TOP, 2, true);
      mainContainer
          .getStyle()
          .setBorder(
              Border.createCompoundBorder(
                  null,
                  Border.createEtchedRaised(
                      ColorCodes.settingsScreenSeperatorGrey,
                      ColorCodes.settingsScreenSeperatorShadow),
                  null,
                  null),
              true);
      mainContainer.addComponent(BorderLayout.WEST, nameDescContainer);
      mainContainer.addComponent(BorderLayout.EAST, arrowIconLabel);

      return mainContainer;
    }
  public static AbaImoveis getInstancia() {
    if (AbaImoveis.instanciaAbaImoveis == null) {
      instanciaAbaImoveis = new AbaImoveis(new BoxLayout(BoxLayout.Y_AXIS));

      font = Font.createSystemFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_SMALL);

      lbNomeEndereco = new Label("Endereço:");
      lbNomeEndereco.getStyle().setFont(font);
      lbNomeEndereco.getStyle().setPadding(0, 0, 3, 0);
      lbNomeEndereco.getStyle().setMargin(0, 0, 3, 0);

      lbEndereco = new Label();
      lbEndereco.setFocusable(true);
      lbEndereco.getStyle().setPadding(0, 0, 3, 0);
      lbEndereco.getStyle().setMargin(0, 0, 3, 0);

      nomeMatricula = new Label("Matrícula:");

      nomeMatricula.getStyle().setPadding(1, 0, 1, 0);
      nomeMatricula.getStyle().setMargin(1, 0, 1, 0);
      nomeMatricula.getStyle().setFont(font);

      matricula = new Label();
      matricula.getStyle().setPadding(0, 3, 1, 0);
      matricula.getStyle().setMargin(0, 3, 1, 0);
      matricula.setFocusable(true);

      nomeInscricao = new Label("Inscrição:");
      nomeInscricao.getStyle().setFont(font);
      nomeInscricao.getStyle().setPadding(1, 0, 1, 0);
      nomeInscricao.getStyle().setMargin(1, 0, 1, 0);

      inscricao = new Label();
      inscricao.getStyle().setPadding(0, 3, 1, 0);
      inscricao.getStyle().setMargin(0, 3, 1, 0);
      inscricao.setFocusable(true);

      nomeLocal = new Label();
      nomeLocal.setText("Endereço de Entrega:");
      nomeLocal.getStyle().setPadding(1, 0, 1, 0);
      nomeLocal.getStyle().setMargin(1, 0, 1, 0);
      nomeLocal.getStyle().setFont(font);

      local = new Label();
      local.getStyle().setPadding(0, 3, 1, 0);
      local.getStyle().setMargin(0, 3, 1, 0);
      local.setFocusable(true);

      nomeRota = new Label("Seq. Rota:");
      nomeRota.getStyle().setPadding(1, 0, 1, 0);
      nomeRota.getStyle().setMargin(1, 0, 1, 0);
      nomeRota.getStyle().setFont(font);

      rota = new Label();
      rota.getStyle().setPadding(0, 3, 1, 0);
      rota.getStyle().setMargin(0, 3, 1, 0);
      rota.setFocusable(true);

      nomeLigAgua = new Label("Sit. Lig. Água:");
      nomeLigAgua.getStyle().setPadding(1, 0, 1, 0);
      nomeLigAgua.getStyle().setMargin(1, 0, 1, 0);
      nomeLigAgua.getStyle().setFont(font);

      ligAgua = new Label();
      ligAgua.getStyle().setPadding(0, 3, 1, 0);
      ligAgua.getStyle().setMargin(0, 3, 1, 0);
      ligAgua.setFocusable(true);

      // Daniel
      lbInformativo = new Label();
      lbInformativo.getStyle().setFgColor(0xff0000);
      lbInformativo.setVisible(true);
      lbInformativo.getStyle().setFont(font);

      nomeLigEsgoto = new Label("Sit. Lig. Esgoto:");
      nomeLigEsgoto.getStyle().setPadding(1, 0, 1, 0);
      nomeLigEsgoto.getStyle().setMargin(1, 0, 1, 0);
      nomeLigEsgoto.getStyle().setFont(font);

      ligEsgoto = new Label();
      ligEsgoto.getStyle().setPadding(0, 3, 1, 0);
      ligEsgoto.getStyle().setMargin(0, 3, 1, 0);
      ligEsgoto.setFocusable(true);

      nomeCliente = new Label("Nome Usuário: ");
      nomeCliente.getStyle().setPadding(1, 0, 1, 0);
      nomeCliente.getStyle().setMargin(1, 0, 1, 0);
      nomeCliente.getStyle().setFont(font);

      cliente = new Label();
      cliente.getStyle().setPadding(0, 3, 1, 0);
      cliente.getStyle().setMargin(0, 3, 1, 0);
      cliente.setFocusable(true);

      if (ImovelReg11.getInstancia().getIndcTarifaCatgoria() == ImovelReg11.CALCULO_POR_CATEGORA) {

        nomeCatgoria =
            new Label(
                Util.completaString("Economias", 15)
                    + Util.completaString("Cod. Cat", 25)
                    + Util.completaString("Subcategoria", 20));
        nomeCatgoria.getStyle().setFont(font);

      } else {
        nomeCatgoria =
            new Label(
                (Util.completaString("Eco.", 40)) + (Util.completaString("Subcategoria", 20)));
        nomeCatgoria.getStyle().setFont(font);
      }

      nomeEconomias = new Label("Economias: ");
      nomeEconomias.getStyle().setFont(font);
      economias = new Label();
      economias.setFocusable(true);

      instanciaAbaImoveis.setScrollable(true);
      instanciaAbaImoveis.setScrollableX(false);

      // Daniel - rota completa
      instanciaAbaImoveis.addComponent(lbInformativo);
      instanciaAbaImoveis.addComponent(nomeLigAgua);
      instanciaAbaImoveis.addComponent(ligAgua);
      instanciaAbaImoveis.addComponent(nomeLigEsgoto);
      instanciaAbaImoveis.addComponent(ligEsgoto);
      instanciaAbaImoveis.addComponent(nomeCatgoria);

      dadosCategoria = new Container(new BoxLayout(BoxLayout.Y_AXIS));

      instanciaAbaImoveis.addComponent(dadosCategoria);

      instanciaAbaImoveis.addComponent(lbNomeEndereco);
      instanciaAbaImoveis.addComponent(lbEndereco);
      instanciaAbaImoveis.addComponent(nomeCliente);
      instanciaAbaImoveis.addComponent(cliente);
      instanciaAbaImoveis.addComponent(nomeMatricula);
      instanciaAbaImoveis.addComponent(matricula);
      instanciaAbaImoveis.addComponent(nomeInscricao);
      instanciaAbaImoveis.addComponent(inscricao);
      instanciaAbaImoveis.addComponent(nomeRota);
      instanciaAbaImoveis.addComponent(rota);
    }

    return instanciaAbaImoveis;
  }
  public Container criarAbaImoveis() {

    try {

      // Daniel - rota completa
      if (getImovelSelecionado().isImovelInformativo()
          && getImovelSelecionado().getIndcCondominio() != Constantes.SIM) {
        isImovelInformativo = true;
        lbInformativo.setText("                  IMÓVEL INFORMATIVO");
      } else {
        lbInformativo.setText("");
      }
      // Setamos o endereço
      lbEndereco.setText(getImovelSelecionado().getEndereco());

      matricula.setText(getImovelSelecionado().getMatricula() + "");
      inscricao.setText(getImovelSelecionado().getInscricao());

      nomeLocal.setVisible(
          getImovelSelecionado().getEnderecoEntrega() != null
              && !getImovelSelecionado().getEnderecoEntrega().equals(""));
      local.setVisible(
          getImovelSelecionado().getEnderecoEntrega() != null
              && !getImovelSelecionado().getEnderecoEntrega().equals(""));
      local.setText(getImovelSelecionado().getEnderecoEntrega());

      rota.setText(getImovelSelecionado().getSequencialRota() + "");

      ligAgua.setText(
          getImovelSelecionado()
              .getDescricaoSitLigacaoAgua(getImovelSelecionado().getSituacaoLigAgua()));

      ligEsgoto.setText(
          getImovelSelecionado()
              .getDescricaoSitLigacaoEsgoto(getImovelSelecionado().getSituacaoLigEsgoto()));

      cliente.setText(getImovelSelecionado().getNomeUsuario());

      Label categoriaLabel = null;

      dadosCategoria.removeAll();

      Font font = Font.createSystemFont(Font.FACE_MONOSPACE, Font.STYLE_PLAIN, Font.SIZE_MEDIUM);

      ImovelReg11 reg11 = ImovelReg11.getInstancia();

      for (int i = 0; i < getImovelSelecionado().getRegistros2().size(); i++) {

        if (reg11.getIndcTarifaCatgoria() == ImovelReg11.CALCULO_POR_CATEGORA) {

          categoriaLabel =
              new Label(
                  (Util.completaString(
                          ((ImovelReg2)
                                      ControladorImoveis.getInstancia()
                                          .getImovelSelecionado()
                                          .getRegistros2()
                                          .elementAt(i))
                                  .getQtdEconomiasSubcategoria()
                              + "",
                          19))
                      + (Util.completaString(
                          String.valueOf(
                                  ((ImovelReg2)
                                          ControladorImoveis.getInstancia()
                                              .getImovelSelecionado()
                                              .getRegistros2()
                                              .elementAt(i))
                                      .getCodigoCategoria())
                              .trim(),
                          10))
                      + (Util.completaString(
                          ((ImovelReg2)
                                  ControladorImoveis.getInstancia()
                                      .getImovelSelecionado()
                                      .getRegistros2()
                                      .elementAt(i))
                              .getDescricaoCategoria(),
                          22)));

          categoriaLabel.getStyle().setFont(font);

        } else {
          String qtdEconomias =
              String.valueOf(
                  ((ImovelReg2)
                          ControladorImoveis.getInstancia()
                              .getImovelSelecionado()
                              .getRegistros2()
                              .elementAt(i))
                      .getQtdEconomiasSubcategoria());

          categoriaLabel =
              new Label(
                  (Util.completaString(qtdEconomias, 05))
                      + (Util.completaString(
                          ((ImovelReg2)
                                  ControladorImoveis.getInstancia()
                                      .getImovelSelecionado()
                                      .getRegistros2()
                                      .elementAt(i))
                              .getDescricaoSubcategoria(),
                          40)));

          categoriaLabel.getStyle().setFont(font);
        }

        dadosCategoria.setFocusable(true);
        dadosCategoria.addComponent(categoriaLabel);
      }
      // camposImovel.addComponent(5, dadosCategoria);
    } catch (Exception e) {
      e.printStackTrace();
    }

    return instanciaAbaImoveis;
  }