コード例 #1
0
 protected List<Command> buildTagChangeCommand(OsmPrimitive primitive, TagCollection tc) {
   List<Command> cmds = new LinkedList<>();
   for (String key : tc.getKeys()) {
     if (tc.hasUniqueEmptyValue(key)) {
       if (primitive.get(key) != null) {
         cmds.add(new ChangePropertyCommand(primitive, key, null));
       }
     } else {
       String value = tc.getJoinedValues(key);
       if (!value.equals(primitive.get(key))) {
         cmds.add(new ChangePropertyCommand(primitive, key, value));
       }
     }
   }
   return cmds;
 }
コード例 #2
0
 /**
  * Replies the current tag value for the tag <tt>restriction</tt>. The empty tag, if there isn't a
  * tag <tt>restriction</tt>.
  *
  * @return the tag value
  */
 public String getRestrictionTagValue() {
   TagCollection tags = tagEditorModel.getTagCollection();
   if (!tags.hasTagsFor("restriction")) return "";
   return tags.getJoinedValues("restriction");
 }