source: josm/trunk/src/org/openstreetmap/josm/actions/mapmode/ImproveWayAccuracyAction.java@ 13434

Last change on this file since 13434 was 13434, checked in by Don-vip, 6 years ago

see #8039, see #10456 - support read-only data layers

  • Property svn:eol-style set to native
File size: 25.0 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.actions.mapmode;
3
4import static org.openstreetmap.josm.tools.I18n.marktr;
5import static org.openstreetmap.josm.tools.I18n.tr;
6import static org.openstreetmap.josm.tools.I18n.trn;
7
8import java.awt.BasicStroke;
9import java.awt.Color;
10import java.awt.Cursor;
11import java.awt.Graphics2D;
12import java.awt.Point;
13import java.awt.event.KeyEvent;
14import java.awt.event.MouseEvent;
15import java.util.ArrayList;
16import java.util.Collection;
17import java.util.Collections;
18import java.util.LinkedList;
19import java.util.List;
20
21import javax.swing.JOptionPane;
22
23import org.openstreetmap.josm.Main;
24import org.openstreetmap.josm.command.AddCommand;
25import org.openstreetmap.josm.command.ChangeCommand;
26import org.openstreetmap.josm.command.Command;
27import org.openstreetmap.josm.command.DeleteCommand;
28import org.openstreetmap.josm.command.MoveCommand;
29import org.openstreetmap.josm.command.SequenceCommand;
30import org.openstreetmap.josm.data.Bounds;
31import org.openstreetmap.josm.data.SelectionChangedListener;
32import org.openstreetmap.josm.data.coor.EastNorth;
33import org.openstreetmap.josm.data.osm.DataSet;
34import org.openstreetmap.josm.data.osm.Node;
35import org.openstreetmap.josm.data.osm.OsmPrimitive;
36import org.openstreetmap.josm.data.osm.Way;
37import org.openstreetmap.josm.data.osm.WaySegment;
38import org.openstreetmap.josm.data.preferences.CachingProperty;
39import org.openstreetmap.josm.data.preferences.IntegerProperty;
40import org.openstreetmap.josm.data.preferences.NamedColorProperty;
41import org.openstreetmap.josm.data.preferences.StrokeProperty;
42import org.openstreetmap.josm.gui.MainApplication;
43import org.openstreetmap.josm.gui.MapFrame;
44import org.openstreetmap.josm.gui.MapView;
45import org.openstreetmap.josm.gui.draw.MapViewPath;
46import org.openstreetmap.josm.gui.draw.SymbolShape;
47import org.openstreetmap.josm.gui.layer.AbstractMapViewPaintable;
48import org.openstreetmap.josm.gui.layer.Layer;
49import org.openstreetmap.josm.gui.util.ModifierExListener;
50import org.openstreetmap.josm.tools.ImageProvider;
51import org.openstreetmap.josm.tools.Pair;
52import org.openstreetmap.josm.tools.Shortcut;
53
54/**
55 * A special map mode that is optimized for improving way geometry.
56 * (by efficiently moving, adding and deleting way-nodes)
57 *
58 * @author Alexander Kachkaev <alexander@kachkaev.ru>, 2011
59 */
60public class ImproveWayAccuracyAction extends MapMode implements
61 SelectionChangedListener, ModifierExListener {
62
63 private static final String CROSSHAIR = /* ICON(cursor/)*/ "crosshair";
64
65 enum State {
66 SELECTING, IMPROVING
67 }
68
69 private State state;
70
71 private MapView mv;
72
73 private static final long serialVersionUID = 42L;
74
75 private transient Way targetWay;
76 private transient Node candidateNode;
77 private transient WaySegment candidateSegment;
78
79 private Point mousePos;
80 private boolean dragging;
81
82 private final Cursor cursorSelect = ImageProvider.getCursor(/* ICON(cursor/)*/ "normal", /* ICON(cursor/modifier/)*/ "mode");
83 private final Cursor cursorSelectHover = ImageProvider.getCursor(/* ICON(cursor/)*/ "hand", /* ICON(cursor/modifier/)*/ "mode");
84 private final Cursor cursorImprove = ImageProvider.getCursor(CROSSHAIR, null);
85 private final Cursor cursorImproveAdd = ImageProvider.getCursor(CROSSHAIR, /* ICON(cursor/modifier/)*/ "addnode");
86 private final Cursor cursorImproveDelete = ImageProvider.getCursor(CROSSHAIR, /* ICON(cursor/modifier/)*/ "delete_node");
87 private final Cursor cursorImproveAddLock = ImageProvider.getCursor(CROSSHAIR, /* ICON(cursor/modifier/)*/ "add_node_lock");
88 private final Cursor cursorImproveLock = ImageProvider.getCursor(CROSSHAIR, /* ICON(cursor/modifier/)*/ "lock");
89
90 private Color guideColor;
91
92 private static final CachingProperty<BasicStroke> SELECT_TARGET_WAY_STROKE
93 = new StrokeProperty("improvewayaccuracy.stroke.select-target", "2").cached();
94 private static final CachingProperty<BasicStroke> MOVE_NODE_STROKE
95 = new StrokeProperty("improvewayaccuracy.stroke.move-node", "1 6").cached();
96 private static final CachingProperty<BasicStroke> MOVE_NODE_INTERSECTING_STROKE
97 = new StrokeProperty("improvewayaccuracy.stroke.move-node-intersecting", "1 2 6").cached();
98 private static final CachingProperty<BasicStroke> ADD_NODE_STROKE
99 = new StrokeProperty("improvewayaccuracy.stroke.add-node", "1").cached();
100 private static final CachingProperty<BasicStroke> DELETE_NODE_STROKE
101 = new StrokeProperty("improvewayaccuracy.stroke.delete-node", "1").cached();
102 private static final CachingProperty<Integer> DOT_SIZE
103 = new IntegerProperty("improvewayaccuracy.dot-size", 6).cached();
104
105 private boolean selectionChangedBlocked;
106
107 protected String oldModeHelpText;
108
109 private final transient AbstractMapViewPaintable temporaryLayer = new AbstractMapViewPaintable() {
110 @Override
111 public void paint(Graphics2D g, MapView mv, Bounds bbox) {
112 ImproveWayAccuracyAction.this.paint(g, mv, bbox);
113 }
114 };
115
116 /**
117 * Constructs a new {@code ImproveWayAccuracyAction}.
118 * @since 11713
119 */
120 public ImproveWayAccuracyAction() {
121 super(tr("Improve Way Accuracy"), "improvewayaccuracy",
122 tr("Improve Way Accuracy mode"),
123 Shortcut.registerShortcut("mapmode:ImproveWayAccuracy",
124 tr("Mode: {0}", tr("Improve Way Accuracy")),
125 KeyEvent.VK_W, Shortcut.DIRECT), Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
126
127 readPreferences();
128 }
129
130 // -------------------------------------------------------------------------
131 // Mode methods
132 // -------------------------------------------------------------------------
133 @Override
134 public void enterMode() {
135 if (!isEnabled()) {
136 return;
137 }
138 super.enterMode();
139 readPreferences();
140
141 MapFrame map = MainApplication.getMap();
142 mv = map.mapView;
143 mousePos = null;
144 oldModeHelpText = "";
145
146 if (getLayerManager().getEditDataSet() == null) {
147 return;
148 }
149
150 updateStateByCurrentSelection();
151
152 map.mapView.addMouseListener(this);
153 map.mapView.addMouseMotionListener(this);
154 map.mapView.addTemporaryLayer(temporaryLayer);
155 DataSet.addSelectionListener(this);
156
157 map.keyDetector.addModifierExListener(this);
158 }
159
160 @Override
161 protected void readPreferences() {
162 guideColor = new NamedColorProperty(marktr("improve way accuracy helper line"), Color.RED).get();
163 }
164
165 @Override
166 public void exitMode() {
167 super.exitMode();
168
169 MapFrame map = MainApplication.getMap();
170 map.mapView.removeMouseListener(this);
171 map.mapView.removeMouseMotionListener(this);
172 map.mapView.removeTemporaryLayer(temporaryLayer);
173 DataSet.removeSelectionListener(this);
174
175 map.keyDetector.removeModifierExListener(this);
176 temporaryLayer.invalidate();
177 }
178
179 @Override
180 protected void updateStatusLine() {
181 String newModeHelpText = getModeHelpText();
182 if (!newModeHelpText.equals(oldModeHelpText)) {
183 oldModeHelpText = newModeHelpText;
184 MapFrame map = MainApplication.getMap();
185 map.statusLine.setHelpText(newModeHelpText);
186 map.statusLine.repaint();
187 }
188 }
189
190 @Override
191 public String getModeHelpText() {
192 if (state == State.SELECTING) {
193 if (targetWay != null) {
194 return tr("Click on the way to start improving its shape.");
195 } else {
196 return tr("Select a way that you want to make more accurate.");
197 }
198 } else {
199 if (ctrl) {
200 return tr("Click to add a new node. Release Ctrl to move existing nodes or hold Alt to delete.");
201 } else if (alt) {
202 return tr("Click to delete the highlighted node. Release Alt to move existing nodes or hold Ctrl to add new nodes.");
203 } else {
204 return tr("Click to move the highlighted node. Hold Ctrl to add new nodes, or Alt to delete.");
205 }
206 }
207 }
208
209 @Override
210 public boolean layerIsSupported(Layer l) {
211 return isEditableDataLayer(l);
212 }
213
214 @Override
215 protected void updateEnabledState() {
216 setEnabled(getLayerManager().getEditLayer() != null);
217 }
218
219 // -------------------------------------------------------------------------
220 // MapViewPaintable methods
221 // -------------------------------------------------------------------------
222 /**
223 * Redraws temporary layer. Highlights targetWay in select mode. Draws
224 * preview lines in improve mode and highlights the candidateNode
225 * @param g The graphics
226 * @param mv The map view
227 * @param bbox The bounding box
228 */
229 public void paint(Graphics2D g, MapView mv, Bounds bbox) {
230 if (mousePos == null) {
231 return;
232 }
233
234 g.setColor(guideColor);
235
236 if (state == State.SELECTING && targetWay != null) {
237 // Highlighting the targetWay in Selecting state
238 // Non-native highlighting is used, because sometimes highlighted
239 // segments are covered with others, which is bad.
240 BasicStroke stroke = SELECT_TARGET_WAY_STROKE.get();
241 g.setStroke(stroke);
242
243 List<Node> nodes = targetWay.getNodes();
244
245 g.draw(new MapViewPath(mv).append(nodes, false).computeClippedLine(stroke));
246
247 } else if (state == State.IMPROVING) {
248 // Drawing preview lines and highlighting the node
249 // that is going to be moved.
250 // Non-native highlighting is used here as well.
251
252 // Finding endpoints
253 Node p1 = null;
254 Node p2 = null;
255 if (ctrl && candidateSegment != null) {
256 g.setStroke(ADD_NODE_STROKE.get());
257 p1 = candidateSegment.getFirstNode();
258 p2 = candidateSegment.getSecondNode();
259 } else if (!alt && !ctrl && candidateNode != null) {
260 g.setStroke(MOVE_NODE_STROKE.get());
261 List<Pair<Node, Node>> wpps = targetWay.getNodePairs(false);
262 for (Pair<Node, Node> wpp : wpps) {
263 if (wpp.a == candidateNode) {
264 p1 = wpp.b;
265 }
266 if (wpp.b == candidateNode) {
267 p2 = wpp.a;
268 }
269 if (p1 != null && p2 != null) {
270 break;
271 }
272 }
273 } else if (alt && !ctrl && candidateNode != null) {
274 g.setStroke(DELETE_NODE_STROKE.get());
275 List<Node> nodes = targetWay.getNodes();
276 int index = nodes.indexOf(candidateNode);
277
278 // Only draw line if node is not first and/or last
279 if (index > 0 && index < (nodes.size() - 1)) {
280 p1 = nodes.get(index - 1);
281 p2 = nodes.get(index + 1);
282 } else if (targetWay.isClosed()) {
283 p1 = targetWay.getNode(1);
284 p2 = targetWay.getNode(nodes.size() - 2);
285 }
286 // TODO: indicate what part that will be deleted? (for end nodes)
287 }
288
289
290 // Drawing preview lines
291 MapViewPath b = new MapViewPath(mv);
292 if (alt && !ctrl) {
293 // In delete mode
294 if (p1 != null && p2 != null) {
295 b.moveTo(p1);
296 b.lineTo(p2);
297 }
298 } else {
299 // In add or move mode
300 if (p1 != null) {
301 b.moveTo(mousePos.x, mousePos.y);
302 b.lineTo(p1);
303 }
304 if (p2 != null) {
305 b.moveTo(mousePos.x, mousePos.y);
306 b.lineTo(p2);
307 }
308 }
309 g.draw(b.computeClippedLine(g.getStroke()));
310
311 // Highlighting candidateNode
312 if (candidateNode != null) {
313 p1 = candidateNode;
314 g.fill(new MapViewPath(mv).shapeAround(p1, SymbolShape.SQUARE, DOT_SIZE.get()));
315 }
316
317 if (!alt && !ctrl && candidateNode != null) {
318 b.reset();
319 drawIntersectingWayHelperLines(mv, b);
320 g.setStroke(MOVE_NODE_INTERSECTING_STROKE.get());
321 g.draw(b.computeClippedLine(g.getStroke()));
322 }
323
324 }
325 }
326
327 protected void drawIntersectingWayHelperLines(MapView mv, MapViewPath b) {
328 for (final OsmPrimitive referrer : candidateNode.getReferrers()) {
329 if (!(referrer instanceof Way) || targetWay.equals(referrer)) {
330 continue;
331 }
332 final List<Node> nodes = ((Way) referrer).getNodes();
333 for (int i = 0; i < nodes.size(); i++) {
334 if (!candidateNode.equals(nodes.get(i))) {
335 continue;
336 }
337 if (i > 0) {
338 b.moveTo(mousePos.x, mousePos.y);
339 b.lineTo(nodes.get(i - 1));
340 }
341 if (i < nodes.size() - 1) {
342 b.moveTo(mousePos.x, mousePos.y);
343 b.lineTo(nodes.get(i + 1));
344 }
345 }
346 }
347 }
348
349 // -------------------------------------------------------------------------
350 // Event handlers
351 // -------------------------------------------------------------------------
352 @Override
353 public void modifiersExChanged(int modifiers) {
354 if (!MainApplication.isDisplayingMapView() || !MainApplication.getMap().mapView.isActiveLayerDrawable()) {
355 return;
356 }
357 updateKeyModifiersEx(modifiers);
358 updateCursorDependentObjectsIfNeeded();
359 updateCursor();
360 updateStatusLine();
361 temporaryLayer.invalidate();
362 }
363
364 @Override
365 public void selectionChanged(Collection<? extends OsmPrimitive> newSelection) {
366 if (selectionChangedBlocked) {
367 return;
368 }
369 updateStateByCurrentSelection();
370 }
371
372 @Override
373 public void mouseDragged(MouseEvent e) {
374 dragging = true;
375 mouseMoved(e);
376 }
377
378 @Override
379 public void mouseMoved(MouseEvent e) {
380 if (!isEnabled()) {
381 return;
382 }
383
384 mousePos = e.getPoint();
385
386 updateKeyModifiers(e);
387 updateCursorDependentObjectsIfNeeded();
388 updateCursor();
389 updateStatusLine();
390 temporaryLayer.invalidate();
391 }
392
393 @Override
394 public void mouseReleased(MouseEvent e) {
395 dragging = false;
396 if (!isEnabled() || e.getButton() != MouseEvent.BUTTON1) {
397 return;
398 }
399
400 DataSet ds = getLayerManager().getEditDataSet();
401 updateKeyModifiers(e);
402 mousePos = e.getPoint();
403
404 if (state == State.SELECTING) {
405 if (targetWay != null) {
406 ds.setSelected(targetWay.getPrimitiveId());
407 updateStateByCurrentSelection();
408 }
409 } else if (state == State.IMPROVING) {
410 // Checking if the new coordinate is outside of the world
411 if (mv.getLatLon(mousePos.x, mousePos.y).isOutSideWorld()) {
412 JOptionPane.showMessageDialog(Main.parent,
413 tr("Cannot add a node outside of the world."),
414 tr("Warning"), JOptionPane.WARNING_MESSAGE);
415 return;
416 }
417
418 if (ctrl && !alt && candidateSegment != null) {
419 // Adding a new node to the highlighted segment
420 // Important: If there are other ways containing the same
421 // segment, a node must added to all of that ways.
422 Collection<Command> virtualCmds = new LinkedList<>();
423
424 // Creating a new node
425 Node virtualNode = new Node(mv.getEastNorth(mousePos.x,
426 mousePos.y));
427 virtualCmds.add(new AddCommand(ds, virtualNode));
428
429 // Looking for candidateSegment copies in ways that are
430 // referenced
431 // by candidateSegment nodes
432 List<Way> firstNodeWays = OsmPrimitive.getFilteredList(
433 candidateSegment.getFirstNode().getReferrers(),
434 Way.class);
435 List<Way> secondNodeWays = OsmPrimitive.getFilteredList(
436 candidateSegment.getFirstNode().getReferrers(),
437 Way.class);
438
439 Collection<WaySegment> virtualSegments = new LinkedList<>();
440 for (Way w : firstNodeWays) {
441 List<Pair<Node, Node>> wpps = w.getNodePairs(true);
442 for (Way w2 : secondNodeWays) {
443 if (!w.equals(w2)) {
444 continue;
445 }
446 // A way is referenced in both nodes.
447 // Checking if there is such segment
448 int i = -1;
449 for (Pair<Node, Node> wpp : wpps) {
450 ++i;
451 boolean ab = wpp.a.equals(candidateSegment.getFirstNode())
452 && wpp.b.equals(candidateSegment.getSecondNode());
453 boolean ba = wpp.b.equals(candidateSegment.getFirstNode())
454 && wpp.a.equals(candidateSegment.getSecondNode());
455 if (ab || ba) {
456 virtualSegments.add(new WaySegment(w, i));
457 }
458 }
459 }
460 }
461
462 // Adding the node to all segments found
463 for (WaySegment virtualSegment : virtualSegments) {
464 Way w = virtualSegment.way;
465 Way wnew = new Way(w);
466 wnew.addNode(virtualSegment.lowerIndex + 1, virtualNode);
467 virtualCmds.add(new ChangeCommand(w, wnew));
468 }
469
470 // Finishing the sequence command
471 String text = trn("Add a new node to way",
472 "Add a new node to {0} ways",
473 virtualSegments.size(), virtualSegments.size());
474
475 MainApplication.undoRedo.add(new SequenceCommand(text, virtualCmds));
476
477 } else if (alt && !ctrl && candidateNode != null) {
478 // Deleting the highlighted node
479
480 //check to see if node is in use by more than one object
481 List<OsmPrimitive> referrers = candidateNode.getReferrers();
482 List<Way> ways = OsmPrimitive.getFilteredList(referrers, Way.class);
483 if (referrers.size() != 1 || ways.size() != 1) {
484 // detach node from way
485 final Way newWay = new Way(targetWay);
486 final List<Node> nodes = newWay.getNodes();
487 nodes.remove(candidateNode);
488 newWay.setNodes(nodes);
489 if (nodes.size() < 2) {
490 final Command deleteCmd = DeleteCommand.delete(Collections.singleton(targetWay), true);
491 if (deleteCmd != null) {
492 MainApplication.undoRedo.add(deleteCmd);
493 }
494 } else {
495 MainApplication.undoRedo.add(new ChangeCommand(targetWay, newWay));
496 }
497 } else if (candidateNode.isTagged()) {
498 JOptionPane.showMessageDialog(Main.parent,
499 tr("Cannot delete node that has tags"),
500 tr("Error"), JOptionPane.ERROR_MESSAGE);
501 } else {
502 final Command deleteCmd = DeleteCommand.delete(Collections.singleton(candidateNode), true);
503 if (deleteCmd != null) {
504 MainApplication.undoRedo.add(deleteCmd);
505 }
506 }
507
508
509 } else if (candidateNode != null) {
510 // Moving the highlighted node
511 EastNorth nodeEN = candidateNode.getEastNorth();
512 EastNorth cursorEN = mv.getEastNorth(mousePos.x, mousePos.y);
513
514 MainApplication.undoRedo.add(new MoveCommand(candidateNode, cursorEN.east() - nodeEN.east(), cursorEN.north() - nodeEN.north()));
515 }
516 }
517
518 mousePos = null;
519 updateCursor();
520 updateStatusLine();
521 temporaryLayer.invalidate();
522 }
523
524 @Override
525 public void mouseExited(MouseEvent e) {
526 if (!isEnabled()) {
527 return;
528 }
529
530 if (!dragging) {
531 mousePos = null;
532 }
533 temporaryLayer.invalidate();
534 }
535
536 // -------------------------------------------------------------------------
537 // Custom methods
538 // -------------------------------------------------------------------------
539 /**
540 * Sets new cursor depending on state, mouse position
541 */
542 private void updateCursor() {
543 if (!isEnabled()) {
544 mv.setNewCursor(null, this);
545 return;
546 }
547
548 if (state == State.SELECTING) {
549 mv.setNewCursor(targetWay == null ? cursorSelect
550 : cursorSelectHover, this);
551 } else if (state == State.IMPROVING) {
552 if (alt && !ctrl) {
553 mv.setNewCursor(cursorImproveDelete, this);
554 } else if (shift || dragging) {
555 if (ctrl) {
556 mv.setNewCursor(cursorImproveAddLock, this);
557 } else {
558 mv.setNewCursor(cursorImproveLock, this);
559 }
560 } else if (ctrl && !alt) {
561 mv.setNewCursor(cursorImproveAdd, this);
562 } else {
563 mv.setNewCursor(cursorImprove, this);
564 }
565 }
566 }
567
568 /**
569 * Updates these objects under cursor: targetWay, candidateNode,
570 * candidateSegment
571 */
572 public void updateCursorDependentObjectsIfNeeded() {
573 if (state == State.IMPROVING && (shift || dragging)
574 && !(candidateNode == null && candidateSegment == null)) {
575 return;
576 }
577
578 if (mousePos == null) {
579 candidateNode = null;
580 candidateSegment = null;
581 return;
582 }
583
584 if (state == State.SELECTING) {
585 targetWay = ImproveWayAccuracyHelper.findWay(mv, mousePos);
586 } else if (state == State.IMPROVING) {
587 if (ctrl && !alt) {
588 candidateSegment = ImproveWayAccuracyHelper.findCandidateSegment(mv,
589 targetWay, mousePos);
590 candidateNode = null;
591 } else {
592 candidateNode = ImproveWayAccuracyHelper.findCandidateNode(mv,
593 targetWay, mousePos);
594 candidateSegment = null;
595 }
596 }
597 }
598
599 /**
600 * Switches to Selecting state
601 */
602 public void startSelecting() {
603 state = State.SELECTING;
604
605 targetWay = null;
606
607 temporaryLayer.invalidate();
608 updateStatusLine();
609 }
610
611 /**
612 * Switches to Improving state
613 *
614 * @param targetWay Way that is going to be improved
615 */
616 public void startImproving(Way targetWay) {
617 state = State.IMPROVING;
618
619 DataSet ds = getLayerManager().getEditDataSet();
620 Collection<OsmPrimitive> currentSelection = ds.getSelected();
621 if (currentSelection.size() != 1
622 || !currentSelection.iterator().next().equals(targetWay)) {
623 selectionChangedBlocked = true;
624 ds.clearSelection();
625 ds.setSelected(targetWay.getPrimitiveId());
626 selectionChangedBlocked = false;
627 }
628
629 this.targetWay = targetWay;
630 this.candidateNode = null;
631 this.candidateSegment = null;
632
633 temporaryLayer.invalidate();
634 updateStatusLine();
635 }
636
637 /**
638 * Updates the state according to the current selection. Goes to Improve
639 * state if a single way or node is selected. Extracts a way by a node in
640 * the second case.
641 *
642 */
643 private void updateStateByCurrentSelection() {
644 final List<Node> nodeList = new ArrayList<>();
645 final List<Way> wayList = new ArrayList<>();
646 final Collection<OsmPrimitive> sel = getLayerManager().getEditDataSet().getSelected();
647
648 // Collecting nodes and ways from the selection
649 for (OsmPrimitive p : sel) {
650 if (p instanceof Way) {
651 wayList.add((Way) p);
652 }
653 if (p instanceof Node) {
654 nodeList.add((Node) p);
655 }
656 }
657
658 if (wayList.size() == 1) {
659 // Starting improving the single selected way
660 startImproving(wayList.get(0));
661 return;
662 } else if (nodeList.size() == 1) {
663 // Starting improving the only way of the single selected node
664 List<OsmPrimitive> r = nodeList.get(0).getReferrers();
665 if (r.size() == 1 && (r.get(0) instanceof Way)) {
666 startImproving((Way) r.get(0));
667 return;
668 }
669 }
670
671 // Starting selecting by default
672 startSelecting();
673 }
674}
Note: See TracBrowser for help on using the repository browser.