Esempio n. 1
0
  private void setupScreen() {
    this.deleteAll();
    addTag = false;
    if (osmway == null) {
      this.append(new StringItem("No Data available", "..."));
      return;
    }
    this.append(new StringItem("Edited ", null));
    this.append(bearingArrow());
    this.append(new StringItem("    at:", osmway.getEditTime()));
    this.append(new StringItem("    by: ", osmway.getEditor()));

    Hashtable tags = osmway.getTags();
    if (tags == null) return;
    Enumeration keysEn = tags.keys();
    while (keysEn.hasMoreElements()) {
      String key = (String) keysEn.nextElement();
      Item i = new StringItem(key, (String) tags.get(key));
      i.addCommand(EDIT_CMD);
      i.addCommand(REMOVE_CMD);
      i.setItemCommandListener(this);
      this.append(i);
    }
  }
Esempio n. 2
0
 protected void setupScreen() {
   try {
     this.deleteAll();
     addTag = false;
     if (osmentity == null) {
       this.append(
           new StringItem(
               Locale.get("guiosmentitydisplay.NoDataAvailable") /*No Data available*/, "..."));
       return;
     }
     Hashtable tags = osmentity.getTags();
     if (tags == null) return;
     Enumeration keysEn = tags.keys();
     while (keysEn.hasMoreElements()) {
       String key = (String) keysEn.nextElement();
       Item i = new StringItem(key, (String) tags.get(key));
       i.addCommand(EDIT_CMD);
       i.addCommand(REMOVE_CMD);
       i.setItemCommandListener(this);
       // #style formItem
       this.append(i);
     }
     if (osmentity.getVersion() > 0) {
       // #style formItem
       this.append(new StringItem(Locale.get("guiosmentitydisplay.Edited") /*Edited */, null));
       // #style formItem
       this.append(
           new StringItem(
               Locale.get("guiosmentitydisplay.at") /*    at:*/, osmentity.getEditTime()));
       // #style formItem
       this.append(
           new StringItem(
               Locale.get("guiosmentitydisplay.by") /*    by:*/, osmentity.getEditor()));
       // #style formItem
       this.append(
           new StringItem(
               Locale.get("guiosmentitydisplay.ver") /*    ver:*/,
               Integer.toString(osmentity.getVersion())));
     }
     // #if polish.android
     ViewItem createButton =
         new SaveButton(
             Locale.get("guiosmentitydisplay.CreateChangeset") /*Create changeset*/,
             this,
             (Displayable) this,
             CREATE_CHANGE_CMD);
     ViewItem closeButton =
         new SaveButton(
             Locale.get("guiosmentitydisplay.CloseChangeset") /*Close changeset*/,
             this,
             (Displayable) this,
             CLOSE_CHANGE_CMD);
     this.append(createButton);
     this.append(closeButton);
     AndroidDisplay ad = AndroidDisplay.getDisplay(GpsMid.getInstance());
     ad.setOnKeyListener(
         new OnKeyListener() {
           public boolean onKey(View v, int keyCode, KeyEvent event) {
             if (event.getAction() == KeyEvent.ACTION_DOWN) {
               // check if the right key was pressed
               if (keyCode == KeyEvent.KEYCODE_BACK) {
                 backPressed();
                 return true;
               }
             }
             return false;
           }
         });
     // #endif
   } catch (Exception e) {
     logger.exception(
         Locale.get(
             "guiosmentitydisplay.InitialisingEntityTagScreenFailed") /*Initialising entity tag screen failed: */,
         e);
   }
 }