Ignore:
Timestamp:
2016-11-26T21:28:20+01:00 (7 years ago)
Author:
Don-vip
Message:

refactor conflict classes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/conflict/pair/relation/RelationMemberListMergeModel.java

    r8510 r11318  
    44import static org.openstreetmap.josm.tools.I18n.tr;
    55
    6 import java.util.List;
    76import java.util.Map;
    87
     
    109
    1110import org.openstreetmap.josm.command.conflict.RelationMemberConflictResolverCommand;
     11import org.openstreetmap.josm.data.conflict.Conflict;
    1212import org.openstreetmap.josm.data.osm.OsmPrimitive;
    1313import org.openstreetmap.josm.data.osm.PrimitiveId;
     
    1717import org.openstreetmap.josm.gui.conflict.pair.ListRole;
    1818import org.openstreetmap.josm.tools.CheckParameterUtil;
     19
    1920/**
    2021 * The model for merging two lists of relation members
    21  *
     22 * @since 1631
    2223 */
    23 public class RelationMemberListMergeModel extends ListMergeModel<RelationMember> {
     24public class RelationMemberListMergeModel extends ListMergeModel<RelationMember, RelationMemberConflictResolverCommand> {
    2425
    2526    @Override
     
    9697    }
    9798
    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");
    111102        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());
    115105    }
    116106}
Note: See TracChangeset for help on using the changeset viewer.