Changeset 1815 in josm
- Timestamp:
- 2009-07-19T21:35:34+02:00 (15 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/dialogs
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/HistoryDialog.java
r1814 r1815 288 288 public void refresh() { 289 289 data.clear(); 290 if (Main.main.getCurrentDataSet() == null) 291 return; 290 292 for (OsmPrimitive primitive: Main.main.getCurrentDataSet().getSelected()) { 291 293 if (primitive.id == 0) { … … 454 456 455 457 public void selectionChanged(Collection<? extends OsmPrimitive> newSelection) { 456 setEnabled(Main.main.getCurrentDataSet().getSelected().size() > 0); 458 if (Main.main.getCurrentDataSet() == null) { 459 setEnabled(false); 460 } else { 461 setEnabled(Main.main.getCurrentDataSet().getSelected().size() > 0); 462 } 457 463 458 464 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/PropertiesDialog.java
r1814 r1815 792 792 793 793 Map<Relation, Collection<RelationMember>> roles = new HashMap<Relation, Collection<RelationMember>>(); 794 for (Relation r : Main.main.getCurrentDataSet().relations) { 795 if (!r.deleted && !r.incomplete) { 796 for (RelationMember m : r.members) { 797 if (newSelection.contains(m.member)) { 798 Collection<RelationMember> value = roles.get(r); 799 if (value == null) { 800 value = new HashSet<RelationMember>(); 801 roles.put(r, value); 794 if (Main.main.getCurrentDataSet() != null) { 795 for (Relation r : Main.main.getCurrentDataSet().relations) { 796 if (!r.deleted && !r.incomplete) { 797 for (RelationMember m : r.members) { 798 if (newSelection.contains(m.member)) { 799 Collection<RelationMember> value = roles.get(r); 800 if (value == null) { 801 value = new HashSet<RelationMember>(); 802 roles.put(r, value); 803 } 804 value.add(m); 802 805 } 803 value.add(m); 804 } 805 } 806 } 807 } 808 806 } 807 } 808 } 809 } 809 810 for (Entry<Relation, Collection<RelationMember>> e : roles.entrySet()) { 810 811 membershipData.addRow(new Object[]{e.getKey(), e.getValue()});
Note:
See TracChangeset
for help on using the changeset viewer.