Ignore:
Timestamp:
2009-09-27T16:29:21+02:00 (17 years ago)
Author:
Gubaer
Message:

fixed #3249: Resolve conflicts between invisible and deleted primitives automatically

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/command/ConflictResolveCommand.java

    r2163 r2198  
    1212
    1313/**
    14  * This is the common basse class for {@see Command}s which manipulate {@see Conflict}s in
     14 * This is the common base class for {@see Command}s which manipulate {@see Conflict}s in
    1515 * addition to {@see OsmPrimitive}s.
    1616 *
    1717 * A ConflictResolverCommand can remember a collection of conflicts it resolves. Upon undoing
    18  * it reconstitutes these conflicts.
     18 * it reconstitutes them.
    1919 *
    2020 */
     
    3030    }
    3131
     32    public ConflictResolveCommand(OsmDataLayer layer) {
     33        super(layer);
     34        resolvedConflicts = new ConflictCollection();
     35    }
     36
    3237    /**
    3338     * remembers a conflict in the internal list of remembered conflicts
     
    3540     * @param c the remembered conflict
    3641     */
    37     protected void rememberConflict(Conflict c) {
     42    protected void rememberConflict(Conflict<?> c) {
    3843        if (! resolvedConflicts.hasConflictForMy(c.getMy())) {
    3944            resolvedConflicts.add(c);
     
    4853    protected void reconstituteConflicts() {
    4954        OsmDataLayer editLayer = getLayer();
    50         for(Conflict c : resolvedConflicts) {
     55        for(Conflict<?> c : resolvedConflicts) {
    5156            if (!editLayer.getConflicts().hasConflictForMy(c.getMy())) {
    5257                editLayer.getConflicts().add(c);
     
    6065
    6166        if (! Main.map.mapView.hasLayer(getLayer())) {
    62             logger.warning(tr("Can't undo command ''{0}'' because layer ''{1}'' is not present any more",
     67            logger.warning(tr("Can''t undo command ''{0}'' because layer ''{1}'' is not present any more",
    6368                    this.toString(),
    6469                    getLayer().toString()
     
    7075        reconstituteConflicts();
    7176    }
    72 
    73 
    74 
    7577}
Note: See TracChangeset for help on using the changeset viewer.