Changeset 8470 in josm for trunk/src/org/openstreetmap/josm/actions/mapmode/DeleteAction.java
- Timestamp:
- 2015-06-06T04:32:00+02:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/mapmode/DeleteAction.java
r8308 r8470 35 35 * 36 36 * The user can click on an object, which gets deleted if possible. When Ctrl is 37 * pressed when releasing the button, the objects and all its references are 38 * deleted. 37 * pressed when releasing the button, the objects and all its references are deleted. 39 38 * 40 39 * If the user did not press Ctrl and the object has any references, the user … … 47 46 */ 48 47 public class DeleteAction extends MapMode implements ModifierListener { 49 // Cache previous mouse event (needed when only the modifier keys are 50 // pressed but the mouse isn't moved) 48 // Cache previous mouse event (needed when only the modifier keys are pressed but the mouse isn't moved) 51 49 private MouseEvent oldEvent = null; 52 50 … … 181 179 /** 182 180 * handles everything related to highlighting primitives and way 183 * segments for the given pointer position (via MouseEvent) and 184 * modifiers. 185 * @param e 186 * @param modifiers 181 * segments for the given pointer position (via MouseEvent) and modifiers. 182 * @param e current mouse event 183 * @param modifiers mouse modifiers, not necessarly taken from the given mouse event 187 184 */ 188 185 private void addHighlighting(MouseEvent e, int modifiers) { … … 202 199 Command delCmd = buildDeleteCommands(e, modifiers, true); 203 200 if(delCmd != null) { 204 // all other cases delete OsmPrimitives directly, so we can 205 // safely do the following 201 // all other cases delete OsmPrimitives directly, so we can safely do the following 206 202 for(OsmPrimitive osm : delCmd.getParticipatingPrimitives()) { 207 203 newHighlights.add(osm); … … 236 232 237 233 /** 238 * This function handles all work related to updating the cursor and 239 * highlights 234 * This function handles all work related to updating the cursor and highlights 240 235 * 241 * @param e 242 * @param modifiers 236 * @param e current mouse event 237 * @param modifiers mouse modifiers, not necessarly taken from the given mouse event 243 238 */ 244 239 private void updateCursor(MouseEvent e, int modifiers) { … … 260 255 * mouse is not moved and only modifier keys are pressed, no mouse event 261 256 * occurs. We can use AWTEvent to catch those but still lack a proper 262 * mouseevent. Instead we copy the previous event and only update the 263 * modifiers. 257 * mouseevent. Instead we copy the previous event and only update the modifiers. 264 258 */ 265 259 private void giveUserFeedback(MouseEvent e, int modifiers) { … … 279 273 /** 280 274 * If user clicked with the left button, delete the nearest object. 281 * position.282 275 */ 283 276 @Override … … 372 365 * @param e MouseEvent from which modifiers and position are taken 373 366 * @param modifiers For explanation, see {@link #updateCursor} 374 * @param silent Set to true if the user should not be bugged with additional 375 * dialogs 367 * @param silent Set to true if the user should not be bugged with additional dialogs 376 368 * @return delete command 377 369 */
Note:
See TracChangeset
for help on using the changeset viewer.