- Timestamp:
- 2009-02-28T21:54:34+01:00 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java
r1441 r1454 197 197 198 198 Main.main.undoRedo.add(new SequenceCommand(text, virtualCmds)); 199 selectPrims(Collections.singleton((OsmPrimitive)virtualNode), false, false );199 selectPrims(Collections.singleton((OsmPrimitive)virtualNode), false, false, false); 200 200 virtualWays.clear(); 201 201 virtualNode = null; … … 333 333 334 334 if (ctrl && shift) { 335 if (Main.ds.getSelected().isEmpty()) selectPrims(osmColl, true, false );335 if (Main.ds.getSelected().isEmpty()) selectPrims(osmColl, true, false, false); 336 336 mode = Mode.rotate; 337 337 setCursor(ImageProvider.getCursor("rotate", null)); … … 343 343 selectPrims(osmColl, 344 344 shift || Main.ds.getSelected().containsAll(osmColl), 345 ctrl );345 ctrl, false); 346 346 mode = Mode.move; 347 347 } else { … … 391 391 selectPrims( 392 392 Main.map.mapView.getNearestCollection(e.getPoint()), 393 shift, ctrl );393 shift, ctrl, true); 394 394 395 395 // If the user double-clicked a node, change to draw mode … … 433 433 434 434 public void selectionEnded(Rectangle r, boolean alt, boolean shift, boolean ctrl) { 435 selectPrims(selectionManager.getObjectsInRectangle(r, alt), shift, ctrl );436 } 437 438 public void selectPrims(Collection<OsmPrimitive> selectionList, boolean shift, boolean ctrl ) {439 if ( shift && ctrl)435 selectPrims(selectionManager.getObjectsInRectangle(r, alt), shift, ctrl, false); 436 } 437 438 public void selectPrims(Collection<OsmPrimitive> selectionList, boolean shift, boolean ctrl, boolean released) { 439 if ((shift && ctrl) || (ctrl && !released)) 440 440 return; // not allowed together 441 441 … … 447 447 448 448 for (OsmPrimitive osm : selectionList) 449 { 449 450 if (ctrl) 450 curSel.remove(osm); 451 { 452 if(curSel.contains(osm)) 453 curSel.remove(osm); 454 else 455 curSel.add(osm); 456 } 451 457 else 452 458 curSel.add(osm); 459 } 453 460 Main.ds.setSelected(curSel); 454 461 Main.map.mapView.repaint(); … … 463 470 return tr("Release the mouse button to stop rotating."); 464 471 } else { 465 return tr("Move objects by dragging; Shift to add to selection (Ctrl to remove); Shift-Ctrl to rotate selected; or change selection");472 return tr("Move objects by dragging; Shift to add to selection (Ctrl to toggle); Shift-Ctrl to rotate selected; or change selection"); 466 473 } 467 474 }
Note:
See TracChangeset
for help on using the changeset viewer.