Changeset 2882 in josm for trunk/src/org/openstreetmap


Ignore:
Timestamp:
2010-01-23T14:42:25+01:00 (15 years ago)
Author:
jttt
Message:

Fixed #4409 after confict management: nodes are not selectable

Location:
trunk/src/org/openstreetmap/josm/gui/conflict/pair
Files:
2 edited

Legend:

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

    r2846 r2882  
    55
    66import java.util.ArrayList;
    7 import java.util.logging.Logger;
    87
     8import javax.swing.JOptionPane;
    99import javax.swing.table.DefaultTableModel;
    1010
    1111import org.openstreetmap.josm.command.WayNodesConflictResolverCommand;
     12import org.openstreetmap.josm.data.osm.DataSet;
    1213import org.openstreetmap.josm.data.osm.Node;
    1314import org.openstreetmap.josm.data.osm.Way;
     15import org.openstreetmap.josm.gui.DefaultNameFormatter;
    1416import org.openstreetmap.josm.gui.conflict.pair.ListMergeModel;
    1517import org.openstreetmap.josm.gui.conflict.pair.ListRole;
     
    1719
    1820public class NodeListMergeModel extends ListMergeModel<Node>{
     21    //private static final Logger logger = Logger.getLogger(NodeListMergeModel.class.getName());
    1922
    20     private static final Logger logger = Logger.getLogger(NodeListMergeModel.class.getName());
     23    private DataSet myDataset;
    2124
    2225    /**
     
    3033     */
    3134    public void populate(Way my, Way their) {
     35        this.myDataset = my.getDataSet();
     36
    3237        CheckParameterUtil.ensureParameterNotNull(my, "my");
    3338        CheckParameterUtil.ensureParameterNotNull(their, "their");
     
    8489    @Override
    8590    protected Node cloneEntryForMergedList(Node entry) {
    86         return entry;
     91        Node node = (Node) myDataset.getPrimitiveById(entry);
     92        if (node.isDeleted()) {
     93            JOptionPane.showMessageDialog(null, tr("Node {0} cannot be added to the way because it was deleted", node.getDisplayName(DefaultNameFormatter.getInstance())));
     94            return null;
     95        } else
     96            return node;
    8797    }
    8898}
  • trunk/src/org/openstreetmap/josm/gui/conflict/pair/relation/RelationMemberListMergeModel.java

    r2881 r2882  
    101101        if (primitive.isDeleted()) {
    102102            JOptionPane.showMessageDialog(null,
    103                     tr("Primitive {0} cannot be added to the relation because it was removed.",
     103                    tr("Primitive {0} cannot be added to the relation because it was deleted.",
    104104                            primitive.getDisplayName(DefaultNameFormatter.getInstance())));
    105105            return null;
Note: See TracChangeset for help on using the changeset viewer.