Ignore:
Timestamp:
2010-07-03T22:08:57+02:00 (14 years ago)
Author:
stoecker
Message:

fix #5182 - Conflict system simplification - patch by Upliner

File:
1 edited

Legend:

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

    r3083 r3362  
    2626import org.openstreetmap.josm.gui.conflict.pair.nodes.NodeListMergeModel;
    2727import org.openstreetmap.josm.gui.conflict.pair.nodes.NodeListMerger;
    28 import org.openstreetmap.josm.gui.conflict.pair.properties.OperationCancelledException;
    2928import org.openstreetmap.josm.gui.conflict.pair.properties.PropertiesMergeModel;
    3029import org.openstreetmap.josm.gui.conflict.pair.properties.PropertiesMerger;
     
    235234        this.conflict = conflict;
    236235        propertiesMerger.populate(conflict);
    237         if (propertiesMerger.getModel().hasVisibleStateConflict()) {
    238             tabbedPane.setEnabledAt(1, false);
    239             tabbedPane.setEnabledAt(2, false);
    240             tabbedPane.setEnabledAt(3, false);
    241             return;
    242         }
     236
    243237        tabbedPane.setEnabledAt(0, true);
    244238        tagMerger.populate(conflict);
     
    270264     * @return the resolution command
    271265     */
    272     public Command buildResolveCommand() throws OperationCancelledException {
     266    public Command buildResolveCommand() {
    273267        ArrayList<Command> commands = new ArrayList<Command>();
    274         if (propertiesMerger.getModel().hasVisibleStateConflict()) {
    275             if (propertiesMerger.getModel().isDecidedVisibleState()) {
    276                 commands.addAll(propertiesMerger.getModel().buildResolveCommand(conflict));
    277             }
    278         } else {
    279             if (tagMerger.getModel().getNumResolvedConflicts() > 0) {
    280                 commands.add(tagMerger.getModel().buildResolveCommand(conflict));
    281             }
    282             commands.addAll(propertiesMerger.getModel().buildResolveCommand(conflict));
    283             if (my instanceof Way && nodeListMerger.getModel().isFrozen()) {
    284                 NodeListMergeModel model  =(NodeListMergeModel)nodeListMerger.getModel();
    285                 commands.add(model.buildResolveCommand(conflict));
    286             } else if (my instanceof Relation && relationMemberMerger.getModel().isFrozen()) {
    287                 RelationMemberListMergeModel model  =(RelationMemberListMergeModel)relationMemberMerger.getModel();
    288                 commands.add(model.buildResolveCommand((Relation)my, (Relation)their));
    289             }
    290             if (isResolvedCompletely()) {
    291                 commands.add(new VersionConflictResolveCommand(conflict));
    292                 commands.add(new ModifiedConflictResolveCommand(conflict));
    293             }
     268
     269        if (tagMerger.getModel().getNumResolvedConflicts() > 0) {
     270            commands.add(tagMerger.getModel().buildResolveCommand(conflict));
     271        }
     272        commands.addAll(propertiesMerger.getModel().buildResolveCommand(conflict));
     273        if (my instanceof Way && nodeListMerger.getModel().isFrozen()) {
     274            NodeListMergeModel model = (NodeListMergeModel) nodeListMerger.getModel();
     275            commands.add(model.buildResolveCommand(conflict));
     276        } else if (my instanceof Relation && relationMemberMerger.getModel().isFrozen()) {
     277            RelationMemberListMergeModel model = (RelationMemberListMergeModel) relationMemberMerger.getModel();
     278            commands.add(model.buildResolveCommand((Relation) my, (Relation) their));
     279        }
     280        if (isResolvedCompletely()) {
     281            commands.add(new VersionConflictResolveCommand(conflict));
     282            commands.add(new ModifiedConflictResolveCommand(conflict));
    294283        }
    295284        return new SequenceCommand(tr("Conflict Resolution"), commands);
Note: See TracChangeset for help on using the changeset viewer.