Ignore:
Timestamp:
2010-07-29T08:22:51+02:00 (15 years ago)
Author:
jttt
Message:

Allow SplitWayAction to work also when some non related ways are selected.

File:
1 edited

Legend:

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

    r3336 r3392  
    2323import javax.swing.JOptionPane;
    2424import javax.swing.JPanel;
    25 import javax.swing.tree.DefaultMutableTreeNode;
    26 import javax.swing.tree.MutableTreeNode;
    2725
    2826import org.openstreetmap.josm.Main;
     
    185183
    186184    @Override public Collection<PseudoCommand> getChildren() {
    187         if (toDelete.size() == 1) {
     185        if (toDelete.size() == 1)
    188186            return null;
    189         } else {
     187        else {
    190188            List<PseudoCommand> children = new ArrayList<PseudoCommand>();
    191189            for (final OsmPrimitive osm : toDelete) {
     
    193191                    @Override public JLabel getDescription() {
    194192                        return new JLabel(
    195                             tr("Deleted ''{0}''",
    196                                 osm.getDisplayName(DefaultNameFormatter.getInstance())),
    197                             ImageProvider.get(OsmPrimitiveType.from(osm)), JLabel.HORIZONTAL);
    198                         }
     193                                tr("Deleted ''{0}''",
     194                                        osm.getDisplayName(DefaultNameFormatter.getInstance())),
     195                                        ImageProvider.get(OsmPrimitiveType.from(osm)), JLabel.HORIZONTAL);
     196                    }
    199197                    @Override public Collection<? extends OsmPrimitive> getParticipatingPrimitives() {
    200198                        return Collections.singleton(osm);
     
    425423            chunks.add(n1);
    426424            chunks.add(n2);
    427             return SplitWayAction.splitWay(layer,ws.way, chunks).getCommand();
     425            return SplitWayAction.splitWay(layer,ws.way, chunks, Collections.<OsmPrimitive>emptyList()).getCommand();
    428426        }
    429427    }
     
    443441        if (a != null) {
    444442            for (OsmPrimitive osm : primitivesToDelete) {
    445                 if (osm.isIncomplete())
     443                if (osm.isIncomplete()) {
    446444                    incomplete = true;
    447                 else if (osm instanceof Node && !osm.isNewOrUndeleted()
    448                 && !a.contains(((Node) osm).getCoor()))
     445                } else if (osm instanceof Node && !osm.isNewOrUndeleted()
     446                        && !a.contains(((Node) osm).getCoor())) {
    449447                    outside = true;
     448                }
    450449            }
    451450        }
     
    453452        {
    454453            for (OsmPrimitive osm : primitivesToDelete)
    455                 if (osm.isIncomplete())
     454                if (osm.isIncomplete()) {
    456455                    incomplete = true;
     456                }
    457457        }
    458458        if(outside)
Note: See TracChangeset for help on using the changeset viewer.