Changeset 16549 in josm for trunk/src/org
- Timestamp:
- 2020-06-07T12:37:32+02:00 (4 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/dialogs/properties
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java
r16441 r16549 17 17 import java.util.Arrays; 18 18 import java.util.Collection; 19 import java.util.Collections; 19 20 import java.util.EnumSet; 20 21 import java.util.HashMap; … … 23 24 import java.util.Map; 24 25 import java.util.Map.Entry; 25 import java.util.Optional;26 26 import java.util.Set; 27 27 import java.util.TreeMap; … … 673 673 if (ref instanceof IRelation && !ref.isIncomplete() && !ref.isDeleted()) { 674 674 IRelation<?> r = (IRelation<?>) ref; 675 MemberInfo mi = Optional.ofNullable(roles.get(r)).orElseGet(() -> new MemberInfo(newSel)); 676 roles.put(r, mi); 675 MemberInfo mi = roles.computeIfAbsent(r, ignore -> new MemberInfo(newSel)); 677 676 int i = 1; 678 677 for (IRelationMember<?> m : r.getMembers()) { … … 975 974 } else if (e.getSource() == membershipTable) { 976 975 int row = membershipTable.rowAtPoint(e.getPoint()); 977 if (row > -1) { 976 int col = membershipTable.columnAtPoint(e.getPoint()); 977 if (row > -1 && col == 1) { 978 final Relation relation = (Relation) membershipData.getValueAt(row, 0); 979 final MemberInfo memberInfo = (MemberInfo) membershipData.getValueAt(row, 1); 980 RelationRoleEditor.editRole(relation, memberInfo); 981 } else if (row > -1) { 978 982 editMembership(row); 979 983 } … … 1024 1028 } 1025 1029 return Utils.shortenString(positionString, 20); 1030 } 1031 1032 List<IRelationMember<?>> getRole() { 1033 return Collections.unmodifiableList(role); 1026 1034 } 1027 1035
Note:
See TracChangeset
for help on using the changeset viewer.