Changeset 11318 in josm for trunk/src/org/openstreetmap/josm/gui/conflict/pair/relation/RelationMemberListMergeModel.java
- Timestamp:
- 2016-11-26T21:28:20+01:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/conflict/pair/relation/RelationMemberListMergeModel.java
r8510 r11318 4 4 import static org.openstreetmap.josm.tools.I18n.tr; 5 5 6 import java.util.List;7 6 import java.util.Map; 8 7 … … 10 9 11 10 import org.openstreetmap.josm.command.conflict.RelationMemberConflictResolverCommand; 11 import org.openstreetmap.josm.data.conflict.Conflict; 12 12 import org.openstreetmap.josm.data.osm.OsmPrimitive; 13 13 import org.openstreetmap.josm.data.osm.PrimitiveId; … … 17 17 import org.openstreetmap.josm.gui.conflict.pair.ListRole; 18 18 import org.openstreetmap.josm.tools.CheckParameterUtil; 19 19 20 /** 20 21 * The model for merging two lists of relation members 21 * 22 * @since 1631 22 23 */ 23 public class RelationMemberListMergeModel extends ListMergeModel<RelationMember > {24 public class RelationMemberListMergeModel extends ListMergeModel<RelationMember, RelationMemberConflictResolverCommand> { 24 25 25 26 @Override … … 96 97 } 97 98 98 /** 99 * Builds the command to resolve conflicts in the node list of a way 100 * 101 * @param my my relation. Must not be null. 102 * @param their their relation. Must not be null 103 * @return the command 104 * @throws IllegalArgumentException if my is null 105 * @throws IllegalArgumentException if their is null 106 * @throws IllegalStateException if the merge is not yet frozen 107 */ 108 public RelationMemberConflictResolverCommand buildResolveCommand(Relation my, Relation their) { 109 CheckParameterUtil.ensureParameterNotNull(my, "my"); 110 CheckParameterUtil.ensureParameterNotNull(their, "their"); 99 @Override 100 public RelationMemberConflictResolverCommand buildResolveCommand(Conflict<? extends OsmPrimitive> conflict) { 101 CheckParameterUtil.ensureParameterNotNull(conflict, "conflict"); 111 102 if (!isFrozen()) 112 throw new IllegalArgumentException(tr("Merged nodes not frozen yet. Cannot build resolution command")); 113 List<RelationMember> entries = getMergedEntries(); 114 return new RelationMemberConflictResolverCommand(my, their, entries); 103 throw new IllegalArgumentException(tr("Merged members not frozen yet. Cannot build resolution command")); 104 return new RelationMemberConflictResolverCommand(conflict, getMergedEntries()); 115 105 } 116 106 }
Note:
See TracChangeset
for help on using the changeset viewer.