- Timestamp:
- 2007-10-12T17:16:03+02:00 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java
r365 r372 11 11 import java.awt.event.ActionEvent; 12 12 import java.util.Collection; 13 import java.util.Collections; 13 14 import java.util.LinkedList; 14 15 … … 177 178 return; 178 179 boolean ctrl = (e.getModifiers() & ActionEvent.CTRL_MASK) != 0; 180 boolean alt = (e.getModifiers() & ActionEvent.ALT_MASK) != 0; 181 boolean shift = (e.getModifiers() & ActionEvent.SHIFT_MASK) != 0; 179 182 180 183 Collection<OsmPrimitive> sel = Main.ds.getSelected(); 181 184 OsmPrimitive osm = Main.map.mapView.getNearest(e.getPoint()); 182 if (ctrl) { 183 if (osm != null && !sel.contains(osm)) Main.ds.setSelected(osm); 184 185 Collection osmColl = osm == null 186 ? Collections.emptyList() : Collections.singleton(osm); 187 if (ctrl && shift) { 188 selectPrims(osmColl, true, false); 185 189 mode = Mode.rotate; 186 190 setCursor(ImageProvider.getCursor("rotate", null)); 187 191 } else if (osm != null) { 188 if (!sel.contains(osm)) Main.ds.setSelected(osm); 189 192 selectPrims(osmColl, shift, ctrl); 190 193 mode = Mode.move; 191 194 } else { … … 213 216 214 217 public void selectionEnded(Rectangle r, boolean alt, boolean shift, boolean ctrl) { 218 selectPrims(selectionManager.getObjectsInRectangle(r, alt), shift, ctrl); 219 } 220 221 public void selectPrims(Collection<OsmPrimitive> selectionList, boolean shift, boolean ctrl) { 215 222 if (shift && ctrl) 216 223 return; // not allowed together … … 222 229 curSel = Main.ds.getSelected(); 223 230 224 Collection<OsmPrimitive> selectionList = selectionManager.getObjectsInRectangle(r,alt);225 231 for (OsmPrimitive osm : selectionList) 226 232 if (ctrl)
Note:
See TracChangeset
for help on using the changeset viewer.