/** @see net.rim.device.api.ui.FieldChangeListener#fieldChanged(Field, int) */
  public void fieldChanged(final Field field, final int context) {
    if (field == _map.getMapField()) {
      // Get the map's current dimensions
      final MapDimensions dim = _map.getMapField().getDimensions();

      switch (context) {
        case MapAction.ACTION_CENTER_CHANGE:
          _latField.setText("Latitude: " + dim.getCenter().getLat());
          _lonField.setText("Longitude: " + dim.getCenter().getLon());
          break;
        case MapAction.ACTION_ZOOM_CHANGE:
          _zoomField.setText("Zoom Level: " + dim.getZoom());
          break;
      }
    }
  }
  public AddFeedDialog(ObjectListField list) {
    super(
        new VerticalFieldManager(VERTICAL_SCROLLBAR | VERTICAL_SCROLL),
        DEFAULT_MENU | Field.FOCUSABLE);
    this.list = list;

    // title label to sit at top of screen
    LabelField titleLbl = new LabelField("Add a Feed", Field.FIELD_HCENTER);
    titleLbl.setFont(titleLbl.getFont().derive(Font.BOLD));
    titleLbl.setMargin(new XYEdges(0, 0, 10, 0)); // top,right,bottom,left

    // set up fields..
    LabelField nameLbl = new LabelField("Name");
    nameTxt = new TextField(500);

    LabelField urlLbl = new LabelField("Address");
    urlTxt = new TextField(500, EditField.FILTER_URL);

    addBtn = new ButtonField("Add", ButtonField.CONSUME_CLICK | Field.FIELD_HCENTER);
    cancelBtn = new ButtonField("Cancel", ButtonField.CONSUME_CLICK | Field.FIELD_HCENTER);

    // add everything to the screen..
    HorizontalFieldManager buttonsManager = new HorizontalFieldManager(Field.FIELD_HCENTER);
    buttonsManager.setMargin(new XYEdges(10, 0, 5, 0)); // top,right,bottom,left
    buttonsManager.add(addBtn);
    buttonsManager.add(cancelBtn);
    this.add(titleLbl);
    this.add(nameLbl);
    this.add(nameTxt);
    this.add(urlLbl);
    this.add(urlTxt);
    this.add(buttonsManager);

    // add action listeners to buttons..
    addBtn.setChangeListener(
        new FieldChangeListener() {
          public void fieldChanged(Field field, int context) {
            add();
          }
        });
    cancelBtn.setChangeListener(
        new FieldChangeListener() {
          public void fieldChanged(Field field, int context) {
            cancel();
          }
        });
  }
예제 #3
0
 protected void createScreenContents(VerticalFieldManager manager) {
   LabelField logDescription = new LabelField("Application log:", USE_ALL_WIDTH);
   manager.add(logDescription);
   log = new LabelField("", USE_ALL_WIDTH);
   logContainer.setListener(this);
   log.setText(logContainer.toString());
   manager.add(log);
 }
예제 #4
0
  public LabelField FocusableFormatLabel(
      Manager parent, net.rim.device.api.ui.Font font, final int color, String content) {
    content = content.trim();

    LabelField l_Label =
        new LabelField(content, Field.FOCUSABLE) {
          public void paint(Graphics g) {
            g.setColor(color);
            super.paint(g);
          }
        };
    l_Label.setMargin(1, 1, 1, 1);
    l_Label.setPadding(0, 0, 0, 0);
    l_Label.setFont(font);
    parent.add(l_Label);
    return l_Label;
  }
  private void createProgressMsg() {

    progressMsg = new LabelField();
    progressMsgFieldmanager = new HorizontalFieldManager(FIELD_HCENTER);
    progressMsgFieldmanager.setPadding(PADDING);
    progressMsg.setPadding(PADDING);
    progressMsgFieldmanager.add(progressMsg);
  }
  public void setProgressMsg(String msg) {

    progressMsg.setText(msg);

    try {
      add(progressMsgFieldmanager);
    } catch (IllegalStateException ex) {

    }
  }
  public UIExampleListStyleButtonFieldScreen() {

    super(NO_VERTICAL_SCROLL | USE_ALL_HEIGHT);

    setTitle("ListStyleButtonField Example");

    Bitmap caret = Bitmap.getBitmapResource("chevron_right_black_15x22.png");

    ListStyleButtonField one = new ListStyleButtonField("Music", caret);
    one.setChangeListener(this);
    add(one);

    ListStyleButtonField two = new ListStyleButtonField("Photos", caret);
    two.setChangeListener(this);
    add(two);

    ListStyleButtonField three = new ListStyleButtonField("Extras", caret);
    three.setChangeListener(this);
    add(three);

    ListStyleButtonField four = new ListStyleButtonField("Settings", caret);
    four.setChangeListener(this);
    add(four);

    ListStyleButtonField five = new ListStyleButtonField("Shuffle Songs", 0);
    five.setChangeListener(this);
    add(five);

    _explanation = new UIExampleScreen();
    _explanation.setTitle("ListStyleButtonField Explanation");

    LabelField explanationLabel =
        new LabelField(
            "The ListStyleButtonField looks like a list row, but is just a simple button. Good for use with a small finite set of elements.");
    explanationLabel.setPadding(5, 5, 5, 5);
    _explanation.add(explanationLabel);
  }
예제 #8
0
 public void fieldChanged(Field field, int context) {
   if (field == btnGrabar) {
     grabar();
   } else {
     if (field instanceof mkpyLabelEditField) {
       lblEstado.setText(
           ""
               + (((mkpyLabelEditField) field).getText().getMaxSize()
                   - ((mkpyLabelEditField) field)
                       .getText()
                       .getTextLength())); // + (txtZona.getTextLength() -
                                           // txtZona.getText().length()));
     }
   }
 }
예제 #9
0
 /**
  * Create a LabelField that spans the entire width of the container with gray text and a single
  * pixel gray border at the bottom.
  *
  * @param title
  * @return
  */
 public static LabelField createGroupLabel(String title) {
   LabelField titleField =
       new LabelField(title, LabelField.USE_ALL_WIDTH) {
         protected void paint(Graphics graphics) {
           graphics.setColor(COLOR_GROUP_LABEL_FOREGROUND);
           super.paint(graphics);
         }
       };
   Font font = titleField.getFont();
   titleField.setFont(font.derive(Font.BOLD, font.getHeight() - 3));
   titleField.setPadding(new XYEdges(0, 0, 4, 0));
   titleField.setBorder(
       BorderFactory.createSimpleBorder(
           new XYEdges(0, 0, 1, 0),
           new XYEdges(0, 0, COLOR_GROUP_LABEL_BORDER, 0),
           Border.STYLE_SOLID));
   titleField.setMargin(new XYEdges(0, 0, 4, 0));
   return titleField;
 }
  public PickScreen(int voteType) {
    super();
    this.voteType = voteType;

    VerticalFieldManager vertFieldManager =
        new VerticalFieldManager(
            VerticalFieldManager.USE_ALL_WIDTH | VerticalFieldManager.VERTICAL_SCROLLBAR) {
          // Override the paint method to draw the background image.
          public void paint(Graphics graphics) {
            graphics.setColor(Color.BLACK);
            graphics.fillRect(0, 0, this.getWidth(), this.getHeight());
            super.paint(graphics);
          }
        };
    ;

    try { // set up the smaller list font
      ff1 = FontFamily.forName("Verdana");
      font2 = ff1.getFont(Font.BOLD, 20);
    } catch (final ClassNotFoundException cnfe) {
    }

    Vector contList = GameData.getCurrentGame().getActiveContestants();

    Contestant[] contArray = new Contestant[contList.size()];
    contList.copyInto(contArray);
    ocfActiveContestant = new ObjectChoiceField(" Cast your " + voteType + " vote: ", contArray);
    User user = GameData.getCurrentGame().getCurrentUser();
    if (voteType == T_WEEKLY && user.getWeeklyPick() != null) {
      ocfActiveContestant.setSelectedIndex(user.getWeeklyPick());
    } else if (voteType == T_ULTIMATE && user.getUltimatePick() != null) {
      ocfActiveContestant.setSelectedIndex(user.getUltimatePick());
    }

    list = new RichList(vertFieldManager, true, 3, 0);

    // get all contestants for list
    contList = GameData.getCurrentGame().getAllContestants();
    for (int i = 0; i < contList.size(); i++) {
      Contestant cont = (Contestant) contList.elementAt(i);
      /* list contains labels so that the text colour can change */
      lblContName =
          new LabelField(cont.getFirstName() + " " + cont.getLastName(), LabelField.ELLIPSIS) {
            public void paint(Graphics g) {
              g.setColor(Color.WHITE);
              super.paint(g);
            }
          };
      lblContName.setFont(font2);

      labelContTribe =
          new LabelField(cont.getTribe(), LabelField.ELLIPSIS) {
            public void paint(Graphics g) {
              g.setColor(Color.WHITE);
              super.paint(g);
            }
          };
      lblContName.setFont(font2);

      String tempString = "";

      if (cont.isCastOff()) tempString = "Castoff";
      else tempString = "Active";

      labelTempStatus =
          new LabelField(tempString, LabelField.ELLIPSIS) {
            public void paint(Graphics g) {
              g.setColor(Color.WHITE);
              super.paint(g);
            }
          };
      lblContName.setFont(font2);
      Bitmap imgContestant = getImage(cont.getPicture());
      list.add(new Object[] {imgContestant, lblContName, labelContTribe, labelTempStatus});
    }

    HorizontalFieldManager horFieldManager =
        new HorizontalFieldManager(
            HorizontalFieldManager.USE_ALL_WIDTH | HorizontalFieldManager.FIELD_HCENTER) {
          // Override the paint method to draw the background image.
          public void paint(Graphics graphics) {
            graphics.setColor(Color.GREEN);
            graphics.fillRect(0, 0, this.getWidth(), this.getHeight());
            super.paint(graphics);
          }
        };
    ;

    String voted = "Vote";
    user = GameData.getCurrentGame().getCurrentUser();
    System.out.println(user.getWeeklyPick() + " " + this.voteType);
    if ((this.voteType == T_WEEKLY && user.getWeeklyPick() != null)
        || (this.voteType == T_ULTIMATE && user.getUltimatePick() != null)) voted = "Revote";
    btnVoted = new ButtonField(voted);
    btnVoted.setChangeListener(this);

    horFieldManager.add(btnVoted);
    horFieldManager.add(ocfActiveContestant);
    horFieldManager.setFont(font2);

    this.setTitle(horFieldManager);
    this.add(vertFieldManager);
    this.setStatus(Common.getToolbar("Log Out"));
    vertFieldManager.setFocus(); // THIS NEEDS TO BE HERE. APP CRASHES WITHOUT IT
  }
예제 #11
0
  public void runMain() {

    Bitmap img = imgstock.getHeader();
    BitmapFieldWithStatus bf =
        new BitmapFieldWithStatus(img, BitmapField.FIELD_HCENTER | BitmapField.USE_ALL_WIDTH, "");
    add(bf);
    Engine.getInstance().registerStatus(bf);
    try {
      MainListVerticalFieldManager mainManager = new MainListVerticalFieldManager();
      XYEdges edge =
          new XYEdges(5, 25 * Display.getWidth() / 480, 2, 25 * Display.getWidth() / 480);
      HorizontalFieldManager mainHorizontalManager =
          new HorizontalFieldManager(
              HorizontalFieldManager.FIELD_HCENTER
                  | HorizontalFieldManager.USE_ALL_WIDTH
                  | HorizontalFieldManager.FIELD_VCENTER);
      RadioButtonGroup rgrp = new RadioButtonGroup();

      // EditField

      // EditField
      searchTextField =
          new EditFieldwithFocus(
              "Search: ",
              topic,
              35,
              BasicEditField.FIELD_HCENTER | BasicEditField.FIELD_VCENTER,
              MyColor.FONT_SEARCH,
              MyColor.SEARCH_COLOR) {
            public void layout(int width, int height) {
              super.layout(getPreferredWidth(), getPreferredHeight());
              setExtent(getPreferredWidth(), getPreferredHeight());
            }

            public int getPreferredHeight() {
              return 25;
            }

            public int getPreferredWidth() {
              return 340 * Display.getWidth() / 480;
            }
          };
      // edit.setBorder(BorderFactory.createSimpleBorder(edge,Border.STYLE_TRANSPARENT));
      // add(edit);
      MyButtonField button = new MyButtonField("Share a file", ButtonField.ELLIPSIS);
      // stopButton.setBorder(BorderFactory.createSimpleBorder(edge,Border.STYLE_TRANSPARENT));
      button.setChangeListener(new ButtonListener(rgrp, 12));
      button.setMargin(edge);
      mainManager.add(button);
      //			searchTextField.setMargin(edge);
      mainHorizontalManager.add(searchTextField);
      mainHorizontalManager.add(searchBT);
      mainHorizontalManager.setMargin(edge);
      mainManager.add(mainHorizontalManager);
      // BitmapField bff = new BitmapField(img,
      // BitmapField.NON_FOCUSABLE);
      // mainManager.add(bff);
      LabelField topicLabel =
          new LabelFieldWithFullBG(
              "Document Sharing",
              MyColor.FONT_TOPIC,
              MyColor.FONT_TOPIC_COLOR,
              MyColor.TOPIC_BG,
              Const.LABEL_WIDTH);
      edge = new XYEdges(2, 25 * Display.getWidth() / 480, 2, 25 * Display.getWidth() / 480);
      topicLabel.setMargin(edge);

      mainManager.add(topicLabel);
      _list = new TrainingListField();
      mainManager.add(_list);
      pagingManager.setMargin(edge);
      mainManager.add(pagingManager);
      add(mainManager);
    } catch (Exception e) {
      System.out.println("" + e.toString());
    }
    // bf = new BitmapField(img, Field.FIELD_BOTTOM | Field.USE_ALL_HEIGHT);
    // bf.setBorder(BorderFactory.createSimpleBorder(edge,Border.STYLE_TRANSPARENT));
    // add(bf);

    addMenuItem(_mainMenuItem);
  }
  CitationScreen6(Citation _c) {
    c = _c;

    String cNumberString = Integer.toString(c.Number);
    /*
            CustomLabelField lf = new CustomLabelField("OREGON UNIFORM CITATION: #" + cNumberString, LabelField.ELLIPSIS | LabelField.USE_ALL_WIDTH);
            lf.setBackgroundColor(0x00194E84);
            lf.setTextColor(0x00ffffff);
            FontFamily fontFamily0[] = FontFamily.getFontFamilies();
            Font font = fontFamily0[1].getFont(FontFamily.CBTF_FONT, 14);
            lf.setFont(font);

            add(lf);
    */
    LabelField lf0 =
        new LabelField(
            "OREGON UNIFORM CITATION: #" + cNumberString,
            LabelField.ELLIPSIS | LabelField.USE_ALL_WIDTH | DrawStyle.HCENTER) {
          protected void paintBackground(net.rim.device.api.ui.Graphics g) {
            g.clear();
            g.getColor();
            g.setColor(Color.GREEN);
            g.fillRect(0, 0, Display.getWidth(), Display.getHeight());
            g.setColor(Color.WHITE);
          }
        };
    FontFamily fontFamily0[] = FontFamily.getFontFamilies();
    Font font0 = fontFamily0[1].getFont(FontFamily.CBTF_FONT, 14);
    lf0.setFont(font0);
    setTitle(lf0);
    add(new SeparatorField());
    /*
          CustomLabelField lf1 = new CustomLabelField("************* INCIDENT ATTRIBUTES **************", LabelField.ELLIPSIS | LabelField.USE_ALL_WIDTH);
          lf1.setBackgroundColor(Color.LIGHTGREY);
          lf1.setTextColor(Color.BLUE);

          FontFamily fontFamily[] = FontFamily.getFontFamilies();
          Font font1 = fontFamily[1].getFont(FontFamily.CBTF_FONT, 14);
          lf1.setFont(font1);
          add(lf1);
    */
    LabelField lf3 =
        new LabelField(
            "********* INCIDENT ATTRIBUTES **********",
            LabelField.ELLIPSIS | LabelField.USE_ALL_WIDTH | DrawStyle.HCENTER) {
          protected void paintBackground(net.rim.device.api.ui.Graphics g) {
            g.clear();
            g.getColor();
            g.setColor(Color.GREEN);
            g.fillRect(0, 0, Display.getWidth(), Display.getHeight());
            g.setColor(Color.WHITE);
          }
        };
    FontFamily fontFamily3[] = FontFamily.getFontFamilies();
    Font font3 = fontFamily3[1].getFont(FontFamily.CBTF_FONT, 14);
    lf3.setFont(font0);
    add(lf3);
    add(new SeparatorField());

    // --------------

    // CheckboxField
    field_accident = new CheckboxField("Accident", false);
    add(field_accident);

    // CheckboxField
    field_radar = new CheckboxField("Radar", false);
    add(field_radar);

    // CheckboxField
    field_jail_booking = new CheckboxField("Jail Booking", false);
    add(field_jail_booking);

    // CheckboxField
    field_paced = new CheckboxField("Paced", false);
    add(field_paced);

    // CheckboxField
    field_school_zone = new CheckboxField("School Zone", false);
    add(field_school_zone);

    // CheckboxField
    field_alcohol = new CheckboxField("Alcohol", false);
    add(field_alcohol);

    add(new SeparatorField());

    // EditField
    field_vbfi = new EditField("VBFI: ", "");
    add(field_vbfi);

    // ObjectChoiceField
    String choicestrs1[] = {
      "5MPH", "10MPH", "15MPH", "20MPH", "25MPH", "30MPH", "35MPH", "40MPH", "45MPH", "50MPH",
      "55MPH", "60MPH", "65MPH", "70MPH", "75MPH", "80MPH"
    };
    field_speed_limit = new ObjectChoiceField("Speed Limit: ", choicestrs1, 0);
    add(field_speed_limit);

    // EditField
    field_alleged_speed = new EditField("Alleged Speed: ", "");
    add(field_alleged_speed);

    add(new SeparatorField());

    // ButtonField row - set all buttons at the bottom row of the form
    HorizontalFieldManager navButtonManager = new HorizontalFieldManager();

    // ButtonField
    ButtonField btn_prev;
    btn_prev = new ButtonField("Prev", ButtonField.CONSUME_CLICK);
    btn_prev.setChangeListener(new ButtonListener6(this, c));
    navButtonManager.add(btn_prev);

    ButtonField btn_next;
    btn_next = new ButtonField("Next", ButtonField.CONSUME_CLICK);
    btn_next.setChangeListener(new ButtonListener6(this, c));
    navButtonManager.add(btn_next);

    add(navButtonManager);

    add(new SeparatorField());

    addMenuItem(saveItem6);
    addMenuItem(getItem6);

    restoreUIFieldsFromCitation();
  }
예제 #13
0
  public CambiarPuntosMap() {

    if (Display.getWidth() == 320) {

      getMainManager()
          .setBackground(
              BackgroundFactory.createBitmapBackground(
                  Bitmap.getBitmapResource("background_320.png")));
      tFuente = 17;
      tFuente2 = 20;
      veinticinco = 10;
      veinte = 10;
      trecientoscuarentaysiete = 170;
      setenta = 35;
      hr = Bitmap.getBitmapResource("hr_line_3.png");
      leftHr = 10;
      btnMapa = Bitmap.getBitmapResource("btnMapa_320.png");
      btnMapa1 = Bitmap.getBitmapResource("btnMapa1_320.png");
      btnAgregarMapa = Bitmap.getBitmapResource("btnAgregarMapa_320.png");
      btnAgregarMapa1 = Bitmap.getBitmapResource("btnAgregarMapa1_320.png");
    }
    if (Display.getWidth() == 360) {

      getMainManager()
          .setBackground(
              BackgroundFactory.createBitmapBackground(
                  Bitmap.getBitmapResource("background_360.png")));
      tFuente = 20;
      tFuente2 = 23;
      veinticinco = 10;
      veinte = 10;
      trecientoscuarentaysiete = 403;
      setenta = 35;
      hr = Bitmap.getBitmapResource("hr_line_3.png");
      leftHr = 30;
      btnMapa = Bitmap.getBitmapResource("btnMapa_320.png");
      btnMapa1 = Bitmap.getBitmapResource("btnMapa1_320.png");
      btnAgregarMapa = Bitmap.getBitmapResource("btnAgregarMapa_320.png");
      btnAgregarMapa1 = Bitmap.getBitmapResource("btnAgregarMapa1_320.png");
    }
    if (Display.getWidth() == 480) {

      getMainManager()
          .setBackground(
              BackgroundFactory.createBitmapBackground(
                  Bitmap.getBitmapResource("background_480.png")));
      tFuente = 20;
      tFuente2 = 23;
      veinticinco = 10;
      veinte = 10;
      trecientoscuarentaysiete = 291;
      setenta = 35;
      hr = Bitmap.getBitmapResource("hr_line.png");
      leftHr = 0;
      btnMapa = Bitmap.getBitmapResource("btnMapa_320.png");
      btnMapa1 = Bitmap.getBitmapResource("btnMapa1_320.png");
      btnAgregarMapa = Bitmap.getBitmapResource("btnAgregarMapa_320.png");
      btnAgregarMapa1 = Bitmap.getBitmapResource("btnAgregarMapa1_320.png");
    }
    if (Display.getWidth() == 640) {

      getMainManager()
          .setBackground(
              BackgroundFactory.createBitmapBackground(Bitmap.getBitmapResource("background.png")));

      tFuente = 35;
      tFuente2 = 40;
    }

    try {

      FontFamily ffFont1 = FontFamily.forName("Arial");
      fLite = ffFont1.getFont(Font.SANS_SERIF_STYLE, tFuente);
      fTitle = ffFont1.getFont(Font.SANS_SERIF_STYLE, tFuente2);

      // hr = Bitmap.getBitmapResource("hr_line.png");

      // getMainManager().setBackground(BackgroundFactory.createBitmapBackground(Bitmap.getBitmapResource("background.png")));

      VerticalFieldManager logoHfm = new VerticalFieldManager(VerticalFieldManager.FIELD_HCENTER);
      logoHfm.setBackground(
          BackgroundFactory.createLinearGradientBackground(0xe68241, 0xe68241, 0xd16f2f, 0xd16f2f));
      logoHfm.setMargin(0, 0, 0, 0);

      ColorRichText emailCrt =
          new ColorRichText(
              Strings.CHANGECONFIG,
              0xffffff,
              RichTextField.FIELD_HCENTER | RichTextField.TEXT_ALIGN_HCENTER);
      emailCrt.setFont(fTitle);
      emailCrt.setMargin(veinticinco, 0, veinticinco, 0);

      logoHfm.add(emailCrt);

      VerticalField footerLogoHfm =
          new VerticalField(Display.getWidth(), veinte, VerticalFieldManager.FIELD_HCENTER);
      footerLogoHfm.setBackground(
          BackgroundFactory.createLinearGradientBackground(0x9cbe4f, 0x7a9b3c, 0x7a9b3c, 0x9cbe4f));

      ColorRichText introCrt =
          new ColorRichText(
              "Elige tus puntos favoritos",
              0xffffff,
              RichTextField.FIELD_HCENTER | RichTextField.TEXT_ALIGN_HCENTER);
      introCrt.setFont(fTitle);
      introCrt.setMargin(25, 0, 25, 0);
      footerLogoHfm.add(introCrt);

      logoHfm.add(footerLogoHfm);

      add(logoHfm);

      VerticalField allContentFiltro =
          new VerticalField(
              Display.getWidth(),
              trecientoscuarentaysiete,
              HorizontalField.FIELD_HCENTER
                  | VerticalField.VERTICAL_SCROLL
                  | VerticalField.VERTICAL_SCROLLBAR);

      Object[] municipioO = new Object[] {"one", "two", "three"};
      ObjectChoiceField municipioOcf = new FullWidthChoiceField();
      municipioOcf.setChoices(municipioO);
      municipioOcf.setMargin(0, 70, 0, 70);

      VerticalFieldManager municipioVfm =
          new VerticalFieldManager(
              VerticalFieldManager.FIELD_HCENTER | HorizontalFieldManager.FIELD_HCENTER);

      LabelField municipioLf = new LabelField("Municipio", LabelField.FIELD_HCENTER);
      municipioLf.setFont(fLite);
      municipioLf.setMargin(15, 0, 5, 0);

      municipioVfm.add(municipioLf); // |/ DrawStyle.HCENTER));
      municipioVfm.add(municipioOcf);

      hrBf = new BitmapField(hr);
      hrBf.setMargin(20, 0, 0, leftHr);
      municipioVfm.add(hrBf);

      allContentFiltro.add(municipioVfm);

      /**/
      Object[] establecimientoO = new Object[] {"one", "two", "three"};
      ObjectChoiceField establecimientoOcf = new FullWidthChoiceField();
      establecimientoOcf.setChoices(establecimientoO);
      establecimientoOcf.setMargin(0, 70, 0, 70);

      VerticalFieldManager establecimientoVfm =
          new VerticalFieldManager(
              VerticalFieldManager.FIELD_HCENTER | HorizontalFieldManager.FIELD_HCENTER);

      LabelField establecimientoLf = new LabelField("Establecimiento", LabelField.FIELD_HCENTER);
      establecimientoLf.setFont(fLite);
      establecimientoLf.setMargin(15, 0, 5, 0);

      establecimientoVfm.add(establecimientoLf); // |/ DrawStyle.HCENTER));
      establecimientoVfm.add(establecimientoOcf);

      hrBf = new BitmapField(hr);
      hrBf.setMargin(20, 0, 0, leftHr);
      establecimientoVfm.add(hrBf);

      allContentFiltro.add(establecimientoVfm);

      HorizontalFieldManager botonesHfc =
          new HorizontalFieldManager(HorizontalFieldManager.FIELD_HCENTER);
      // botonesHfc.setMargin(0, 50, 0, 0);

      BitmapButtonField btnMapaUser = new BitmapButtonField(btnMapa, btnMapa1, Field.FIELD_HCENTER);
      btnMapaUser.setChangeListener(
          new FieldChangeListener() {
            public void fieldChanged(Field field, int context) {
              UiApplication.getUiApplication().pushScreen(new ListaEstablecimiebtosMap());
            }
          });
      btnMapaUser.setMargin(20, 10, 0, 0);

      BitmapButtonField btnAgregarMapaUser =
          new BitmapButtonField(btnAgregarMapa, btnAgregarMapa1, Field.FIELD_HCENTER);
      btnAgregarMapaUser.setChangeListener(
          new FieldChangeListener() {
            public void fieldChanged(Field field, int context) {
              UiApplication.getUiApplication().pushScreen(new ListaEstablecimiebtosMap());
            }
          });
      btnAgregarMapaUser.setMargin(20, 10, 0, 0);

      botonesHfc.add(btnMapaUser);
      botonesHfc.add(btnAgregarMapaUser);

      allContentFiltro.add(botonesHfc);

      add(allContentFiltro);

    } catch (Exception e) {
      // TODO: handle exception
      System.out.println(e.getMessage());
      add(new RichTextField(e.getMessage()));
    }
  }
예제 #14
0
  public FirstScreen(final Hashtable hashtable, String[] moduleVisible) {

    userName = (String) hashtable.get("stringval1");

    welcomeTitleDisplay();

    add(horizontalWelcomeLabel);

    pUpdatedBy = (String) hashtable.get("stringval37");

    HorizontalFieldManager hfm = new HorizontalFieldManager(FIELD_HCENTER);

    VerticalFieldManager vfm1 = new VerticalFieldManager(FIELD_HCENTER);
    VerticalFieldManager vfm2 = new VerticalFieldManager(FIELD_HCENTER);

    vfm1.setMargin(30, 50, 10, 30);
    vfm2.setMargin(30, 30, 10, 50);

    btnCar =
        new BitmapButtonField(carUnclick, carClick, FIELD_HCENTER) {
          protected boolean navigationClick(int status, int time) {
            Controller.showScreen(new StartupScreen(hashtable, 0));
            return true;
          }
        };
    // btnCar.setMargin(30, 0, 0, 30);

    LabelField l2 = new LabelField("iMotor", FIELD_HCENTER);
    // l2.setMargin(10, 0, 0, 0);
    l2.setFont(Constants.fontBold6);

    btnAeroplane =
        new BitmapButtonField(travelUnclick, travelClick, FIELD_HCENTER) {
          protected boolean navigationClick(int status, int time) {
            Controller.showScreen(new StartupScreen(hashtable, 1));
            return true;
          }
        };
    // btnAeroplane.setMargin(30, 0, 0, 30);

    LabelField l3 = new LabelField("iTravel", FIELD_HCENTER);
    // l3.setMargin(10, 0, 0, 0);
    l3.setFont(Constants.fontBold6);

    vfm1.add(btnCar);
    vfm1.add(l2);
    vfm2.add(btnAeroplane);
    vfm2.add(l3);

    for (int i = 0; i < moduleVisible.length; i++) {
      if (moduleVisible[i].equals("11")) {
        Constants.iMotorModuleVisible = true;
      } else if (moduleVisible[i].equals("12")) {
        Constants.iTravelModuleVisible = true;
      }
    }

    if (Constants.iMotorModuleVisible == true) {
      hfm.add(vfm1);
    }
    if (Constants.iTravelModuleVisible) {
      hfm.add(vfm2);
    }
    add(hfm);
  }
 public void layout(int width, int height) {
   // TODO Auto-generated method stub
   super.layout(width, height);
 }
 public void paint(Graphics graphics) {
   graphics.setColor(color);
   super.paint(graphics);
 }
예제 #17
0
 public void focusChanged(Field field, int eventType) {
   lblEstado.setText("");
 }
예제 #18
0
 public void logChanged(String text) {
   log.setText(text);
 }