- Timestamp:
- 2008-04-26T01:23:21+02:00 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/PropertiesDialog.java
r611 r621 47 47 import org.openstreetmap.josm.Main; 48 48 import org.openstreetmap.josm.command.ChangePropertyCommand; 49 import org.openstreetmap.josm.command.Command; 49 50 import org.openstreetmap.josm.command.SequenceCommand; 50 51 import org.openstreetmap.josm.data.SelectionChangedListener; … … 203 204 204 205 String value = values.getEditor().getItem().toString(); 205 if (value.equals(tr("<different>")))206 return;207 206 if (value.equals("")) 208 207 value = null; // delete the key … … 215 214 Main.main.undoRedo.add(new ChangePropertyCommand(sel, newkey, value)); 216 215 else { 217 Main.main.undoRedo.add(new SequenceCommand(trn("Change properties of {0} object", "Change properties of {0} objects", sel.size(), sel.size()), 218 new ChangePropertyCommand(sel, key, null), 219 new ChangePropertyCommand(sel, newkey, value))); 216 Collection<Command> commands=new Vector<Command>(); 217 commands.add(new ChangePropertyCommand(sel, key, null)); 218 if (value.equals(tr("<different>"))) { 219 HashMap<String, Vector<OsmPrimitive>> map=new HashMap<String, Vector<OsmPrimitive>>(); 220 for (OsmPrimitive osm: sel) { 221 String val=osm.keys.get(key); 222 if (map.containsKey(val)) { 223 map.get(val).add(osm); 224 } else { 225 Vector<OsmPrimitive> v = new Vector<OsmPrimitive>(); 226 v.add(osm); 227 map.put(val, v); 228 } 229 } 230 for (Entry<String, Vector<OsmPrimitive>> e: map.entrySet()) { 231 commands.add(new ChangePropertyCommand(e.getValue(), newkey, e.getKey())); 232 } 233 } else { 234 commands.add(new ChangePropertyCommand(sel, newkey, value)); 235 } 236 Main.main.undoRedo.add(new SequenceCommand(trn("Change properties of {0} objects", "Change properties of {0} objects", sel.size(), sel.size()), commands)); 220 237 } 221 238 … … 555 572 int count=0; 556 573 for (Entry<String, Integer> e1: e.getValue().entrySet()) { 557 // System.out.println(e.getKey()+" Entry "+e1.getKey()+" value "+e1.getValue());558 574 count+=e1.getValue(); 559 575 }
Note:
See TracChangeset
for help on using the changeset viewer.