Changeset 8510 in josm for trunk/src/org/openstreetmap/josm/gui/tagging/TagEditorModel.java
- Timestamp:
- 2015-06-20T23:42:21+02:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/tagging/TagEditorModel.java
r8444 r8510 36 36 37 37 /** the list holding the tags */ 38 protected final transient List<TagModel> tags = new ArrayList<>();38 protected final transient List<TagModel> tags = new ArrayList<>(); 39 39 40 40 /** indicates whether the model is dirty */ … … 147 147 switch(col) { 148 148 case 0: 149 updateTagName(tag, (String) value);149 updateTagName(tag, (String) value); 150 150 break; 151 151 case 1: 152 String v = (String) value;152 String v = (String) value; 153 153 if (tag.getValueCount() > 1 && !v.isEmpty()) { 154 154 updateTagValue(tag, v); … … 290 290 Iterator<TagModel> it = tags.iterator(); 291 291 boolean changed = false; 292 while (it.hasNext()) {292 while (it.hasNext()) { 293 293 TagModel tm = it.next(); 294 294 if (tm.getName().equals(name)) { … … 352 352 for (String key : primitive.keySet()) { 353 353 String value = primitive.get(key); 354 this.tags.add(new TagModel(key, value));354 this.tags.add(new TagModel(key, value)); 355 355 } 356 356 TagModel tag = new TagModel(); … … 366 366 * @param tags the tags of an OSM primitive 367 367 */ 368 public void initFromTags(Map<String, String> tags) {368 public void initFromTags(Map<String, String> tags) { 369 369 this.tags.clear(); 370 370 for (Entry<String, String> entry : tags.entrySet()) { … … 385 385 public void initFromTags(TagCollection tags) { 386 386 this.tags.clear(); 387 if (tags == null) {387 if (tags == null) { 388 388 setDirty(false); 389 389 return; … … 391 391 for (String key : tags.getKeys()) { 392 392 String value = tags.getJoinedValues(key); 393 this.tags.add(new TagModel(key, value));393 this.tags.add(new TagModel(key, value)); 394 394 } 395 395 sort(); … … 407 407 */ 408 408 public void applyToPrimitive(Tagged primitive) { 409 Map<String, String> tags = primitive.getKeys();409 Map<String, String> tags = primitive.getKeys(); 410 410 applyToTags(tags, false); 411 411 primitive.setKeys(tags); … … 436 436 } 437 437 438 public Map<String, String> getTags() {438 public Map<String, String> getTags() { 439 439 return getTags(false); 440 440 } 441 441 442 public Map<String, String> getTags(boolean keepEmpty) {443 Map<String, String> tags = new HashMap<>();442 public Map<String, String> getTags(boolean keepEmpty) { 443 Map<String, String> tags = new HashMap<>(); 444 444 applyToTags(tags, keepEmpty); 445 445 return tags; … … 494 494 if (!currentkeys.contains(oldkey)) { 495 495 ChangePropertyCommand deleteCommand = 496 new ChangePropertyCommand(primitive, oldkey,null);496 new ChangePropertyCommand(primitive, oldkey, null); 497 497 commands.add(deleteCommand); 498 498 } … … 581 581 582 582 Map<String, TagModel> modelTags = new HashMap<>(); 583 for (int i =0; i<getRowCount(); i++) {583 for (int i = 0; i < getRowCount(); i++) { 584 584 TagModel tagModel = get(i); 585 585 modelTags.put(tagModel.getName(), tagModel); … … 627 627 rowSelectionModel.setValueIsAdjusting(true); 628 628 colSelectionModel.setValueIsAdjusting(true); 629 if (rowMin >= 0 && rowMax >= 0) {629 if (rowMin >= 0 && rowMax >= 0) { 630 630 rowSelectionModel.setSelectionInterval(rowMin, rowMax); 631 631 } 632 if (colMin >= 0 && colMax >= 0) {632 if (colMin >= 0 && colMax >= 0) { 633 633 colSelectionModel.setSelectionInterval(colMin, colMax); 634 634 }
Note:
See TracChangeset
for help on using the changeset viewer.